Skip to content

Commit a0d02fe

Browse files
committed
chore: fix pre-release issues and add metrics-otel to CI
Fix two issues found during crates.io publishing and add missing CI coverage for the metrics-otel crate. Changes: - Fix invalid crates.io category `network` to `network-programming` in multiraft - Remove stale `record_replicate_batch` from otel metrics (trait renamed it to `record_write_batch`) - Add `metrics-otel` test job to CI workflow
1 parent 77f7657 commit a0d02fe

3 files changed

Lines changed: 19 additions & 13 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,24 @@ jobs:
235235
RUST_LOG: debug
236236
RUST_BACKTRACE: full
237237

238+
metrics-otel:
239+
runs-on: ubuntu-latest
240+
241+
steps:
242+
- name: Setup | Checkout
243+
uses: actions/checkout@v4
244+
245+
- name: Setup | Toolchain
246+
uses: actions-rust-lang/setup-rust-toolchain@v1
247+
with:
248+
toolchain: 'nightly'
249+
250+
- name: Unit Tests
251+
run: cargo test --manifest-path "metrics-otel/Cargo.toml"
252+
env:
253+
RUST_LOG: debug
254+
RUST_BACKTRACE: full
255+
238256
# Feature "serde" will be enabled if one of the member crates enables
239257
# "serde", such as `memstore`, when building a cargo workspace.
240258
#

metrics-otel/src/lib.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ pub struct Instruments {
9696
// Histograms for performance metrics
9797
apply_batch_size: Histogram<u64>,
9898
storage_append_batch_size: Histogram<u64>,
99-
replicate_batch_size: Histogram<u64>,
10099
write_batch_size: Histogram<u64>,
101100

102101
// Gauges for runtime state
@@ -131,11 +130,6 @@ impl Instruments {
131130
.with_description("Distribution of log entry counts when appending to storage")
132131
.build();
133132

134-
let replicate_batch_size = meter
135-
.u64_histogram("openraft.replication.batch_size")
136-
.with_description("Distribution of log entry counts in replication RPCs")
137-
.build();
138-
139133
let write_batch_size = meter
140134
.u64_histogram("openraft.write.batch_size")
141135
.with_description("Distribution of client write entries merged together")
@@ -181,7 +175,6 @@ impl Instruments {
181175
meter,
182176
apply_batch_size,
183177
storage_append_batch_size,
184-
replicate_batch_size,
185178
write_batch_size,
186179
current_term,
187180
last_log_index,
@@ -215,10 +208,6 @@ impl MetricsRecorder for Instruments {
215208
self.storage_append_batch_size.record(entry_count, &[]);
216209
}
217210

218-
fn record_replicate_batch(&self, entry_count: u64) {
219-
self.replicate_batch_size.record(entry_count, &[]);
220-
}
221-
222211
fn record_write_batch(&self, entry_count: u64) {
223212
self.write_batch_size.record(entry_count, &[]);
224213
}
@@ -271,7 +260,6 @@ mod tests {
271260
// Histograms
272261
instruments.record_apply_batch(10);
273262
instruments.record_append_batch(5);
274-
instruments.record_replicate_batch(8);
275263
instruments.record_write_batch(3);
276264

277265
// Gauges

multiraft/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ readme = "README.md"
66
version = "0.10.0-alpha.14"
77
edition = "2024"
88
authors = ["Databend Authors <opensource@datafuselabs.com>"]
9-
categories = ["network", "asynchronous", "data-structures"]
9+
categories = ["network-programming", "asynchronous", "data-structures"]
1010
homepage = "https://github.com/databendlabs/openraft"
1111
keywords = ["consensus", "raft", "multi-raft"]
1212
license = "MIT OR Apache-2.0"

0 commit comments

Comments
 (0)