executor/
metrics.rs

1// Copyright (c) The Diem Core Contributors
2// SPDX-License-Identifier: Apache-2.0
3
4// Copyright 2021 Conflux Foundation. All rights reserved.
5// Conflux is free software and distributed under GNU General Public License.
6// See http://www.gnu.org/licenses/
7
8use diem_metrics::{
9    register_histogram, register_int_counter, Histogram, IntCounter,
10};
11use once_cell::sync::Lazy;
12
13pub static DIEM_EXECUTOR_VM_EXECUTE_BLOCK_SECONDS: Lazy<Histogram> =
14    Lazy::new(|| {
15        register_histogram!(
16            // metric name
17            "diem_executor_vm_execute_block_seconds",
18            // metric description
19            "The time spent in seconds of vm block execution in Diem executor"
20        )
21        .unwrap()
22    });
23
24pub static DIEM_EXECUTOR_ERRORS: Lazy<IntCounter> = Lazy::new(|| {
25    register_int_counter!(
26        "diem_executor_error_total",
27        "Cumulative number of errors"
28    )
29    .unwrap()
30});
31
32pub static DIEM_EXECUTOR_EXECUTE_BLOCK_SECONDS: Lazy<Histogram> =
33    Lazy::new(|| {
34        register_histogram!(
35        // metric name
36        "diem_executor_execute_block_seconds",
37        // metric description
38        "The total time spent in seconds of block execution in Diem executor "
39    )
40        .unwrap()
41    });
42
43pub static DIEM_EXECUTOR_COMMIT_BLOCKS_SECONDS: Lazy<Histogram> =
44    Lazy::new(|| {
45        register_histogram!(
46        // metric name
47        "diem_executor_commit_blocks_seconds",
48        // metric description
49        "The total time spent in seconds of commiting blocks in Diem executor "
50    )
51        .unwrap()
52    });
53
54pub static DIEM_EXECUTOR_SAVE_TRANSACTIONS_SECONDS: Lazy<Histogram> = Lazy::new(
55    || {
56        register_histogram!(
57        // metric name
58        "diem_executor_save_transactions_seconds",
59        // metric description
60        "The time spent in seconds of calling save_transactions to storage in Diem executor"
61    )
62    .unwrap()
63    },
64);
65
66pub static DIEM_EXECUTOR_TRANSACTIONS_SAVED: Lazy<Histogram> =
67    Lazy::new(|| {
68        register_histogram!(
69            // metric name
70            "diem_executor_transactions_saved",
71            // metric description
72            "The number of transactions saved to storage in Diem executor"
73        )
74        .unwrap()
75    });