Skip to content

Commit

Permalink
Merge "Add the column % of total energy for Wattson thread aggregator…
Browse files Browse the repository at this point in the history
… tab" into main
  • Loading branch information
thewiseguy325 authored and Gerrit Code Review committed Jan 17, 2025
2 parents cd35132 + 5df5131 commit 022c528
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 31 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
971554a902ab1448ad43674f8f6200d1153ef7bafa86958c7e51f0671a838b65
b9a96bb2efd20db364d16d7e7fe1e060248f5bf27557badcd123c3c330195d61
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
484bea63ad64ed3b40b149304b4d93666d717667af5a340e3ca274bf385f7928
c361962c73af20ac99c6a43bca634549592643b4f94e7dd08e6bef7676145ef9
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a6b0400d96d2994b882a8c93215bf9c60c112b05bd86f0d985dc30ba90a20183
660e12593ef337b926f564b9b581fe42f18f3317951aaeb64bcf1c863106fd6c
47 changes: 34 additions & 13 deletions ui/src/plugins/org.kernel.Wattson/process_aggregator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,33 @@ export class WattsonProcessSelectionAggregator
-- Grouped by UPID and made CPU agnostic
CREATE VIEW ${this.id} AS
SELECT
ROUND(SUM(total_pws) / ${duration}, 2) as active_mw,
ROUND(SUM(total_pws) / 1000000000, 2) as active_mws,
COALESCE(idle_cost_mws, 0) as idle_cost_mws,
ROUND(
COALESCE(idle_cost_mws, 0) + SUM(total_pws) / 1000000000,
2
) as total_mws,
pid,
process_name
FROM _unioned_per_cpu_total
LEFT JOIN _per_process_idle_attribution USING (upid)
GROUP BY upid;
WITH
base AS (
SELECT
ROUND(SUM(total_pws) / ${duration}, 2) as active_mw,
ROUND(SUM(total_pws) / 1000000000, 2) as active_mws,
COALESCE(idle_cost_mws, 0) as idle_cost_mws,
ROUND(
COALESCE(idle_cost_mws, 0) + SUM(total_pws) / 1000000000,
2
) as total_mws,
pid,
process_name
FROM _unioned_per_cpu_total
LEFT JOIN _per_process_idle_attribution USING (upid)
GROUP BY upid
),
secondary AS (
SELECT pid,
ROUND(100 * (total_mws) / (SUM(total_mws) OVER()), 2)
AS percent_of_total_energy
FROM base
GROUP BY pid
)
select *
from base INNER JOIN secondary
USING (pid);
`);

return true;
Expand Down Expand Up @@ -115,6 +129,13 @@ export class WattsonProcessSelectionAggregator
columnId: 'total_mws',
sum: true,
},
{
title: '% of total energy',
kind: 'PERCENT',
columnConstructor: Float64Array,
columnId: 'percent_of_total_energy',
sum: false,
},
];
}

Expand Down
52 changes: 37 additions & 15 deletions ui/src/plugins/org.kernel.Wattson/thread_aggregator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,36 @@ export class WattsonThreadSelectionAggregator
-- Grouped again by UTID, but this time to make it CPU agnostic
CREATE VIEW ${this.id} AS
SELECT
ROUND(SUM(total_pws) / ${duration}, 2) as active_mw,
ROUND(SUM(total_pws) / 1000000000, 2) as active_mws,
COALESCE(idle_cost_mws, 0) as idle_cost_mws,
ROUND(
COALESCE(idle_cost_mws, 0) + SUM(total_pws) / 1000000000,
2
) as total_mws,
thread_name,
utid,
tid,
pid
FROM _unioned_per_cpu_total
LEFT JOIN _per_thread_idle_cost USING (utid)
GROUP BY utid;
WITH
base AS (
SELECT
ROUND(SUM(total_pws) / ${duration}, 2) as active_mw,
ROUND(SUM(total_pws) / 1000000000, 2) as active_mws,
COALESCE(idle_cost_mws, 0) as idle_cost_mws,
ROUND(
COALESCE(idle_cost_mws, 0) + SUM(total_pws) / 1000000000,
2
) as total_mws,
thread_name,
utid,
tid,
pid
FROM _unioned_per_cpu_total
LEFT JOIN _per_thread_idle_cost USING (utid)
GROUP BY utid
),
secondary AS (
SELECT utid,
ROUND(100 * (total_mws) / (SUM(total_mws) OVER()), 2)
AS percent_of_total_energy
FROM base
GROUP BY utid
)
select *
from base INNER JOIN secondary
USING (utid);
`;

engine.query(query);
Expand Down Expand Up @@ -198,6 +213,13 @@ export class WattsonThreadSelectionAggregator
columnId: 'total_mws',
sum: true,
},
{
title: '% of total energy',
kind: 'PERCENT',
columnConstructor: Float64Array,
columnId: 'percent_of_total_energy',
sum: false,
},
];
}

Expand Down

0 comments on commit 022c528

Please sign in to comment.