-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for system metrics #33
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,60 @@ | ||
import { systemMetricsDictType } from 'types/utils/formatSystemMetricName'; | ||
|
||
export const systemMetricsDict: systemMetricsDictType = { | ||
__system__cpu: 'CPU (%)', | ||
__system__p_memory_percent: 'Process Memory (%)', | ||
__system__memory_percent: 'Memory (%)', | ||
__system__disk_percent: 'Disk (%)', | ||
__system__gpu: 'GPU (%)', | ||
__system__gpu_memory_percent: 'GPU Memory (%)', | ||
__system__gpu_power_watts: 'GPU Power (W)', | ||
__system__gpu_temp: 'GPU Temperature (°C)', | ||
'system/cpu_utilization_percentage': 'CPU (%)', | ||
'system/disk_available_megabytes': 'Disk Available (MB)', | ||
'system/disk_usage_megabytes': 'Disk (MB)', | ||
'system/disk_usage_percentage': 'Disk (%)', | ||
'system/gpu_0_memory_usage_megabytes': 'GPU 0 Memory (MB)', | ||
'system/gpu_0_memory_usage_percentage': 'GPU 0 Memory (%)', | ||
'system/gpu_0_utilization_percentage': 'GPU 0 (%)', | ||
'system/gpu_1_memory_usage_megabytes': 'GPU 1 Memory (MB)', | ||
'system/gpu_1_memory_usage_percentage': 'GPU 1 Memory (%)', | ||
'system/gpu_1_utilization_percentage': 'GPU 1 (%)', | ||
'system/gpu_2_memory_usage_megabytes': 'GPU 2 Memory (MB)', | ||
'system/gpu_2_memory_usage_percentage': 'GPU 2 Memory (%)', | ||
'system/gpu_2_utilization_percentage': 'GPU 2 (%)', | ||
'system/gpu_3_memory_usage_megabytes': 'GPU 3 Memory (MB)', | ||
'system/gpu_3_memory_usage_percentage': 'GPU 3 Memory (%)', | ||
'system/gpu_3_utilization_percentage': 'GPU 3 (%)', | ||
'system/gpu_4_memory_usage_megabytes': 'GPU 4 Memory (MB)', | ||
'system/gpu_4_memory_usage_percentage': 'GPU 4 Memory (%)', | ||
'system/gpu_4_utilization_percentage': 'GPU 4 (%)', | ||
'system/gpu_5_memory_usage_megabytes': 'GPU 5 Memory (MB)', | ||
'system/gpu_5_memory_usage_percentage': 'GPU 5 Memory (%)', | ||
'system/gpu_5_utilization_percentage': 'GPU 5 (%)', | ||
'system/gpu_6_memory_usage_megabytes': 'GPU 6 Memory (MB)', | ||
'system/gpu_6_memory_usage_percentage': 'GPU 6 Memory (%)', | ||
'system/gpu_6_utilization_percentage': 'GPU 6 (%)', | ||
'system/gpu_7_memory_usage_megabytes': 'GPU 7 Memory (MB)', | ||
'system/gpu_7_memory_usage_percentage': 'GPU 7 Memory (%)', | ||
'system/gpu_7_utilization_percentage': 'GPU 7 (%)', | ||
'system/gpu_8_memory_usage_megabytes': 'GPU 8 Memory (MB)', | ||
'system/gpu_8_memory_usage_percentage': 'GPU 8 Memory (%)', | ||
'system/gpu_8_utilization_percentage': 'GPU 8 (%)', | ||
'system/gpu_9_memory_usage_megabytes': 'GPU 9 Memory (MB)', | ||
'system/gpu_9_memory_usage_percentage': 'GPU 9 Memory (%)', | ||
'system/gpu_9_utilization_percentage': 'GPU 9 (%)', | ||
'system/gpu_10_memory_usage_megabytes': 'GPU 10 Memory (MB)', | ||
'system/gpu_10_memory_usage_percentage': 'GPU 10 Memory (%)', | ||
'system/gpu_10_utilization_percentage': 'GPU 10 (%)', | ||
'system/gpu_11_memory_usage_megabytes': 'GPU 11 Memory (MB)', | ||
'system/gpu_11_memory_usage_percentage': 'GPU 11 Memory (%)', | ||
'system/gpu_11_utilization_percentage': 'GPU 11 (%)', | ||
'system/gpu_12_memory_usage_megabytes': 'GPU 12 Memory (MB)', | ||
'system/gpu_12_memory_usage_percentage': 'GPU 12 Memory (%)', | ||
'system/gpu_12_utilization_percentage': 'GPU 12 (%)', | ||
'system/gpu_13_memory_usage_megabytes': 'GPU 13 Memory (MB)', | ||
'system/gpu_13_memory_usage_percentage': 'GPU 13 Memory (%)', | ||
'system/gpu_13_utilization_percentage': 'GPU 13 (%)', | ||
'system/gpu_14_memory_usage_megabytes': 'GPU 14 Memory (MB)', | ||
'system/gpu_14_memory_usage_percentage': 'GPU 14 Memory (%)', | ||
'system/gpu_14_utilization_percentage': 'GPU 14 (%)', | ||
'system/gpu_15_memory_usage_megabytes': 'GPU 15 Memory (MB)', | ||
'system/gpu_15_memory_usage_percentage': 'GPU 15 Memory (%)', | ||
'system/gpu_15_utilization_percentage': 'GPU 15 (%)', | ||
'system/network_receive_megabytes': 'Network Rx (MB)', | ||
'system/network_transmit_megabytes': 'Network Tx (MB)', | ||
'system/system_memory_usage_megabytes': 'Memory (MB)', | ||
'system/system_memory_usage_percentage': 'Memory (%)', | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,7 +146,7 @@ function processRunBatchData( | |
}), | ||
sortKey: `${run.name}${contextName}`, | ||
}; | ||
if (run.name.startsWith('__system__')) { | ||
if (run.name.startsWith('system/')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the third time I'm seeing this magic string in this PR - could we extract a constant somehow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is based on the existing UI code from Aim at this stage. Extracting a constant would make total sense, but I wanted to keep this as close as possible to the current upstream logic. |
||
runSystemBatch.push(metric); | ||
} else { | ||
runMetricsBatch.push(metric); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,58 @@ | ||
export type systemMetricsDictType = { | ||
__system__cpu: string; | ||
__system__p_memory_percent: string; | ||
__system__memory_percent: string; | ||
__system__disk_percent: string; | ||
__system__gpu: string; | ||
__system__gpu_memory_percent: string; | ||
__system__gpu_power_watts: string; | ||
__system__gpu_temp: string; | ||
}; | ||
'system/cpu_utilization_percentage': string; | ||
'system/disk_available_megabytes': string; | ||
'system/disk_usage_megabytes': string; | ||
'system/disk_usage_percentage': string; | ||
'system/gpu_0_memory_usage_megabytes': string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment re: tidying this w/an iterator... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same reply as above: if there is a way to do this cleanly in typescript, I'll take it! |
||
'system/gpu_0_memory_usage_percentage': string; | ||
'system/gpu_0_utilization_percentage': string; | ||
'system/gpu_1_memory_usage_megabytes': string; | ||
'system/gpu_1_memory_usage_percentage': string; | ||
'system/gpu_1_utilization_percentage': string; | ||
'system/gpu_10_memory_usage_megabytes': string; | ||
'system/gpu_10_memory_usage_percentage': string; | ||
'system/gpu_10_utilization_percentage': string; | ||
'system/gpu_11_memory_usage_megabytes': string; | ||
'system/gpu_11_memory_usage_percentage': string; | ||
'system/gpu_11_utilization_percentage': string; | ||
'system/gpu_12_memory_usage_megabytes': string; | ||
'system/gpu_12_memory_usage_percentage': string; | ||
'system/gpu_12_utilization_percentage': string; | ||
'system/gpu_13_memory_usage_megabytes': string; | ||
'system/gpu_13_memory_usage_percentage': string; | ||
'system/gpu_13_utilization_percentage': string; | ||
'system/gpu_14_memory_usage_megabytes': string; | ||
'system/gpu_14_memory_usage_percentage': string; | ||
'system/gpu_14_utilization_percentage': string; | ||
'system/gpu_15_memory_usage_megabytes': string; | ||
'system/gpu_15_memory_usage_percentage': string; | ||
'system/gpu_15_utilization_percentage': string; | ||
'system/gpu_2_memory_usage_megabytes': string; | ||
'system/gpu_2_memory_usage_percentage': string; | ||
'system/gpu_2_utilization_percentage': string; | ||
'system/gpu_3_memory_usage_megabytes': string; | ||
'system/gpu_3_memory_usage_percentage': string; | ||
'system/gpu_3_utilization_percentage': string; | ||
'system/gpu_4_memory_usage_megabytes': string; | ||
'system/gpu_4_memory_usage_percentage': string; | ||
'system/gpu_4_utilization_percentage': string; | ||
'system/gpu_5_memory_usage_megabytes': string; | ||
'system/gpu_5_memory_usage_percentage': string; | ||
'system/gpu_5_utilization_percentage': string; | ||
'system/gpu_6_memory_usage_megabytes': string; | ||
'system/gpu_6_memory_usage_percentage': string; | ||
'system/gpu_6_utilization_percentage': string; | ||
'system/gpu_7_memory_usage_megabytes': string; | ||
'system/gpu_7_memory_usage_percentage': string; | ||
'system/gpu_7_utilization_percentage': string; | ||
'system/gpu_8_memory_usage_megabytes': string; | ||
'system/gpu_8_memory_usage_percentage': string; | ||
'system/gpu_8_utilization_percentage': string; | ||
'system/gpu_9_memory_usage_megabytes': string; | ||
'system/gpu_9_memory_usage_percentage': string; | ||
'system/gpu_9_utilization_percentage': string; | ||
'system/network_receive_megabytes': string; | ||
'system/network_transmit_megabytes': string; | ||
'system/system_memory_usage_megabytes': string; | ||
'system/system_memory_usage_percentage': string; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this be built more cleanly with an iterator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not an expert in typescript, so I don't know 😞
I wanted to make sure we can ship this!