Skip to content

Commit 1368157

Browse files
authored
Merge pull request #1622 from jiacai2050/impl-metric
2 parents 941ea07 + 86e7619 commit 1368157

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

Cargo.lock

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ members = [
3737

3838
[workspace.dependencies]
3939
anyhow = { version = "1.0" }
40+
seahash = { version = "4" }
4041
metric_engine = { path = "src/metric_engine" }
4142
horaedb_storage = { package = "storage", path = "src/storage" }
4243
common = { path = "src/common" }

src/metric_engine/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ description.workspace = true
2929
anyhow = { workspace = true }
3030
common = { workspace = true }
3131
horaedb_storage = { workspace = true }
32+
seahash = { workspace = true }
3233
thiserror = { workspace = true }
3334
tokio = { workspace = true }
3435
tracing = { workspace = true }

src/metric_engine/src/metric/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ impl MetricManager {
4242
struct Inner {
4343
storage: TimeMergeStorageRef,
4444
}
45+
46+
impl Inner {
47+
async fn populate_metric_ids(&self, _samples: &mut [Sample]) -> Result<()> {
48+
todo!()
49+
}
50+
}

src/metric_engine/src/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ pub struct Sample {
3535
/// hash of labels(sorted)
3636
pub series_id: Option<SeriesId>,
3737
}
38+
39+
pub fn hash(buf: &[u8]) -> u64 {
40+
seahash::hash(buf)
41+
}

0 commit comments

Comments
 (0)