Changeset 103166 in vbox
- Timestamp:
- Feb 1, 2024 4:37:54 PM (12 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/activity
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/activity/overview/UIVMActivityOverviewWidget.cpp
r103163 r103166 1000 1000 1001 1001 int iDecimalCount = 2; 1002 1002 QLocale locale; 1003 1003 if (enmMetricType == KMetricType_CpuUtilization) 1004 { 1005 //QString QLocale::toString(double i, char f = 'g', int prec = 6) const 1006 1007 // m_columnData[VMActivityOverviewColumn_CPUGuestLoad] = 1008 // QString("%1%").arg(QString::number(data[0].toFloat(), 'f', iDecimalCount)); 1009 1004 1010 m_columnData[VMActivityOverviewColumn_CPUGuestLoad] = 1005 QString::number(data[0].toFloat(), 'f', iDecimalCount); 1011 QString("%1%").arg(locale.toString(data[0].toFloat(), 'f', iDecimalCount)); 1012 } 1006 1013 else if (enmMetricType == KMetricType_MemoryUtilization) 1007 m_columnData[VMActivityOverviewColumn_RAMUsedPercentage] = 1008 QString::number(data[0].toFloat(), 'f', iDecimalCount); 1014 { 1015 if (m_uTotalRAM != 0) 1016 { 1017 quint64 uUsedRAM = (quint64)data[0].toFloat() * (m_uTotalRAM / 100.f); 1018 m_columnData[VMActivityOverviewColumn_RAMUsedAndTotal] = 1019 QString("%1/%2").arg(UITranslator::formatSize(_1K * uUsedRAM, iDecimalCount)). 1020 arg(UITranslator::formatSize(_1K * m_uTotalRAM, iDecimalCount)); 1021 } 1022 m_columnData[VMActivityOverviewColumn_RAMUsedPercentage] = 1023 QString("%1%").arg(QString::number(data[0].toFloat(), 'f', iDecimalCount)); 1024 } 1009 1025 else if (enmMetricType == KMetricType_NetworksBytesOut) 1010 1026 m_columnData[VMActivityOverviewColumn_NetworkUpRate] = … … 1032 1048 m_enmMachineState = enmState; 1033 1049 if (isRunning()) 1050 { 1034 1051 getMetricList(); 1052 if (m_uTotalRAM == 0) 1053 m_uTotalRAM = UIMonitorCommon::determineTotalRAMAmount(m_comCloudMachine); 1054 } 1035 1055 else 1036 1056 { -
trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp
r103164 r103166 1810 1810 1811 1811 setMachine(machine); 1812 m_ iTotalRAM = UIMonitorCommon::determineTotalRAMAmount(m_comMachine);1812 m_uTotalRAM = UIMonitorCommon::determineTotalRAMAmount(m_comMachine); 1813 1813 1814 1814 m_pMachineStateUpdateTimer = new QTimer(this); … … 1961 1961 else if (enmMetricType == KMetricType_MemoryUtilization) 1962 1962 { 1963 if (m_ iTotalRAM != 0)1963 if (m_uTotalRAM != 0) 1964 1964 { 1965 1965 /* calculate used RAM amount in kb: */ 1966 1966 if (newData[i] != uInvalidValueSentinel) 1967 1967 { 1968 quint64 iUsedRAM = newData[i] * (m_ iTotalRAM / 100.f);1968 quint64 iUsedRAM = newData[i] * (m_uTotalRAM / 100.f); 1969 1969 updateRAMChart(iUsedRAM, newTimeStamps[i]); 1970 1970 } … … 2174 2174 { 2175 2175 UIMetric &RAMMetric = m_metrics[Metric_Type_RAM]; 2176 RAMMetric.setMaximum(m_ iTotalRAM);2176 RAMMetric.setMaximum(m_uTotalRAM); 2177 2177 RAMMetric.addData(0, iUsedRAM, strLabel); 2178 2178 … … 2182 2182 strInfo = QString("<b>%1</b><br/>%2: %3<br/><font color=\"%4\">%5: %6</font><br/><font color=\"%7\">%8: %9</font>") 2183 2183 .arg(m_strRAMInfoLabelTitle) 2184 .arg(m_strRAMInfoLabelTotal).arg(UITranslator::formatSize(_1K * m_ iTotalRAM, g_iDecimalCount))2185 .arg(dataColorString(Metric_Type_RAM, 1)).arg(m_strRAMInfoLabelFree).arg(UITranslator::formatSize(_1K * (m_ iTotalRAM - iUsedRAM), g_iDecimalCount))2184 .arg(m_strRAMInfoLabelTotal).arg(UITranslator::formatSize(_1K * m_uTotalRAM, g_iDecimalCount)) 2185 .arg(dataColorString(Metric_Type_RAM, 1)).arg(m_strRAMInfoLabelFree).arg(UITranslator::formatSize(_1K * (m_uTotalRAM - iUsedRAM), g_iDecimalCount)) 2186 2186 .arg(dataColorString(Metric_Type_RAM, 0)).arg(m_strRAMInfoLabelUsed).arg(UITranslator::formatSize(_1K * iUsedRAM, g_iDecimalCount)); 2187 2187 m_infoLabels[Metric_Type_RAM]->setText(strInfo); … … 2213 2213 { 2214 2214 /* RAM Metric: */ 2215 if (m_ iTotalRAM != 0)2215 if (m_uTotalRAM != 0) 2216 2216 { 2217 2217 UIMetric ramMetric("kb", m_iMaximumQueueSize); -
trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.h
r103164 r103166 362 362 363 363 /** Total amount of RAM in kb. */ 364 quint64 m_ iTotalRAM;364 quint64 m_uTotalRAM; 365 365 QTimer *m_pMachineStateUpdateTimer; 366 366 KCloudMachineState m_enmMachineState;
Note:
See TracChangeset
for help on using the changeset viewer.