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
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0

use diem_metrics::{register_histogram, register_int_counter, Histogram, IntCounter};
use once_cell::sync::Lazy;

pub static DIEM_EXECUTOR_EXECUTE_AND_COMMIT_CHUNK_SECONDS: Lazy<Histogram> = Lazy::new(|| {
    register_histogram!(
        // metric name
        "diem_executor_execute_and_commit_chunk_seconds",
        // metric description
        "The time spent in seconds of chunk execution and committing in Diem executor"
    )
    .unwrap()
});

pub static DIEM_EXECUTOR_VM_EXECUTE_BLOCK_SECONDS: Lazy<Histogram> = Lazy::new(|| {
    register_histogram!(
        // metric name
        "diem_executor_vm_execute_block_seconds",
        // metric description
        "The time spent in seconds of vm block execution in Diem executor"
    )
    .unwrap()
});

pub static DIEM_EXECUTOR_ERRORS: Lazy<IntCounter> = Lazy::new(|| {
    register_int_counter!("diem_executor_error_total", "Cumulative number of errors").unwrap()
});

pub static DIEM_EXECUTOR_EXECUTE_BLOCK_SECONDS: Lazy<Histogram> = Lazy::new(|| {
    register_histogram!(
        // metric name
        "diem_executor_execute_block_seconds",
        // metric description
        "The total time spent in seconds of block execution in Diem executor "
    )
    .unwrap()
});

pub static DIEM_EXECUTOR_COMMIT_BLOCKS_SECONDS: Lazy<Histogram> = Lazy::new(|| {
    register_histogram!(
        // metric name
        "diem_executor_commit_blocks_seconds",
        // metric description
        "The total time spent in seconds of commiting blocks in Diem executor "
    )
    .unwrap()
});

pub static DIEM_EXECUTOR_SAVE_TRANSACTIONS_SECONDS: Lazy<Histogram> = Lazy::new(|| {
    register_histogram!(
        // metric name
        "diem_executor_save_transactions_seconds",
        // metric description
        "The time spent in seconds of calling save_transactions to storage in Diem executor"
    )
    .unwrap()
});

pub static DIEM_EXECUTOR_TRANSACTIONS_SAVED: Lazy<Histogram> = Lazy::new(|| {
    register_histogram!(
        // metric name
        "diem_executor_transactions_saved",
        // metric description
        "The number of transactions saved to storage in Diem executor"
    )
    .unwrap()
});