Skip to content

Commit

Permalink
chore: rename ratio to percent where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
graelo committed Aug 2, 2023
1 parent c080e2c commit 7ddccc4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl<'a> App<'a> {

for e_cluster in &metrics.e_clusters {
// Cluster activity ratio.
let sig_name = format!("{}_active_ratio", e_cluster.name);
let sig_name = format!("{}_active_percent", e_cluster.name);
self.history
.entry(sig_name)
.or_insert(signal::Signal::with_capacity(
Expand All @@ -121,7 +121,7 @@ impl<'a> App<'a> {

for cpu in &e_cluster.cpus {
// Per-core activity ratio.
let sig_name = format!("{}_active_ratio", cpu.id);
let sig_name = format!("{}_active_percent", cpu.id);
self.history
.entry(sig_name)
.or_insert(signal::Signal::with_capacity(
Expand All @@ -144,7 +144,7 @@ impl<'a> App<'a> {

for p_cluster in &metrics.p_clusters {
// Cluster activity ratio.
let sig_name = format!("{}_active_ratio", p_cluster.name);
let sig_name = format!("{}_active_percent", p_cluster.name);
self.history
.entry(sig_name)
.or_insert(signal::Signal::with_capacity(
Expand All @@ -155,7 +155,7 @@ impl<'a> App<'a> {

for cpu in &p_cluster.cpus {
// Per-core activity ratio.
let sig_name = format!("{}_active_ratio", cpu.id);
let sig_name = format!("{}_active_percent", cpu.id);
self.history
.entry(sig_name)
.or_insert(signal::Signal::with_capacity(
Expand All @@ -177,15 +177,15 @@ impl<'a> App<'a> {
}

self.history
.entry("gpu_active_ratio".to_string())
.entry("gpu_active_percent".to_string())
.or_insert(signal::Signal::with_capacity(
HISTORY_CAPACITY,
/* max */ 100.0,
))
.push(100.0 * metrics.gpu.active_ratio as f32);

self.history
.entry("ane_active_ratio".to_string())
.entry("ane_active_percent".to_string())
.or_insert(signal::Signal::with_capacity(
HISTORY_CAPACITY,
/* max */ 100.0,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/tab_cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn draw_cpu<B>(
let acti_histo_area = activity_chunks[0];
let acti_gauge_area = activity_chunks[1];

let sig_name = format!("{}_active_ratio", cpu.id);
let sig_name = format!("{}_active_percent", cpu.id);
let sig = history.get(&sig_name).unwrap();
let activity_history_sparkline = Sparkline::default()
.style(Style::default().fg(accent_color))
Expand Down
6 changes: 3 additions & 3 deletions src/ui/tab_overview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ fn draw_cluster_overall_metrics<B>(
let bottom_area = chunks[1];

// Cluster cores Usage Gauge.
let sig_name = format!("{}_active_ratio", cluster.name);
let sig_name = format!("{}_active_percent", cluster.name);
let sig = history.get(&sig_name).unwrap();
let title = format!(
"{}: {} @ {} (peak: {})",
Expand Down Expand Up @@ -386,7 +386,7 @@ fn draw_gpu_ane_usage_block<B>(

// left: GPU.
let gpu = &metrics.gpu;
let sig = history.get("gpu_active_ratio").unwrap();
let sig = history.get("gpu_active_percent").unwrap();
let sig_gpu_power = history.get("gpu_w").unwrap();
let title = format!(
"GPU: {} @ {} 󱐋 {} (peak: {} 󱐋 {})",
Expand Down Expand Up @@ -416,7 +416,7 @@ fn draw_gpu_ane_usage_block<B>(

// Right: ANE.
let ane_active_ratio = metrics.consumption.ane_w as f64 / soc_info.max_ane_w;
let sig = history.get("ane_active_ratio").unwrap();
let sig = history.get("ane_active_percent").unwrap();
let sig_ane_power = history.get("ane_w").unwrap();
let title = format!(
"ANE: {} 󱐋 {} (peak: {} 󱐋 {})",
Expand Down

0 comments on commit 7ddccc4

Please sign in to comment.