@@ -180,14 +180,10 @@ func setupGrid() {
180
180
grid = ui .NewGrid ()
181
181
grid .Set (
182
182
ui .NewRow (1.0 / 2 , // This row now takes half the height of the grid
183
- ui .NewCol (1.0 / 2 , ui .NewRow (1.0 / 2 , cpu1Gauge ), ui .NewCol (1.0 , ui .NewRow (1.0 , cpu2Gauge ))),
184
- ui .NewCol (1.0 / 2 , ui .NewRow (1.0 / 2 , gpuGauge ), ui .NewCol (1.0 , ui .NewRow (1.0 , processList ))), // ui.NewCol(1.0/2, ui.NewRow(1.0, ProcessInfo)), // ProcessInfo spans this entire column
183
+ ui .NewCol (1.0 / 2 , ui .NewRow (1.0 / 2 , cpu1Gauge ), ui .NewCol (1.0 , ui .NewRow (1.0 , cpu2Gauge ))), ui .NewCol (1.0 / 2 , ui .NewRow (1.0 / 2 , gpuGauge ), ui .NewCol (1.0 , ui .NewRow (1.0 , processList ))), // ui.NewCol(1.0/2, ui.NewRow(1.0, ProcessInfo)), // ProcessInfo spans this entire column
185
184
),
186
185
ui .NewRow (1.0 / 4 ,
187
- ui .NewCol (1.0 / 6 , modelText ),
188
- ui .NewCol (1.0 / 3 , NetworkInfo ),
189
- ui .NewCol (1.0 / 4 , PowerChart ),
190
- ui .NewCol (1.0 / 4 , TotalPowerChart ),
186
+ ui .NewCol (1.0 / 6 , modelText ), ui .NewCol (1.0 / 3 , NetworkInfo ), ui .NewCol (1.0 / 4 , PowerChart ), ui .NewCol (1.0 / 4 , TotalPowerChart ),
191
187
),
192
188
ui .NewRow (1.0 / 4 ,
193
189
ui .NewCol (1.0 , memoryGauge ),
@@ -200,8 +196,7 @@ func switchGridLayout() {
200
196
newGrid := ui .NewGrid ()
201
197
newGrid .Set (
202
198
ui .NewRow (1.0 / 4 ,
203
- ui .NewCol (1.0 / 2 , ui .NewRow (1.0 , cpu1Gauge )),
204
- ui .NewCol (1.0 / 2 , ui .NewRow (1.0 , cpu2Gauge )),
199
+ ui .NewCol (1.0 / 2 , ui .NewRow (1.0 , cpu1Gauge )), ui .NewCol (1.0 / 2 , ui .NewRow (1.0 , cpu2Gauge )),
205
200
),
206
201
ui .NewRow (2.0 / 4 ,
207
202
ui .NewCol (1.0 / 2 ,
@@ -214,9 +209,7 @@ func switchGridLayout() {
214
209
ui .NewCol (1.0 / 2 , processList ),
215
210
),
216
211
ui .NewRow (1.0 / 4 ,
217
- ui .NewCol (3.0 / 6 , memoryGauge ),
218
- ui .NewCol (1.0 / 6 , modelText ),
219
- ui .NewCol (2.0 / 6 , NetworkInfo ),
212
+ ui .NewCol (3.0 / 6 , memoryGauge ), ui .NewCol (1.0 / 6 , modelText ), ui .NewCol (2.0 / 6 , NetworkInfo ),
220
213
),
221
214
)
222
215
termWidth , termHeight := ui .TerminalDimensions ()
@@ -227,14 +220,10 @@ func switchGridLayout() {
227
220
newGrid := ui .NewGrid ()
228
221
newGrid .Set (
229
222
ui .NewRow (1.0 / 2 ,
230
- ui .NewCol (1.0 / 2 , ui .NewRow (1.0 / 2 , cpu1Gauge ), ui .NewCol (1.0 , ui .NewRow (1.0 , cpu2Gauge ))),
231
- ui .NewCol (1.0 / 2 , ui .NewRow (1.0 / 2 , gpuGauge ), ui .NewCol (1.0 , ui .NewRow (1.0 , processList ))),
223
+ ui .NewCol (1.0 / 2 , ui .NewRow (1.0 / 2 , cpu1Gauge ), ui .NewCol (1.0 , ui .NewRow (1.0 , cpu2Gauge ))), ui .NewCol (1.0 / 2 , ui .NewRow (1.0 / 2 , gpuGauge ), ui .NewCol (1.0 , ui .NewRow (1.0 , processList ))),
232
224
),
233
225
ui .NewRow (1.0 / 4 ,
234
- ui .NewCol (1.0 / 4 , modelText ),
235
- ui .NewCol (1.0 / 4 , NetworkInfo ),
236
- ui .NewCol (1.0 / 4 , PowerChart ),
237
- ui .NewCol (1.0 / 4 , TotalPowerChart ),
226
+ ui .NewCol (1.0 / 4 , modelText ), ui .NewCol (1.0 / 4 , NetworkInfo ), ui .NewCol (1.0 / 4 , PowerChart ), ui .NewCol (1.0 / 4 , TotalPowerChart ),
238
227
),
239
228
ui .NewRow (1.0 / 4 ,
240
229
ui .NewCol (1.0 , memoryGauge ),
@@ -877,6 +866,19 @@ func parseCPUMetrics(powermetricsOutput string, cpuMetrics CPUMetrics) CPUMetric
877
866
if combinedPower , ok := processor ["combined_power" ].(float64 ); ok {
878
867
cpuMetrics .PackageW = float64 (combinedPower ) / 1000
879
868
}
869
+ if _ , exists := cpuMetricDict ["P-Cluster_freq_Mhz" ]; ! exists {
870
+ var totalFreq float64
871
+ var clusterCount int
872
+ for i := 0 ; i <= 50 ; i ++ {
873
+ if freq , ok := cpuMetricDict [fmt .Sprintf ("P-Cluster%d_freq_Mhz" , i )].(int ); ok {
874
+ totalFreq += float64 (freq )
875
+ clusterCount ++
876
+ }
877
+ }
878
+ if clusterCount > 0 {
879
+ cpuMetrics .PClusterFreqMHz = int (totalFreq / float64 (clusterCount ))
880
+ }
881
+ }
880
882
return cpuMetrics
881
883
}
882
884
0 commit comments