mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-22 22:20:02 +00:00
* feat: introduce wal benchmarker * chore: add log store metrics * chore: add some comments to wal benchmarker * fix: ci * chore: add more metrics for kafka logstore * chore: add more timers for kafka logstore * chore: add more configs * chore: move humantime to common dependencies * refactor: refactor wal benchmarker * fix: apply suggestions from code review * doc: add a simple README for wal benchmarker * fix: Cargo.toml * fix: clippy * chore: rename wal.rs to wal_bench.rs * fix: compile
40 lines
1.4 KiB
Rust
40 lines
1.4 KiB
Rust
// Copyright 2023 Greptime Team
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
use lazy_static::lazy_static;
|
|
use prometheus::*;
|
|
|
|
/// Logstore label.
|
|
pub const LOGSTORE_LABEL: &str = "logstore";
|
|
/// Operation type label.
|
|
pub const OPTYPE_LABEL: &str = "optype";
|
|
|
|
lazy_static! {
|
|
/// Counters of bytes of each operation on a logstore.
|
|
pub static ref METRIC_WAL_OP_BYTES_TOTAL: IntCounterVec = register_int_counter_vec!(
|
|
"greptime_bench_wal_op_bytes_total",
|
|
"wal operation bytes total",
|
|
&[OPTYPE_LABEL],
|
|
)
|
|
.unwrap();
|
|
/// Counter of bytes of the append_batch operation.
|
|
pub static ref METRIC_WAL_WRITE_BYTES_TOTAL: IntCounter = METRIC_WAL_OP_BYTES_TOTAL.with_label_values(
|
|
&["write"],
|
|
);
|
|
/// Counter of bytes of the read operation.
|
|
pub static ref METRIC_WAL_READ_BYTES_TOTAL: IntCounter = METRIC_WAL_OP_BYTES_TOTAL.with_label_values(
|
|
&["read"],
|
|
);
|
|
}
|