1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0

use diem_metrics::{register_histogram_vec, register_int_counter_vec, HistogramVec, IntCounterVec};
use once_cell::sync::Lazy;

pub static DIEM_SCHEMADB_ITER_LATENCY_SECONDS: Lazy<HistogramVec> = Lazy::new(|| {
    register_histogram_vec!(
        // metric name
        "diem_schemadb_iter_latency_seconds",
        // metric description
        "Diem schemadb iter latency in seconds",
        // metric labels (dimensions)
        &["cf_name"]
    )
    .unwrap()
});

pub static DIEM_SCHEMADB_ITER_BYTES: Lazy<HistogramVec> = Lazy::new(|| {
    register_histogram_vec!(
        // metric name
        "diem_schemadb_iter_bytes",
        // metric description
        "Diem schemadb iter size in bytess",
        // metric labels (dimensions)
        &["cf_name"]
    )
    .unwrap()
});

pub static DIEM_SCHEMADB_GET_LATENCY_SECONDS: Lazy<HistogramVec> = Lazy::new(|| {
    register_histogram_vec!(
        // metric name
        "diem_schemadb_get_latency_seconds",
        // metric description
        "Diem schemadb get latency in seconds",
        // metric labels (dimensions)
        &["cf_name"]
    )
    .unwrap()
});

pub static DIEM_SCHEMADB_GET_BYTES: Lazy<HistogramVec> = Lazy::new(|| {
    register_histogram_vec!(
        // metric name
        "diem_schemadb_get_bytes",
        // metric description
        "Diem schemadb get call returned data size in bytes",
        // metric labels (dimensions)
        &["cf_name"]
    )
    .unwrap()
});

pub static DIEM_SCHEMADB_BATCH_COMMIT_LATENCY_SECONDS: Lazy<HistogramVec> = Lazy::new(|| {
    register_histogram_vec!(
        // metric name
        "diem_schemadb_batch_commit_latency_seconds",
        // metric description
        "Diem schemadb schema batch commit latency in seconds",
        // metric labels (dimensions)
        &["db_name"]
    )
    .unwrap()
});

pub static DIEM_SCHEMADB_BATCH_COMMIT_BYTES: Lazy<HistogramVec> = Lazy::new(|| {
    register_histogram_vec!(
        // metric name
        "diem_schemadb_batch_commit_bytes",
        // metric description
        "Diem schemadb schema batch commit size in bytes",
        // metric labels (dimensions)
        &["db_name"]
    )
    .unwrap()
});

pub static DIEM_SCHEMADB_PUT_BYTES: Lazy<HistogramVec> = Lazy::new(|| {
    register_histogram_vec!(
        // metric name
        "diem_schemadb_put_bytes",
        // metric description
        "Diem schemadb put call puts data size in bytes",
        // metric labels (dimensions)
        &["cf_name"]
    )
    .unwrap()
});

pub static DIEM_SCHEMADB_DELETES: Lazy<IntCounterVec> = Lazy::new(|| {
    register_int_counter_vec!(
        "diem_storage_deletes",
        "Diem storage delete calls",
        &["cf_name"]
    )
    .unwrap()
});