Skip to content

Commit

Permalink
run metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Krueger authored and Christian Krueger committed Aug 2, 2024
1 parent 8a95460 commit b60d4f1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions keepers/validator-keeper/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ fn set_run_flags(args: &Args) -> u32 {
if args.run_steward {
run_flags = set_flag(run_flags, KeeperOperations::Steward);
}
if args.run_emit_metrics {
run_flags = set_flag(run_flags, KeeperOperations::EmitMetrics);
}

run_flags
}
Expand Down
8 changes: 4 additions & 4 deletions keepers/validator-keeper/src/operations/keeper_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub enum KeeperOperations {
MevEarned,
MevCommission,
Steward,
EmitHistory,
EmitMetrics,
}

pub fn set_flag(run_flags: u32, flag: KeeperOperations) -> u32 {
Expand Down Expand Up @@ -217,17 +217,17 @@ impl KeeperOperations {
// EMIT HISTORY
(
"num-emit-metrics-runs",
runs_for_epoch[KeeperOperations::EmitHistory as usize],
runs_for_epoch[KeeperOperations::EmitMetrics as usize],
i64
),
(
"num-emit-metrics-errors",
errors_for_epoch[KeeperOperations::EmitHistory as usize],
errors_for_epoch[KeeperOperations::EmitMetrics as usize],
i64
),
(
"num-emit-metrics-txs",
txs_for_epoch[KeeperOperations::EmitHistory as usize],
txs_for_epoch[KeeperOperations::EmitMetrics as usize],
i64
),
// STEWARD
Expand Down
2 changes: 1 addition & 1 deletion keepers/validator-keeper/src/operations/metrics_emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use validator_history::ValidatorHistoryEntry;
use super::keeper_operations::{check_flag, KeeperOperations};

fn _get_operation() -> KeeperOperations {
KeeperOperations::EmitHistory
KeeperOperations::EmitMetrics
}

fn _should_run() -> bool {
Expand Down
6 changes: 6 additions & 0 deletions keepers/validator-keeper/src/state/keeper_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ pub struct Args {
#[arg(long, env, default_value = "true")]
pub run_steward: bool,

/// Run emit metrics
#[arg(long, env, default_value = "true")]
pub run_emit_metrics: bool,

/// Run with the startup flag set to true
#[arg(long, env, default_value = "true")]
pub full_startup: bool,
Expand Down Expand Up @@ -171,6 +175,7 @@ impl fmt::Display for Args {
Run Stake Upload: {}\n\
Run Gossip Upload: {}\n\
Run Steward: {}\n\
Run Emit Metrics: {}\n\
Full Startup: {}\n\
No Pack: {}\n\
Pay for New Accounts: {}\n\
Expand All @@ -196,6 +201,7 @@ impl fmt::Display for Args {
self.run_stake_upload,
self.run_gossip_upload,
self.run_steward,
self.run_emit_metrics,
self.full_startup,
self.no_pack,
self.pay_for_new_accounts,
Expand Down

0 comments on commit b60d4f1

Please sign in to comment.