mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-05 12:33:15 +00:00
chore(sequencer): apply snake_case convention to labels
This commit is contained in:
parent
f2e92a9c1f
commit
97152b8df6
@ -6,18 +6,36 @@
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
use common::transaction::TxKind;
|
||||
use metrics::{Counter, Histogram, Unit, counter, gauge, histogram};
|
||||
use strum::IntoEnumIterator as _;
|
||||
|
||||
use crate::names;
|
||||
|
||||
#[derive(Clone, Copy, strum::IntoStaticStr, strum::EnumIter)]
|
||||
#[derive(Debug, Clone, Copy, strum::IntoStaticStr, strum::EnumIter)]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum TransactionOrigin {
|
||||
User,
|
||||
Sequencer,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, strum::IntoStaticStr, strum::EnumIter)]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum TxKind {
|
||||
Public,
|
||||
PrivacyPreserving,
|
||||
ProgramDeployment,
|
||||
}
|
||||
|
||||
impl From<common::transaction::TxKind> for TxKind {
|
||||
fn from(kind: common::transaction::TxKind) -> Self {
|
||||
match kind {
|
||||
common::transaction::TxKind::Public => Self::Public,
|
||||
common::transaction::TxKind::PrivacyPreserving => Self::PrivacyPreserving,
|
||||
common::transaction::TxKind::ProgramDeployment => Self::ProgramDeployment,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Initialize metrics.
|
||||
pub fn init() {
|
||||
blocks_total_counter().increment(0);
|
||||
|
||||
@ -898,7 +898,7 @@ impl<BP: BlockPublisherTrait> SequencerCore<BP> {
|
||||
);
|
||||
sequencer_core_metrics::record_mempool_transaction_application_time(
|
||||
origin.into(),
|
||||
tx.kind(),
|
||||
tx.kind().into(),
|
||||
before_tx_apply.elapsed(),
|
||||
);
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
//! This crate provides all metrics exposed by the sequencer core crate.
|
||||
//! This crate provides all metrics exposed by the sequencer service crate.
|
||||
|
||||
#[cfg(feature = "record")]
|
||||
pub use record::*;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user