Skip to content

Commit

Permalink
Merge pull request #42 from G-Core/ref/stats_interface
Browse files Browse the repository at this point in the history
refactor: drop async from write_stats method
  • Loading branch information
ruslanti authored Oct 16, 2024
2 parents 92e91aa + 07d59c8 commit 0c396ff
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 37 deletions.
43 changes: 13 additions & 30 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/http-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ futures = "0.3.30"
once_cell = "1.19"
prometheus = { version = "0.13.3", features = ["process"], optional = true }
serde = "1.0"
clickhouse = { version = "0.12.0", optional = true }
clickhouse = { version = "0.13", optional = true }
chrono = "0.4"
async-trait = "0.1"
wasmtime-wasi-http = "20.0.2"
Expand Down
6 changes: 3 additions & 3 deletions crates/http-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ where
request_id: request_id.to_string(),
..Default::default()
};
self.context.write_stats(stat_row).await;
self.context.write_stats(stat_row);
}
#[cfg(feature = "metrics")]
metrics::metrics(
Expand Down Expand Up @@ -407,7 +407,7 @@ where
request_id: request_id.to_string(),
..Default::default()
};
self.context.write_stats(stat_row).await;
self.context.write_stats(stat_row);
}
#[cfg(not(feature = "stats"))]
tracing::debug!(?fail_reason, request_id, "stats");
Expand Down Expand Up @@ -637,7 +637,7 @@ mod tests {
}

impl StatsWriter for TestContext {
async fn write_stats(&self, _stat: StatRow) {}
fn write_stats(&self, _stat: StatRow) {}
}

impl Router for TestContext {
Expand Down
2 changes: 1 addition & 1 deletion crates/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ serde = "1.0"
serde_json = "1.0.108"
chrono = { version = "0.4", features = ["serde"] }
prometheus = { version = "0.13.3", features = ["process"], optional = true }
clickhouse = { version = "0.12.0", optional = true }
clickhouse = { version = "0.13", optional = true }
lazy_static = { version = "1.4.0", optional = true }
wasmtime-wasi-http = "20.0.2"

Expand Down
2 changes: 1 addition & 1 deletion crates/runtime/src/util/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ pub struct StatRow {
pub struct StatRow;

pub trait StatsWriter {
fn write_stats(&self, stat: StatRow) -> impl std::future::Future<Output = ()> + Send;
fn write_stats(&self, stat: StatRow);
}
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl Router for CliContext {
}

impl StatsWriter for CliContext {
async fn write_stats(&self, _stat: StatRow) {}
fn write_stats(&self, _stat: StatRow) {}
}

fn parse_key_value<T, U>(
Expand Down

0 comments on commit 0c396ff

Please sign in to comment.