Skip to content

Commit

Permalink
refactor: remove store_cost from set of queried node metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
bochaco committed Dec 18, 2024
1 parent 0c1a437 commit d02f5af
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 15 deletions.
2 changes: 0 additions & 2 deletions src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ pub type Metrics = HashMap<String, Vec<NodeMetric>>;

// The number of Nanos in the node reward wallet.
pub const METRIC_KEY_BALANCE: &str = "ant_node_current_reward_wallet_balance";
// The store cost of the node.
pub const METRIC_KEY_STORE_COST: &str = "ant_networking_store_cost";
// Memory used by the process in MegaBytes.
pub const METRIC_KEY_MEM_USED_MB: &str = "ant_networking_process_memory_used_mb";
// The percentage of CPU used by the process. Value is from 0-100.
Expand Down
7 changes: 1 addition & 6 deletions src/metrics_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ use thiserror::Error;
const DEFAULT_NODES_METRICS_HOST: &str = "127.0.0.1";

// Predefined set of metrics to monitor and collect.
const NODE_METRICS_TO_COLLECT: [&str; 10] = [
const NODE_METRICS_TO_COLLECT: [&str; 9] = [
METRIC_KEY_BALANCE,
METRIC_KEY_STORE_COST,
METRIC_KEY_MEM_USED_MB,
METRIC_KEY_CPU_USEAGE,
METRIC_KEY_RECORDS,
Expand Down Expand Up @@ -142,10 +141,6 @@ impl NodesMetrics {
info.rewards = U256::from_str(&metric.value).ok();
}

if let Some(metric) = metrics.get(METRIC_KEY_STORE_COST) {
info.store_cost = metric.value.parse::<u64>().ok();
}

if let Some(metric) = metrics.get(METRIC_KEY_MEM_USED_MB) {
info.mem_used = metric.value.parse::<u64>().ok();
}
Expand Down
1 change: 0 additions & 1 deletion src/node_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ pub struct NodeInstanceInfo {
pub rewards: Option<U256>,
pub records: Option<usize>,
pub relevant_records: Option<usize>,
pub store_cost: Option<u64>,
pub mem_used: Option<u64>,
pub cpu_usage: Option<String>,
pub connected_peers: Option<usize>,
Expand Down
6 changes: 0 additions & 6 deletions src/nodes_list_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,6 @@ fn NodeInstanceView(
</div>
</div>
</p>
<p>
<span class="node-info-item">"Store cost: "</span>
{move || {
info.read().store_cost.map_or(" -".to_string(), |v| v.to_string())
}}
</p>
<p>
<div class="flex flex-row">
<div class="basis-1/2">
Expand Down

0 comments on commit d02f5af

Please sign in to comment.