Skip to content

Commit

Permalink
fix(clusters): add network_out metrics for hardware (#1016)
Browse files Browse the repository at this point in the history
<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
MasterPtato committed Aug 6, 2024
1 parent 2292103 commit 30d15c3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ User=node_exporter
Group=node_exporter
Type=simple
# Reduce cardinality
ExecStart=/usr/bin/node_exporter --collector.disable-defaults --collector.cpu --collector.conntrack --collector.meminfo --collector.filesystem --collector.filesystem.mount-points-exclude=^/opt/nomad/
ExecStart=/usr/bin/node_exporter --collector.disable-defaults --collector.cpu --collector.netdev --collector.conntrack --collector.meminfo --collector.filesystem --collector.filesystem.mount-points-exclude=^/opt/nomad/
Restart=always
RestartSec=2
Expand Down
1 change: 1 addition & 0 deletions svc/pkg/linode/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub struct InstanceType {
pub disk: u64,
pub vcpus: u64,
pub transfer: u64,
pub network_out: u64,
}

#[derive(Debug, Clone, Serialize, Deserialize, Hash)]
Expand Down
2 changes: 1 addition & 1 deletion svc/pkg/linode/src/util/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ impl From<InstanceType> for crate::types::InstanceType {
disk: value.disk,
vcpus: value.vcpus,
transfer: value.transfer,
// network_out: value.network_out,
network_out: value.network_out,
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion svc/pkg/linode/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ const CPU_PER_CORE: u64 = 1999;
#[derive(Debug)]
pub struct JobNodeConfig {
pub cpu_cores: u64,
/// Mhz
pub cpu: u64,
/// MB
pub memory: u64,
/// MB
pub disk: u64,
/// Kbps
pub bandwidth: u64,
}

Expand All @@ -36,7 +40,7 @@ impl JobNodeConfig {
cpu: instance_type.vcpus * CPU_PER_CORE,
memory,
disk: instance_type.disk,
bandwidth: instance_type.transfer * 1000,
bandwidth: instance_type.network_out * 1000,
}
}

Expand Down
1 change: 1 addition & 0 deletions svc/pkg/tier/ops/list/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async fn handle(ctx: OperationContext<tier::list::Request>) -> GlobalResult<tier
memory: 2u64.pow(14),
disk: 2u64.pow(15) * 10,
transfer: 6_000,
network_out: 6_000,
});

Ok(tier::list::response::Region {
Expand Down

0 comments on commit 30d15c3

Please sign in to comment.