Changeset 102888 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 16, 2024 10:58:24 AM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 161110
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp
r102860 r102888 1185 1185 UIVMActivityMonitor::UIVMActivityMonitor(EmbedTo enmEmbedding, QWidget *pParent, int iMaximumQueueSize) 1186 1186 : QIWithRetranslateUI<QWidget>(pParent) 1187 , m_pContainerLayout(0) 1187 1188 , m_pTimer(0) 1188 1189 , m_iTimeStep(0) 1189 1190 , m_strCPUMetricName("CPU Load") 1190 1191 , m_strRAMMetricName("RAM Usage") 1191 , m_strNetworkMetricName("Network")1192 1192 , m_strDiskIOMetricName("DiskIO") 1193 , m_strVMExitMetricName("VMExits")1194 1193 , m_iMaximumQueueSize(iMaximumQueueSize) 1195 1194 , m_pMainLayout(0) … … 1220 1219 m_strRAMInfoLabelUsed = QApplication::translate("UIVMInformationDialog", "Used"); 1221 1220 m_iMaximumLabelLength = qMax(m_iMaximumLabelLength, m_strRAMInfoLabelUsed.length()); 1222 m_strNetworkInfoLabelTitle = QApplication::translate("UIVMInformationDialog", "Network Rate");1223 m_iMaximumLabelLength = qMax(m_iMaximumLabelLength, m_strNetworkInfoLabelTitle.length());1224 1221 m_strNetworkInfoLabelReceived = QApplication::translate("UIVMInformationDialog", "Receive Rate"); 1225 1222 m_iMaximumLabelLength = qMax(m_iMaximumLabelLength, m_strNetworkInfoLabelReceived.length()); … … 1242 1239 } 1243 1240 1244 // bool UIVMActivityMonitor::eventFilter(QObject *pObj, QEvent *pEvent)1245 // {1246 // if (pEvent-> type() == QEvent::Enter ||1247 // pEvent-> type() == QEvent::Leave)1248 // {1249 // UIChart *pChart = qobject_cast<UIChart*>(pObj);1250 // if (pChart)1251 // pChart->setMouseOver(pEvent-> type() == QEvent::Enter);1252 // }1253 // return false;1254 // }1255 1256 1241 void UIVMActivityMonitor::prepareWidgets() 1257 1242 { … … 1275 1260 1276 1261 QWidget *pContainerWidget = new QWidget(pScrollArea); 1277 QGridLayout *pContainerLayout = new QGridLayout(pContainerWidget);1278 pContainerWidget->setLayout( pContainerLayout);1279 pContainerLayout->setSpacing(10);1262 m_pContainerLayout = new QGridLayout(pContainerWidget); 1263 pContainerWidget->setLayout(m_pContainerLayout); 1264 m_pContainerLayout->setSpacing(10); 1280 1265 pContainerWidget->show(); 1281 1266 pScrollArea->setWidget(pContainerWidget); 1282 1267 pScrollArea->setWidgetResizable(true); 1283 1284 QStringList chartOrder;1285 chartOrder << m_strCPUMetricName << m_strRAMMetricName <<1286 m_strNetworkMetricName << m_strDiskIOMetricName << m_strVMExitMetricName;1287 int iRow = 0;1288 foreach (const QString &strMetricName, chartOrder)1289 {1290 if (!m_metrics.contains(strMetricName))1291 continue;1292 1293 QHBoxLayout *pChartLayout = new QHBoxLayout;1294 pChartLayout->setSpacing(0);1295 1296 QLabel *pLabel = new QLabel(this);1297 1298 QPalette tempPal = pLabel->palette();1299 tempPal.setColor(QPalette::Window, tempPal.color(QPalette::Window).lighter(g_iBackgroundTint));1300 pLabel->setPalette(tempPal);1301 pLabel->setAutoFillBackground(true);1302 1303 pLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);1304 pChartLayout->addWidget(pLabel);1305 m_infoLabels.insert(strMetricName, pLabel);1306 1307 UIChart *pChart = new UIChart(this, &(m_metrics[strMetricName]), m_iMaximumQueueSize);1308 connect(pChart, &UIChart::sigExportMetricsToFile,1309 this, &UIVMActivityMonitor::sltExportMetricsToFile);1310 connect(pChart, &UIChart::sigDataIndexUnderCursor,1311 this, &UIVMActivityMonitor::sltChatDataIndexUnderCursorChanged);1312 m_charts.insert(strMetricName, pChart);1313 pChart->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);1314 pChartLayout->addWidget(pChart);1315 pContainerLayout->addLayout(pChartLayout, iRow, 0, 1, 2);1316 ++iRow;1317 }1318 1319 QWidget *bottomSpacerWidget = new QWidget(this);1320 bottomSpacerWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);1321 bottomSpacerWidget->setVisible(true);1322 pContainerLayout->addWidget(bottomSpacerWidget, iRow, 0, 1, 2);1323 1268 } 1324 1269 … … 1358 1303 } 1359 1304 1360 void UIVMActivityMonitor::sltCha tDataIndexUnderCursorChanged(int iIndex)1305 void UIVMActivityMonitor::sltChartDataIndexUnderCursorChanged(int iIndex) 1361 1306 { 1362 1307 Q_UNUSED(iIndex); … … 1427 1372 UIVMActivityMonitorLocal::UIVMActivityMonitorLocal(EmbedTo enmEmbedding, QWidget *pParent, const CMachine &machine) 1428 1373 :UIVMActivityMonitor(enmEmbedding, pParent, 120 /* iMaximumQueueSize */) 1374 , m_strVMExitMetricName("VMExits") 1375 , m_strNetworkMetricName("Network") 1429 1376 , m_fGuestAdditionsAvailable(false) 1430 1377 { … … 1481 1428 m_strVMExitLabelTotal = QApplication::translate("UIVMInformationDialog", "Total"); 1482 1429 m_iMaximumLabelLength = qMax(m_iMaximumLabelLength, m_strVMExitLabelTotal.length()); 1483 1430 m_strNetworkInfoLabelTitle = QApplication::translate("UIVMInformationDialog", "Network Rate"); 1431 m_iMaximumLabelLength = qMax(m_iMaximumLabelLength, m_strNetworkInfoLabelTitle.length()); 1484 1432 setInfoLabelWidth(); 1485 1433 } … … 1646 1594 } 1647 1595 1596 void UIVMActivityMonitorLocal::prepareWidgets() 1597 { 1598 UIVMActivityMonitor::prepareWidgets(); 1599 1600 QStringList chartOrder; 1601 chartOrder << m_strCPUMetricName << m_strRAMMetricName << 1602 m_strNetworkMetricName << m_strDiskIOMetricName << m_strVMExitMetricName; 1603 int iRow = 0; 1604 foreach (const QString &strMetricName, chartOrder) 1605 { 1606 if (!m_metrics.contains(strMetricName)) 1607 continue; 1608 1609 QHBoxLayout *pChartLayout = new QHBoxLayout; 1610 pChartLayout->setSpacing(0); 1611 1612 QLabel *pLabel = new QLabel(this); 1613 1614 QPalette tempPal = pLabel->palette(); 1615 tempPal.setColor(QPalette::Window, tempPal.color(QPalette::Window).lighter(g_iBackgroundTint)); 1616 pLabel->setPalette(tempPal); 1617 pLabel->setAutoFillBackground(true); 1618 1619 pLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); 1620 pChartLayout->addWidget(pLabel); 1621 m_infoLabels.insert(strMetricName, pLabel); 1622 1623 UIChart *pChart = new UIChart(this, &(m_metrics[strMetricName]), m_iMaximumQueueSize); 1624 connect(pChart, &UIChart::sigExportMetricsToFile, 1625 this, &UIVMActivityMonitor::sltExportMetricsToFile); 1626 connect(pChart, &UIChart::sigDataIndexUnderCursor, 1627 this, &UIVMActivityMonitor::sltChartDataIndexUnderCursorChanged); 1628 m_charts.insert(strMetricName, pChart); 1629 pChart->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); 1630 pChartLayout->addWidget(pChart); 1631 m_pContainerLayout->addLayout(pChartLayout, iRow, 0, 1, 2); 1632 ++iRow; 1633 } 1634 1635 QWidget *bottomSpacerWidget = new QWidget(this); 1636 bottomSpacerWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); 1637 bottomSpacerWidget->setVisible(true); 1638 m_pContainerLayout->addWidget(bottomSpacerWidget, iRow, 0, 1, 2); 1639 } 1640 1648 1641 void UIVMActivityMonitorLocal::prepareMetrics() 1649 1642 { … … 1940 1933 UIVMActivityMonitorCloud::UIVMActivityMonitorCloud(EmbedTo enmEmbedding, QWidget *pParent, const CCloudMachine &machine) 1941 1934 :UIVMActivityMonitor(enmEmbedding, pParent, 60 /* iMaximumQueueSize */) 1935 , m_strNetworkInMetricName("Network Receive") 1936 , m_strNetworkOutMetricName("Network Transmit") 1942 1937 , m_pMachineStateUpdateTimer(0) 1943 1938 , m_enmMachineState(KCloudMachineState_Invalid) … … 1947 1942 m_metricTypeNames[KMetricType_DiskBytesRead] = m_strDiskIOMetricName; 1948 1943 m_metricTypeNames[KMetricType_DiskBytesWritten] = m_strDiskIOMetricName; 1949 m_metricTypeNames[KMetricType_NetworksBytesIn] = m_strNetwork MetricName;1950 m_metricTypeNames[KMetricType_NetworksBytesOut] = m_strNetwork MetricName;1944 m_metricTypeNames[KMetricType_NetworksBytesIn] = m_strNetworkInMetricName; 1945 m_metricTypeNames[KMetricType_NetworksBytesOut] = m_strNetworkOutMetricName; 1951 1946 1952 1947 setMachine(machine); … … 1962 1957 prepareActions(); 1963 1958 resetCPUInfoLabel(); 1964 resetNetworkInfoLabel(); 1959 resetNetworkInInfoLabel(); 1960 resetNetworkOutInfoLabel(); 1965 1961 resetDiskIOInfoLabel(); 1966 1962 resetRAMInfoLabel(); … … 2112 2108 { 2113 2109 m_networkReceiveCache.clear(); 2114 m_metrics[m_strNetwork MetricName].reset();2110 m_metrics[m_strNetworkInMetricName].reset(); 2115 2111 } 2116 2112 else if (enmMetricType == KMetricType_NetworksBytesOut) 2117 2113 { 2118 2114 m_networkTransmitCache.clear(); 2119 m_metrics[m_strNetwork MetricName].reset();2115 m_metrics[m_strNetworkOutMetricName].reset(); 2120 2116 } 2121 2117 else if (enmMetricType == KMetricType_DiskBytesRead) … … 2143 2139 } 2144 2140 else if (enmMetricType == KMetricType_NetworksBytesOut) 2145 cacheNetworkTransmit(newTimeStamps[i], newData[i]);2141 updateNetworkOutChart(newData[i], newTimeStamps[i]); 2146 2142 else if (enmMetricType == KMetricType_NetworksBytesIn) 2147 cacheNetworkReceive(newTimeStamps[i], newData[i]);2148 else if (enmMetricType == KMetricType_DiskBytesRead)2149 cacheDiskRead(newTimeStamps[i], newData[i]); 2150 else if (enmMetricType == KMetricType_DiskBytesWritten)2151 cacheDiskWrite(newTimeStamps[i], newData[i]);2143 updateNetworkInChart(newData[i], newTimeStamps[i]); 2144 // else if (enmMetricType == KMetricType_DiskBytesRead) 2145 2146 // else if (enmMetricType == KMetricType_DiskBytesWritten) 2147 // cacheDiskWrite(newTimeStamps[i], newData[i]); 2152 2148 else if (enmMetricType == KMetricType_MemoryUtilization) 2153 2149 { … … 2187 2183 foreach (UIChart *pChart, m_charts) 2188 2184 pChart->setXAxisLabel(QApplication::translate("UIVMInformationDialog", "Min.")); 2185 2186 m_strNetworkInInfoLabelTitle = QApplication::translate("UIVMInformationDialog", "Network Receive Rate"); 2187 m_iMaximumLabelLength = qMax(m_iMaximumLabelLength, m_strNetworkInInfoLabelTitle.length()); 2188 2189 m_strNetworkOutInfoLabelTitle = QApplication::translate("UIVMInformationDialog", "Network Transmit Rate"); 2190 m_iMaximumLabelLength = qMax(m_iMaximumLabelLength, m_strNetworkOutInfoLabelTitle.length()); 2191 2189 2192 setInfoLabelWidth(); 2190 2193 } … … 2240 2243 resetCPUInfoLabel(); 2241 2244 resetRAMInfoLabel(); 2242 resetNetworkInfoLabel(); 2245 resetNetworkInInfoLabel(); 2246 resetNetworkOutInfoLabel(); 2243 2247 resetDiskIOInfoLabel(); 2244 2248 … … 2281 2285 } 2282 2286 2283 void UIVMActivityMonitorCloud::updateNetwork Chart(quint64 uReceiveRate, quint64 uTransmitRate, const QString &strLabel)2284 { 2285 UIMetric &networkMetric = m_metrics[m_strNetwork MetricName];2287 void UIVMActivityMonitorCloud::updateNetworkInChart(quint64 uReceiveRate, const QString &strLabel) 2288 { 2289 UIMetric &networkMetric = m_metrics[m_strNetworkInMetricName]; 2286 2290 networkMetric.addData(0, uReceiveRate, strLabel); 2287 networkMetric.addData(1, uTransmitRate); 2288 2289 if (m_infoLabels.contains(m_strNetwork MetricName) && m_infoLabels[m_strNetworkMetricName])2291 2292 2293 if (m_infoLabels.contains(m_strNetworkInMetricName) && m_infoLabels[m_strNetworkInMetricName]) 2290 2294 { 2291 2295 QString strInfo; 2292 strInfo = QString("<b>%1</b></b><br/><font color=\"%2\">%3: %4</font><br/><font color=\"%5\">%6: %7<br/></font>") 2293 .arg(m_strNetworkInfoLabelTitle) 2294 .arg(dataColorString(m_strNetworkMetricName, 0)).arg(m_strNetworkInfoLabelReceived).arg(UITranslator::formatSize(uReceiveRate, g_iDecimalCount)) 2295 .arg(dataColorString(m_strNetworkMetricName, 1)).arg(m_strNetworkInfoLabelTransmitted).arg(UITranslator::formatSize(uTransmitRate, g_iDecimalCount)); 2296 2297 m_infoLabels[m_strNetworkMetricName]->setText(strInfo); 2298 } 2299 if (m_charts.contains(m_strNetworkMetricName)) 2300 m_charts[m_strNetworkMetricName]->update(); 2296 strInfo = QString("<b>%1</b></b><br/><font color=\"%2\">%3: %4</font><br/>") 2297 .arg(m_strNetworkInInfoLabelTitle) 2298 .arg(dataColorString(m_strNetworkInMetricName, 0)).arg(m_strNetworkInfoLabelReceived).arg(UITranslator::formatSize(uReceiveRate, g_iDecimalCount)); 2299 2300 m_infoLabels[m_strNetworkInMetricName]->setText(strInfo); 2301 } 2302 if (m_charts.contains(m_strNetworkInMetricName)) 2303 m_charts[m_strNetworkInMetricName]->update(); 2304 } 2305 2306 void UIVMActivityMonitorCloud::updateNetworkOutChart(quint64 uTransmitRate, const QString &strLabel) 2307 { 2308 UIMetric &networkMetric = m_metrics[m_strNetworkOutMetricName]; 2309 networkMetric.addData(0, uTransmitRate, strLabel); 2310 2311 if (m_infoLabels.contains(m_strNetworkOutMetricName) && m_infoLabels[m_strNetworkOutMetricName]) 2312 { 2313 QString strInfo; 2314 strInfo = QString("<b>%1</b></b><br/><font color=\"%5\">%6: %7<br/></font>") 2315 .arg(m_strNetworkOutInfoLabelTitle) 2316 .arg(dataColorString(m_strNetworkOutMetricName, 1)).arg(m_strNetworkInfoLabelTransmitted).arg(UITranslator::formatSize(uTransmitRate, g_iDecimalCount)); 2317 2318 m_infoLabels[m_strNetworkOutMetricName]->setText(strInfo); 2319 } 2320 if (m_charts.contains(m_strNetworkOutMetricName)) 2321 m_charts[m_strNetworkOutMetricName]->update(); 2301 2322 } 2302 2323 … … 2376 2397 m_metrics.insert(m_strCPUMetricName, cpuMetric); 2377 2398 2378 /* Network metric: */ 2379 UIMetric networkMetric(m_strNetworkMetricName, "B", m_iMaximumQueueSize); 2380 networkMetric.setDataSeriesName(0, "Receive Rate"); 2381 networkMetric.setDataSeriesName(1, "Transmit Rate"); 2382 networkMetric.setAutoUpdateMaximum(true); 2383 m_metrics.insert(m_strNetworkMetricName, networkMetric); 2399 /* Network in metric: */ 2400 UIMetric networkInMetric(m_strNetworkInMetricName, "B", m_iMaximumQueueSize); 2401 networkInMetric.setDataSeriesName(0, "Receive Rate"); 2402 networkInMetric.setAutoUpdateMaximum(true); 2403 m_metrics.insert(m_strNetworkInMetricName, networkInMetric); 2404 2405 /* Network out metric: */ 2406 UIMetric networkOutMetric(m_strNetworkInMetricName, "B", m_iMaximumQueueSize); 2407 networkOutMetric.setDataSeriesName(0, "Transmit Rate"); 2408 networkOutMetric.setAutoUpdateMaximum(true); 2409 m_metrics.insert(m_strNetworkOutMetricName, networkOutMetric); 2384 2410 2385 2411 /* Disk IO metric */ … … 2391 2417 2392 2418 } 2419 2393 2420 void UIVMActivityMonitorCloud::prepareWidgets() 2394 2421 { 2395 2422 UIVMActivityMonitor::prepareWidgets(); 2423 2424 QStringList chartOrder; 2425 chartOrder << m_strCPUMetricName << m_strRAMMetricName << 2426 m_strNetworkInMetricName << m_strNetworkOutMetricName << m_strDiskIOMetricName; 2427 int iRow = 0; 2428 foreach (const QString &strMetricName, chartOrder) 2429 { 2430 if (!m_metrics.contains(strMetricName)) 2431 continue; 2432 2433 QHBoxLayout *pChartLayout = new QHBoxLayout; 2434 pChartLayout->setSpacing(0); 2435 2436 QLabel *pLabel = new QLabel(this); 2437 2438 QPalette tempPal = pLabel->palette(); 2439 tempPal.setColor(QPalette::Window, tempPal.color(QPalette::Window).lighter(g_iBackgroundTint)); 2440 pLabel->setPalette(tempPal); 2441 pLabel->setAutoFillBackground(true); 2442 2443 pLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); 2444 pChartLayout->addWidget(pLabel); 2445 m_infoLabels.insert(strMetricName, pLabel); 2446 2447 UIChart *pChart = new UIChart(this, &(m_metrics[strMetricName]), m_iMaximumQueueSize); 2448 connect(pChart, &UIChart::sigExportMetricsToFile, 2449 this, &UIVMActivityMonitor::sltExportMetricsToFile); 2450 connect(pChart, &UIChart::sigDataIndexUnderCursor, 2451 this, &UIVMActivityMonitor::sltChartDataIndexUnderCursorChanged); 2452 m_charts.insert(strMetricName, pChart); 2453 pChart->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); 2454 pChartLayout->addWidget(pChart); 2455 m_pContainerLayout->addLayout(pChartLayout, iRow, 0, 1, 2); 2456 ++iRow; 2457 } 2458 2459 QWidget *bottomSpacerWidget = new QWidget(this); 2460 bottomSpacerWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); 2461 bottomSpacerWidget->setVisible(true); 2462 m_pContainerLayout->addWidget(bottomSpacerWidget, iRow, 0, 1, 2); 2396 2463 m_charts[m_strCPUMetricName]->setShowPieChart(false); 2397 2464 } … … 2411 2478 } 2412 2479 2413 void UIVMActivityMonitorCloud::resetNetworkInfoLabel() 2414 { 2415 if (m_infoLabels.contains(m_strNetworkMetricName) && m_infoLabels[m_strNetworkMetricName]) 2416 { 2417 QString strInfo = QString("<b>%1</b></b><br/>%2: %3<br/>%4 %5") 2418 .arg(m_strNetworkInfoLabelTitle) 2419 .arg(m_strNetworkInfoLabelReceived).arg("--") 2480 void UIVMActivityMonitorCloud::resetNetworkInInfoLabel() 2481 { 2482 if (m_infoLabels.contains(m_strNetworkInMetricName) && m_infoLabels[m_strNetworkInMetricName]) 2483 { 2484 QString strInfo = QString("<b>%1</b></b><br/>%2: %3") 2485 .arg(m_strNetworkInInfoLabelTitle) 2486 .arg(m_strNetworkInfoLabelReceived).arg("--"); 2487 2488 m_infoLabels[m_strNetworkInMetricName]->setText(strInfo); 2489 } 2490 } 2491 2492 void UIVMActivityMonitorCloud::resetNetworkOutInfoLabel() 2493 { 2494 if (m_infoLabels.contains(m_strNetworkOutMetricName) && m_infoLabels[m_strNetworkOutMetricName]) 2495 { 2496 QString strInfo = QString("<b>%1</b></b><br/>%2: %3") 2497 .arg(m_strNetworkOutInfoLabelTitle) 2420 2498 .arg(m_strNetworkInfoLabelTransmitted).arg("--"); 2421 2499 2422 m_infoLabels[m_strNetwork MetricName]->setText(strInfo);2500 m_infoLabels[m_strNetworkOutMetricName]->setText(strInfo); 2423 2501 } 2424 2502 } … … 2464 2542 } 2465 2543 2466 void UIVMActivityMonitorCloud::cacheNetworkReceive(const QString &strTimeStamp, quint64 iValue) 2467 { 2468 AssertReturnVoid(!m_networkReceiveCache.contains(strTimeStamp)); 2469 2470 if (m_networkTransmitCache.contains(strTimeStamp)) 2471 { 2472 updateNetworkChart((quint64) iValue, (quint64) m_networkTransmitCache[strTimeStamp], strTimeStamp); 2473 m_networkTransmitCache.remove(strTimeStamp); 2474 } 2475 else 2476 m_networkReceiveCache[strTimeStamp] = iValue; 2477 } 2478 2479 2480 void UIVMActivityMonitorCloud::cacheNetworkTransmit(const QString &strTimeStamp, quint64 iValue) 2481 { 2482 AssertReturnVoid(!m_networkTransmitCache.contains(strTimeStamp)); 2483 2484 if (m_networkReceiveCache.contains(strTimeStamp)) 2485 { 2486 updateNetworkChart((quint64) m_networkReceiveCache[strTimeStamp], (quint64) iValue, strTimeStamp); 2487 m_networkReceiveCache.remove(strTimeStamp); 2488 } 2489 else 2490 m_networkTransmitCache[strTimeStamp] = iValue; 2544 void UIVMActivityMonitorCloud::cacheNetworkReceive(const QString &, quint64 ) 2545 { 2546 // AssertReturnVoid(!m_networkReceiveCache.contains(strTimeStamp)); 2547 2548 // if (m_networkTransmitCache.contains(strTimeStamp)) 2549 // { 2550 // updateNetworkChart((quint64) iValue, (quint64) m_networkTransmitCache[strTimeStamp], strTimeStamp); 2551 // m_networkTransmitCache.remove(strTimeStamp); 2552 // } 2553 // else 2554 // m_networkReceiveCache[strTimeStamp] = iValue; 2555 } 2556 2557 void UIVMActivityMonitorCloud::cacheNetworkTransmit(const QString &, quint64 ) 2558 { 2559 // AssertReturnVoid(!m_networkTransmitCache.contains(strTimeStamp)); 2560 2561 // if (m_networkReceiveCache.contains(strTimeStamp)) 2562 // { 2563 // updateNetworkChart((quint64) m_networkReceiveCache[strTimeStamp], (quint64) iValue, strTimeStamp); 2564 // m_networkReceiveCache.remove(strTimeStamp); 2565 // } 2566 // else 2567 // m_networkTransmitCache[strTimeStamp] = iValue; 2491 2568 } 2492 2569 -
trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.h
r102858 r102888 54 54 55 55 /* Forward declarations: */ 56 class QGridLayout; 56 57 class QTimer; 57 58 class QVBoxLayout; … … 156 157 157 158 void sltExportMetricsToFile(); 159 void sltChartDataIndexUnderCursorChanged(int iIndex); 158 160 159 161 protected: … … 172 174 * @{ */ 173 175 virtual void resetCPUInfoLabel() = 0; 174 virtual void resetNetworkInfoLabel() = 0;175 176 virtual void resetDiskIOInfoLabel() = 0; 176 177 void resetRAMInfoLabel(); … … 180 181 void prepareActions(); 181 182 void setInfoLabelWidth(); 183 QGridLayout *m_pContainerLayout; 182 184 QTimer *m_pTimer; 183 185 quint64 m_iTimeStep; … … 188 190 QString m_strCPUMetricName; 189 191 QString m_strRAMMetricName; 190 QString m_strNetworkMetricName;191 192 QString m_strDiskIOMetricName; 192 QString m_strVMExitMetricName;193 193 /** @} */ 194 194 … … 214 214 QString m_strRAMInfoLabelUsed; 215 215 /** Net traffic info label strings. */ 216 QString m_strNetworkInfoLabelTitle;217 216 QString m_strNetworkInfoLabelReceived; 218 217 QString m_strNetworkInfoLabelTransmitted; … … 234 233 void sltTimeout(); 235 234 void sltCreateContextMenu(const QPoint &point); 236 void sltChatDataIndexUnderCursorChanged(int iIndex);237 235 238 236 private: … … 295 293 void resetVMExitInfoLabel(); 296 294 virtual void resetCPUInfoLabel(); 297 v irtual void resetNetworkInfoLabel();295 void resetNetworkInfoLabel(); 298 296 virtual void resetDiskIOInfoLabel(); 297 virtual void prepareWidgets() RT_OVERRIDE; 298 299 QString m_strVMExitMetricName; 300 QString m_strNetworkMetricName; 301 299 302 bool m_fGuestAdditionsAvailable; 300 303 CMachine m_comMachine; … … 308 311 QString m_strVMExitLabelCurrent; 309 312 QString m_strVMExitLabelTotal; 313 QString m_strNetworkInfoLabelTitle; 310 314 }; 311 315 … … 338 342 virtual void reset() RT_OVERRIDE; 339 343 virtual void start() RT_OVERRIDE; 340 virtual void prepareWidgets() ;344 virtual void prepareWidgets() RT_OVERRIDE; 341 345 /** @name The following functions update corresponding metric charts and labels with new values 342 346 * @{ */ 343 347 void updateCPUChart(quint64 iLoadPercentage, const QString &strLabel); 344 void updateNetworkChart(quint64 uReceive, quint64 uTransmit, const QString &strLabel); 348 void updateNetworkInChart(quint64 uReceive, const QString &strLabel); 349 void updateNetworkOutChart(quint64 uTransmit, const QString &strLabel); 345 350 void updateDiskIOChart(quint64 uWriteRate, quint64 uReadRate, const QString &strLabel); 346 351 void updateRAMChart(quint64 iUsagePercentage, const QString &strLabel); 347 352 /** @} */ 348 353 virtual void resetCPUInfoLabel(); 349 virtual void resetNetworkInfoLabel(); 354 void resetNetworkInInfoLabel(); 355 void resetNetworkOutInfoLabel(); 350 356 virtual void resetDiskIOInfoLabel(); 351 357 … … 361 367 void prepareMetrics(); 362 368 void determineTotalRAMAmount(); 369 370 QString m_strNetworkInMetricName; 371 QString m_strNetworkOutMetricName; 363 372 364 373 CCloudMachine m_comMachine; … … 379 388 QTimer *m_pMachineStateUpdateTimer; 380 389 KCloudMachineState m_enmMachineState; 390 391 QString m_strNetworkInInfoLabelTitle; 392 QString m_strNetworkOutInfoLabelTitle; 381 393 }; 382 394 #endif /* !FEQT_INCLUDED_SRC_activity_vmactivity_UIVMActivityMonitor_h */
Note:
See TracChangeset
for help on using the changeset viewer.