Deishelon
Deishelon

Reputation: 337

Plot CPU usage over time

I have a csv file with cpu usage overtime (which tracks the top 10 PID over time) The csv structure is bellow (time - millis since epoch, pid, and cpu usage value)

+-------+------+------+
| Time  | PID  | CPU% |
+-------+------+------+
| time1 | pid1 |   10 |
| time1 | pid2 |   20 |
| time2 | pid1 |   50 |
| time2 | pid2 |   10 |
+-------+------+------+

My goal is to create a graph which will look something like this: expected graph

I've tried Google Spreadsheet & Excel to achieve something like this, but I can't figure out how to 'group' by a column (in my case PID) and how to use CPU values on the PID over time

I would really appreciate any help, thanks!

Upvotes: 0

Views: 465

Answers (1)

Iamblichus
Iamblichus

Reputation: 19309

  • Pivot your data the following way:

=QUERY(A1:C, "SELECT A, SUM(C) WHERE B IS NOT NULL GROUP BY A PIVOT B",1)

  • Select the data created in previous step and insert a Line chart.

Result would be something like this:

enter image description here

Upvotes: 1

Related Questions