Skip to content

Commit

Permalink
Try #1583:
Browse files Browse the repository at this point in the history
  • Loading branch information
mayastor-bors committed Feb 1, 2024
2 parents 11b4689 + 37e25ae commit 0457211
Show file tree
Hide file tree
Showing 23 changed files with 841 additions and 308 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions io-engine-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ bytes = "1.5.0"
chrono = "0.4.31"
colored_json = "4.0.0"
crossbeam = "0.8.2"
derive_builder = "0.12.0"
etcd-client = "0.12.1"
function_name = "0.3.0"
futures = "0.3.28"
Expand Down
10 changes: 9 additions & 1 deletion io-engine-tests/src/file_io.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use once_cell::sync::OnceCell;
use rand::{distributions::Uniform, Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;
use serde::Serialize;
use std::{
fmt::{Display, Formatter},
io::SeekFrom,
Expand All @@ -26,7 +27,8 @@ fn create_test_buf(buf_size: DataSize) -> Vec<u8> {
}

/// TODO
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Serialize)]
#[serde(into = "u64")]
pub struct DataSize(u64);

impl Display for DataSize {
Expand All @@ -47,6 +49,12 @@ impl From<DataSize> for usize {
}
}

impl From<u64> for DataSize {
fn from(value: u64) -> Self {
Self::from_bytes(value)
}
}

impl Default for DataSize {
fn default() -> Self {
Self::from_bytes(0)
Expand Down
Loading

0 comments on commit 0457211

Please sign in to comment.