Skip to content

Commit

Permalink
Merge pull request #2496 from RolandSherwin/metrics_rename
Browse files Browse the repository at this point in the history
fix(metrics): use the newer crate name for all the metrics
  • Loading branch information
jacderida authored Dec 5, 2024
2 parents ee2c636 + f170c91 commit c716e5d
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ metrics/prometheus/prometheus.yml
.DS_Store
*.dot

sn_node_manager/.vagrant
ant-node-manager/.vagrant

# Python
.venv/
Expand Down
2 changes: 1 addition & 1 deletion ant-networking/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use crate::target_arch::Instant;

const MAX_CONTINUOUS_HDD_WRITE_ERROR: usize = 5;

// Shall be synced with `sn_node::PERIODIC_REPLICATION_INTERVAL_MAX_S`
// Shall be synced with `ant_node::PERIODIC_REPLICATION_INTERVAL_MAX_S`
const REPLICATION_TIMEOUT: Duration = Duration::from_secs(45);

// Throttles replication to at most once every 30 seconds
Expand Down
2 changes: 1 addition & 1 deletion ant-networking/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ impl NetworkBuilder {
let metrics_recorder = NetworkMetricsRecorder::new(&mut metrics_registries);
let metadata_sub_reg = metrics_registries
.metadata
.sub_registry_with_prefix("ant-networking");
.sub_registry_with_prefix("ant_networking");

metadata_sub_reg.register(
"peer_id",
Expand Down
2 changes: 1 addition & 1 deletion ant-networking/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl NetworkMetricsRecorder {

let extended_metrics_sub_registry = registries
.extended_metrics
.sub_registry_with_prefix("ant-networking");
.sub_registry_with_prefix("ant_networking");
let shunned_count_across_time_frames = Family::default();
extended_metrics_sub_registry.register(
"shunned_count_across_time_frames",
Expand Down
2 changes: 1 addition & 1 deletion ant-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ default_dir = AntNode.get_default_root_dir(peer_id)

## Testing

To run tests, navigate to the `sn_node` directory and execute:
To run tests, navigate to the `ant-node` directory and execute:

```bash
cargo test
Expand Down
2 changes: 1 addition & 1 deletion ant-node/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl NodeEventsChannel {
self.0.subscribe()
}

// Broadcast a new event, meant to be a helper only used by the sn_node's internals.
// Broadcast a new event, meant to be a helper only used by the ant-node's internals.
pub(crate) fn broadcast(&self, event: NodeEvent) {
let event_string = format!("{event:?}");
if let Err(err) = self.0.send(event) {
Expand Down
6 changes: 3 additions & 3 deletions ant-node/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ enum RecordType {

impl NodeMetricsRecorder {
pub(crate) fn new(registries: &mut MetricsRegistries) -> Self {
let node_metadata_sub_registry = registries.metadata.sub_registry_with_prefix("sn_node");
let node_metadata_sub_registry = registries.metadata.sub_registry_with_prefix("ant_node");
node_metadata_sub_registry.register(
"safenode_version",
"antnode_version",
"The version of the safe node",
Info::new(vec![(
"safenode_version".to_string(),
"antnode_version".to_string(),
env!("CARGO_PKG_VERSION").to_string(),
)]),
);
Expand Down
4 changes: 2 additions & 2 deletions node-launchpad/src/node_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl NodeStats {
let mut stats = IndividualNodeStats::default();

for sample in all_metrics.samples.iter() {
if sample.metric == "sn_node_total_forwarded_rewards" {
if sample.metric == "ant_node_total_forwarded_rewards" {
// Nanos
match sample.value {
prometheus_parse::Value::Counter(val)
Expand All @@ -189,7 +189,7 @@ impl NodeStats {
}
_ => {}
}
} else if sample.metric == "sn_node_current_reward_wallet_balance" {
} else if sample.metric == "ant_node_current_reward_wallet_balance" {
// Attos
match sample.value {
prometheus_parse::Value::Counter(val)
Expand Down

0 comments on commit c716e5d

Please sign in to comment.