Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Speedtest (#48) #62

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 65 additions & 2 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ colored = "2.1.0"
config = "0.14.1"
dirs = "5.0.1"
humantime = "2.1.0"
indicatif = "0.17.9"
miette = { version = "7.2.0", features = ["fancy"] }
pin-project-lite = "0.2"
pin-utils = "0.1.0"
rand = "0.8.5"
scopeguard = "1.2.0"
serde = { version = "1.0.214", features = ["derive"] }
serde_json = "1.0.132"
thiserror = "1.0.67"
Expand Down
33 changes: 18 additions & 15 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ pub enum S2CliError {
#[error("Failed to initialize a `Record Reader`! {0}")]
RecordReaderInit(String),

#[error("Stream mutated concurrently during speedtest")]
SpeedtestStreamMutated,

#[error("Failed to write records: {0}")]
RecordWrite(String),

Expand Down Expand Up @@ -73,21 +76,21 @@ pub enum ServiceErrorContext {
impl std::fmt::Display for ServiceErrorContext {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
ServiceErrorContext::ListBasins => write!(f, "Failed to list basins"),
ServiceErrorContext::CreateBasin => write!(f, "Failed to create basin"),
ServiceErrorContext::DeleteBasin => write!(f, "Failed to delete basin"),
ServiceErrorContext::GetBasinConfig => write!(f, "Failed to get basin config"),
ServiceErrorContext::ReconfigureBasin => write!(f, "Failed to reconfigure basin"),
ServiceErrorContext::ListStreams => write!(f, "Failed to list streams"),
ServiceErrorContext::CreateStream => write!(f, "Failed to create stream"),
ServiceErrorContext::DeleteStream => write!(f, "Failed to delete stream"),
ServiceErrorContext::GetStreamConfig => write!(f, "Failed to get stream config"),
ServiceErrorContext::CheckTail => write!(f, "Failed to check tail"),
ServiceErrorContext::Trim => write!(f, "Failed to trim"),
ServiceErrorContext::Fence => write!(f, "Failed to set fencing token"),
ServiceErrorContext::AppendSession => write!(f, "Failed to append session"),
ServiceErrorContext::ReadSession => write!(f, "Failed to read session"),
ServiceErrorContext::ReconfigureStream => write!(f, "Failed to reconfigure stream"),
Self::ListBasins => write!(f, "Failed to list basins"),
Self::CreateBasin => write!(f, "Failed to create basin"),
Self::DeleteBasin => write!(f, "Failed to delete basin"),
Self::GetBasinConfig => write!(f, "Failed to get basin config"),
Self::ReconfigureBasin => write!(f, "Failed to reconfigure basin"),
Self::ListStreams => write!(f, "Failed to list streams"),
Self::CreateStream => write!(f, "Failed to create stream"),
Self::DeleteStream => write!(f, "Failed to delete stream"),
Self::GetStreamConfig => write!(f, "Failed to get stream config"),
Self::CheckTail => write!(f, "Failed to check tail"),
Self::Trim => write!(f, "Failed to trim"),
Self::Fence => write!(f, "Failed to set fencing token"),
Self::AppendSession => write!(f, "Failed to append session"),
Self::ReadSession => write!(f, "Failed to read session"),
Self::ReconfigureStream => write!(f, "Failed to reconfigure stream"),
}
}
}
Expand Down
Loading
Loading