@@ -82,6 +82,7 @@ type CPUMetrics struct {
82
82
CoreMetrics map [string ]int
83
83
CPUW , GPUW , PackageW float64
84
84
CoreUsages []float64
85
+ Throttled bool
85
86
}
86
87
87
88
type NetDiskMetrics struct {
@@ -1231,7 +1232,15 @@ func updateCPUUI(cpuMetrics CPUMetrics) {
1231
1232
totalUsage ,
1232
1233
)
1233
1234
PowerChart .Title = fmt .Sprintf ("%.2f W CPU - %.2f W GPU" , cpuMetrics .CPUW , cpuMetrics .GPUW )
1234
- PowerChart .Text = fmt .Sprintf ("CPU Power: %.2f W\n GPU Power: %.2f W\n Total Power: %.2f W" , cpuMetrics .CPUW , cpuMetrics .GPUW , cpuMetrics .PackageW )
1235
+ PowerChart .Text = fmt .Sprintf ("CPU Power: %.2f W\n GPU Power: %.2f W\n Total Power: %.2f W\n Thermals: %s" ,
1236
+ cpuMetrics .CPUW ,
1237
+ cpuMetrics .GPUW ,
1238
+ cpuMetrics .PackageW ,
1239
+ map [bool ]string {
1240
+ true : "Throttled!" ,
1241
+ false : "Nominal" ,
1242
+ }[cpuMetrics .Throttled ],
1243
+ )
1235
1244
memoryMetrics := getMemoryMetrics ()
1236
1245
memoryGauge .Title = fmt .Sprintf ("Memory Usage: %.2f GB / %.2f GB (Swap: %.2f/%.2f GB)" , float64 (memoryMetrics .Used )/ 1024 / 1024 / 1024 , float64 (memoryMetrics .Total )/ 1024 / 1024 / 1024 , float64 (memoryMetrics .SwapUsed )/ 1024 / 1024 / 1024 , float64 (memoryMetrics .SwapTotal )/ 1024 / 1024 / 1024 )
1237
1246
memoryGauge .Percent = int ((float64 (memoryMetrics .Used ) / float64 (memoryMetrics .Total )) * 100 )
@@ -1297,6 +1306,14 @@ func parseCPUMetrics(data map[string]interface{}, cpuMetrics CPUMetrics) CPUMetr
1297
1306
stderrLogger .Fatalf ("Failed to get processor data\n " )
1298
1307
return cpuMetrics
1299
1308
}
1309
+
1310
+ thermal , ok := data ["thermal_pressure" ].(string )
1311
+ if ! ok {
1312
+ stderrLogger .Fatalf ("Failed to get thermal data\n " )
1313
+ }
1314
+
1315
+ cpuMetrics .Throttled = thermal != "Nominal"
1316
+
1300
1317
eCores := []int {}
1301
1318
pCores := []int {}
1302
1319
cpuMetrics .ECores = eCores
@@ -1311,6 +1328,7 @@ func parseCPUMetrics(data map[string]interface{}, cpuMetrics CPUMetrics) CPUMetr
1311
1328
if combinedPower , ok := processor ["combined_power" ].(float64 ); ok {
1312
1329
cpuMetrics .PackageW = float64 (combinedPower ) / 1000
1313
1330
}
1331
+
1314
1332
return cpuMetrics
1315
1333
}
1316
1334
0 commit comments