Changeset 80419 in vbox
- Timestamp:
- Aug 26, 2019 7:18:56 AM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp
r80416 r80419 20 20 #include <QHeaderView> 21 21 #include <QLabel> 22 #include <QMenu> 22 23 #include <QPainter> 23 24 #include <QGridLayout> … … 80 81 virtual QSize sizeHint() const; 81 82 virtual QSize minimumSizeHint() const /* override */; 82 83 83 84 84 private: … … 121 121 Q_OBJECT; 122 122 123 signals: 124 125 126 123 127 public: 124 128 125 UIChart(QWidget *pParent, const UISubMetric *pSubMetric);129 UIChart(QWidget *pParent, UIMetric *pMetric); 126 130 void setFontSize(int iFontSize); 127 131 int fontSize() const; … … 148 152 virtual void retranslateUi() /* override */; 149 153 154 private slots: 155 156 void sltCreateContextMenu(const QPoint &point); 157 void sltResetMetric(); 158 150 159 private: 151 160 … … 155 164 void insertInfoLine(InfoLine enmInfoLine, const QString& strLabel, const QString &strInfo); 156 165 157 const UISubMetric *m_pSubMetric;166 UIMetric *m_pMetric; 158 167 QSize m_size; 159 168 QFont m_font; … … 170 179 QString m_strXAxisLabel; 171 180 QString m_strGAWarning; 181 QString m_strResetActionLabel; 172 182 }; 173 183 … … 183 193 184 194 { 185 // QPalette pal = palette();186 // pal.setColor(QPalette::Background, Qt::yellow);187 // setAutoFillBackground(true);188 // setPalette(pal);189 190 195 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 191 196 … … 201 206 202 207 retranslateUi(); 203 204 //QString(":/state_running_16px.png"); 205 //setItem(0, 0, new QTableWidgetItem(, "")); 206 208 /* Add the title row: */ 207 209 QTableWidgetItem *pTitleItem = new QTableWidgetItem(UIIconPool::iconSet(":/state_running_16px.png"), m_strTableTitle); 208 210 QFont titleFont(font()); … … 212 214 setItem(0, 0, pTitleItem); 213 215 216 /* Make the API calls and populate the table: */ 214 217 runTimeAttributes(); 215 218 computeMinimumWidth(); … … 239 242 QSize UIRuntimeInfoWidget::minimumSizeHint() const 240 243 { 241 printf("mini %d\n", m_iMinimumWidth);242 244 return QSize(m_iMinimumWidth, m_iMinimumWidth); 243 245 } … … 403 405 *********************************************************************************************************************************/ 404 406 405 UIChart::UIChart(QWidget *pParent, const UISubMetric *pSubMetric)407 UIChart::UIChart(QWidget *pParent, UIMetric *pMetric) 406 408 :QIWithRetranslateUI<QWidget>(pParent) 407 , m_p SubMetric(pSubMetric)409 , m_pMetric(pMetric) 408 410 , m_size(QSize(50, 50)) 409 , m_fDrawPieChart(true) 410 , m_fUseGradientLineColor(true) 411 { 411 , m_fDrawPieChart(false) 412 , m_fUseGradientLineColor(false) 413 { 414 setContextMenuPolicy(Qt::CustomContextMenu); 415 connect(this, &UIChart::customContextMenuRequested, 416 this, &UIChart::sltCreateContextMenu); 417 418 412 419 m_dataSeriesColor[0] = QColor(Qt::red); 413 420 m_dataSeriesColor[1] = QColor(Qt::blue); … … 512 519 { 513 520 m_strGAWarning = QApplication::translate("UIVMInformationDialog", "No guest additions! This metric requires guest additions to work properly."); 521 m_strResetActionLabel = QApplication::translate("UIVMInformationDialog", "Reset"); 514 522 } 515 523 … … 518 526 int iFontSize = 24; 519 527 520 //const QString &strText = m_p SubMetric->name();528 //const QString &strText = m_pMetric->name(); 521 529 foreach (const QString &strText, m_textList) 522 530 { … … 591 599 } 592 600 593 if (!m_p SubMetric || iMaximumQueueSize <= 1)594 return; 595 596 qulonglong iMaximum = m_p SubMetric->maximum();601 if (!m_pMetric || iMaximumQueueSize <= 1) 602 return; 603 604 qulonglong iMaximum = m_pMetric->maximum(); 597 605 if (iMaximum == 0) 598 606 return; … … 610 618 } 611 619 612 const QQueue<qulonglong> *data = m_p SubMetric->data(k);620 const QQueue<qulonglong> *data = m_pMetric->data(k); 613 621 if (!m_fUseGradientLineColor) 614 622 painter.setPen(QPen(m_dataSeriesColor[k], 2.5)); … … 632 640 QString strValue; 633 641 qulonglong iValue = (iYSubAxisCount + 1 - i) * (iMaximum / (float) (iYSubAxisCount + 1)); 634 if (m_p SubMetric->unit().compare("%", Qt::CaseInsensitive) == 0)642 if (m_pMetric->unit().compare("%", Qt::CaseInsensitive) == 0) 635 643 strValue = QString::number(iValue); 636 else if (m_p SubMetric->unit().compare("kb", Qt::CaseInsensitive) == 0)644 else if (m_pMetric->unit().compare("kb", Qt::CaseInsensitive) == 0) 637 645 strValue = uiCommon().formatSize(_1K * (qulonglong)iValue, iDecimalCount); 638 else if (m_p SubMetric->unit().compare("b", Qt::CaseInsensitive) == 0 ||639 m_p SubMetric->unit().compare("b/s", Qt::CaseInsensitive) == 0)646 else if (m_pMetric->unit().compare("b", Qt::CaseInsensitive) == 0 || 647 m_pMetric->unit().compare("b/s", Qt::CaseInsensitive) == 0) 640 648 strValue = uiCommon().formatSize(iValue, iDecimalCount); 649 else if (m_pMetric->unit().compare("times", Qt::CaseInsensitive) == 0) 650 strValue = QString::number(iValue); 651 641 652 painter.drawText(width() - 0.9 * m_iMarginRight, iTextY, strValue); 642 653 } … … 672 683 { 673 684 /* Draw the pie chart for the 0th data series only: */ 674 const QQueue<qulonglong> *data = m_p SubMetric->data(i);685 const QQueue<qulonglong> *data = m_pMetric->data(i); 675 686 if (!data || data->isEmpty()) 676 687 continue; … … 709 720 } 710 721 722 void UIChart::sltCreateContextMenu(const QPoint &point) 723 { 724 QMenu menu; 725 QAction *pResetAction = menu.addAction(m_strResetActionLabel); 726 connect(pResetAction, &QAction::triggered, this, &UIChart::sltResetMetric); 727 menu.exec(mapToGlobal(point)); 728 } 729 730 void UIChart::sltResetMetric() 731 { 732 if (m_pMetric) 733 m_pMetric->reset(); 734 } 735 711 736 /********************************************************************************************************************************* 712 * UI SubMetric implementation. *737 * UIMetric implementation. * 713 738 *********************************************************************************************************************************/ 714 739 715 UI SubMetric::UISubMetric(const QString &strName, const QString &strUnit, int iMaximumQueueSize)740 UIMetric::UIMetric(const QString &strName, const QString &strUnit, int iMaximumQueueSize) 716 741 : m_strName(strName) 717 742 , m_strUnit(strUnit) … … 719 744 , m_iMaximumQueueSize(iMaximumQueueSize) 720 745 , m_fRequiresGuestAdditions(false) 746 , m_fIsInitialized(false) 721 747 { 722 748 m_iTotal[0] = 0; … … 724 750 } 725 751 726 UI SubMetric::UISubMetric()752 UIMetric::UIMetric() 727 753 : m_iMaximumQueueSize(0) 728 754 { 729 755 } 730 756 731 const QString &UI SubMetric::name() const757 const QString &UIMetric::name() const 732 758 { 733 759 return m_strName; 734 760 } 735 761 736 void UI SubMetric::setMaximum(qulonglong iMaximum)762 void UIMetric::setMaximum(qulonglong iMaximum) 737 763 { 738 764 m_iMaximum = iMaximum; 739 765 } 740 766 741 qulonglong UI SubMetric::maximum() const767 qulonglong UIMetric::maximum() const 742 768 { 743 769 return m_iMaximum; 744 770 } 745 771 746 void UI SubMetric::setUnit(QString strUnit)772 void UIMetric::setUnit(QString strUnit) 747 773 { 748 774 m_strUnit = strUnit; 749 775 750 776 } 751 const QString &UI SubMetric::unit() const777 const QString &UIMetric::unit() const 752 778 { 753 779 return m_strUnit; 754 780 } 755 781 756 void UI SubMetric::addData(int iDataSeriesIndex, qulonglong fData)782 void UIMetric::addData(int iDataSeriesIndex, qulonglong fData) 757 783 { 758 784 if (iDataSeriesIndex >= DATA_SERIES_SIZE) … … 763 789 } 764 790 765 const QQueue<qulonglong> *UI SubMetric::data(int iDataSeriesIndex) const791 const QQueue<qulonglong> *UIMetric::data(int iDataSeriesIndex) const 766 792 { 767 793 if (iDataSeriesIndex >= DATA_SERIES_SIZE) … … 770 796 } 771 797 772 void UI SubMetric::setTotal(int iDataSeriesIndex, qulonglong iTotal)798 void UIMetric::setTotal(int iDataSeriesIndex, qulonglong iTotal) 773 799 { 774 800 if (iDataSeriesIndex >= DATA_SERIES_SIZE) … … 777 803 } 778 804 779 qulonglong UI SubMetric::total(int iDataSeriesIndex) const805 qulonglong UIMetric::total(int iDataSeriesIndex) const 780 806 { 781 807 if (iDataSeriesIndex >= DATA_SERIES_SIZE) … … 784 810 } 785 811 786 bool UI SubMetric::requiresGuestAdditions() const812 bool UIMetric::requiresGuestAdditions() const 787 813 { 788 814 return m_fRequiresGuestAdditions; 789 815 } 790 816 791 void UI SubMetric::setRequiresGuestAdditions(bool fRequiresGAs)817 void UIMetric::setRequiresGuestAdditions(bool fRequiresGAs) 792 818 { 793 819 m_fRequiresGuestAdditions = fRequiresGAs; 794 820 } 795 821 796 const QStringList &UI SubMetric::deviceTypeList() const822 const QStringList &UIMetric::deviceTypeList() const 797 823 { 798 824 return m_deviceTypeList; 799 825 } 800 826 801 void UI SubMetric::setDeviceTypeList(const QStringList &list)827 void UIMetric::setDeviceTypeList(const QStringList &list) 802 828 { 803 829 m_deviceTypeList = list; … … 805 831 } 806 832 807 const QStringList &UI SubMetric::metricDataSubString() const833 const QStringList &UIMetric::metricDataSubString() const 808 834 { 809 835 return m_metricDataSubString; 810 836 } 811 837 812 void UISubMetric::setMetricDataSubString(const QStringList &list) 838 void UIMetric::setQueryPrefix(const QString &strPrefix) 839 { 840 m_strQueryPrefix = strPrefix; 841 composeQueryString(); 842 843 } 844 845 void UIMetric::setMetricDataSubString(const QStringList &list) 813 846 { 814 847 m_metricDataSubString = list; … … 816 849 } 817 850 818 const QString &UI SubMetric::queryString() const851 const QString &UIMetric::queryString() const 819 852 { 820 853 return m_strQueryString; 821 854 } 822 855 823 void UISubMetric::composeQueryString() 856 bool UIMetric::isInitialized() const 857 { 858 return m_fIsInitialized; 859 } 860 861 void UIMetric::setIsInitialized(bool fIsInitialized) 862 { 863 m_fIsInitialized = fIsInitialized; 864 } 865 866 void UIMetric::reset() 867 { 868 m_fIsInitialized = false; 869 for (int i = 0; i < DATA_SERIES_SIZE; ++i) 870 { 871 m_iTotal[i] = 0; 872 m_data[i].clear(); 873 } 874 m_iMaximum = 0; 875 } 876 877 void UIMetric::composeQueryString() 824 878 { 825 879 /* Compose of if both m_metricDataSubString and m_deviceTypeList are not empty: */ … … 831 885 foreach (const QString &strSubString, m_metricDataSubString) 832 886 { 833 m_strQueryString += QString("* Devices*%1*%2*|").arg(strDeviceName).arg(strSubString);887 m_strQueryString += QString("*%1*%2*%3*|").arg(m_strQueryPrefix).arg(strDeviceName).arg(strSubString); 834 888 } 835 889 } … … 854 908 , m_strNetworkMetricName("Network") 855 909 , m_strDiskIOMetricName("DiskIO") 910 , m_strVMExitMetricName("VMExits") 856 911 , m_iTimeStep(0) 857 912 { … … 950 1005 m_pRuntimeInfoWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); 951 1006 952 QStringList chartO der;953 chartO der << m_strCPUMetricName << m_strRAMMetricName <<954 m_strDiskMetricName << m_strNetworkMetricName << m_strDiskIOMetricName ;1007 QStringList chartOrder; 1008 chartOrder << m_strCPUMetricName << m_strRAMMetricName << 1009 m_strDiskMetricName << m_strNetworkMetricName << m_strDiskIOMetricName << m_strVMExitMetricName; 955 1010 int iRow = 0; 956 foreach (const QString &strMetricName, chartO der)1011 foreach (const QString &strMetricName, chartOrder) 957 1012 { 958 1013 if (!m_subMetrics.contains(strMetricName)) … … 971 1026 972 1027 /* Configure charts: */ 973 if (m_charts.contains(m_strNetworkMetricName) && m_charts[m_strNetworkMetricName])974 {975 m_charts[m_strNetworkMetricName]->setDrawPieChart(false);976 m_charts[m_strNetworkMetricName]->setUseGradientLineColor(false);977 }978 if (m_charts.contains(m_strDiskIOMetricName) && m_charts[m_strDiskIOMetricName])979 {980 m_charts[m_strDiskIOMetricName]->setDrawPieChart(false);981 m_charts[m_strDiskIOMetricName]->setUseGradientLineColor(false);982 }983 1028 if (m_charts.contains(m_strCPUMetricName) && m_charts[m_strCPUMetricName]) 984 m_charts[m_strCPUMetricName]->set UseGradientLineColor(false);1029 m_charts[m_strCPUMetricName]->setDrawPieChart(true); 985 1030 if (m_charts.contains(m_strRAMMetricName) && m_charts[m_strRAMMetricName]) 986 m_charts[m_strRAMMetricName]->set UseGradientLineColor(false);1031 m_charts[m_strRAMMetricName]->setDrawPieChart(false); 987 1032 988 1033 QWidget *bottomSpacerWidget = new QWidget(this); … … 1060 1105 qulonglong uDiskIOTotalRead = 0; 1061 1106 1107 qulonglong uTotalVMExits = 0; 1108 1062 1109 QVector<DebuggerMetricData> xmlData = getTotalCounterFromDegugger(m_strQueryString); 1063 for (QMap<QString, UI SubMetric>::iterator iterator = m_subMetrics.begin();1110 for (QMap<QString, UIMetric>::iterator iterator = m_subMetrics.begin(); 1064 1111 iterator != m_subMetrics.end(); ++iterator) 1065 1112 { 1066 UI SubMetric &metric = iterator.value();1113 UIMetric &metric = iterator.value(); 1067 1114 const QStringList &deviceTypeList = metric.deviceTypeList(); 1068 1115 foreach (const QString &strDeviceType, deviceTypeList) … … 1086 1133 uDiskIOTotalRead += data.m_counter; 1087 1134 } 1135 else if (metric.name() == m_strVMExitMetricName) 1136 { 1137 if (data.m_strName.contains("all", Qt::CaseInsensitive)) 1138 uTotalVMExits += data.m_counter; 1139 } 1088 1140 } 1089 1141 } … … 1092 1144 updateNetworkGraphsAndMetric(uNetworkTotalReceive, uNetworkTotalTransmit); 1093 1145 updateDiskIOGraphsAndMetric(uDiskIOTotalWritten, uDiskIOTotalRead); 1146 updateVMExitMetric(uTotalVMExits); 1094 1147 } 1095 1148 … … 1123 1176 if (strName.contains("RAM", Qt::CaseInsensitive) && strName.contains("Free", Qt::CaseInsensitive)) 1124 1177 { 1125 UI SubMetric newMetric(m_strRAMMetricName, metrics[i].GetUnit(), iMaximumQueueSize);1178 UIMetric newMetric(m_strRAMMetricName, metrics[i].GetUnit(), iMaximumQueueSize); 1126 1179 newMetric.setRequiresGuestAdditions(true); 1127 1180 m_subMetrics.insert(m_strRAMMetricName, newMetric); … … 1131 1184 } 1132 1185 1133 m_subMetrics.insert(m_strCPUMetricName, UI SubMetric(m_strCPUMetricName, "%", iMaximumQueueSize));1186 m_subMetrics.insert(m_strCPUMetricName, UIMetric(m_strCPUMetricName, "%", iMaximumQueueSize)); 1134 1187 { 1135 1188 1136 1189 /* Network metric: */ 1137 UISubMetric networkMetric(m_strNetworkMetricName, "B", iMaximumQueueSize); 1190 UIMetric networkMetric(m_strNetworkMetricName, "B", iMaximumQueueSize); 1191 networkMetric.setQueryPrefix("Devices"); 1138 1192 QStringList networkDeviceList; 1139 1193 networkDeviceList << "E1k" <<"VNet" << "PCNet"; … … 1147 1201 /* Disk IO metric */ 1148 1202 { 1149 UISubMetric diskIOMetric(m_strDiskIOMetricName, "B", iMaximumQueueSize); 1203 UIMetric diskIOMetric(m_strDiskIOMetricName, "B", iMaximumQueueSize); 1204 diskIOMetric.setQueryPrefix("Devices"); 1150 1205 QStringList diskTypeList; 1151 1206 diskTypeList << "LSILOGICSCSI" << "BUSLOGIC" … … 1157 1212 m_subMetrics.insert(m_strDiskIOMetricName, diskIOMetric); 1158 1213 } 1159 for (QMap<QString, UISubMetric>::const_iterator iterator = m_subMetrics.begin(); 1214 1215 /* VM exits metric */ 1216 { 1217 UIMetric VMExitsMetric(m_strVMExitMetricName, "times", iMaximumQueueSize); 1218 VMExitsMetric.setQueryPrefix("HM"); 1219 QStringList typeList; 1220 typeList << "CPU"; 1221 VMExitsMetric.setDeviceTypeList(typeList); 1222 QStringList subStringList; 1223 subStringList << "All"; 1224 VMExitsMetric.setMetricDataSubString(subStringList); 1225 m_subMetrics.insert(m_strVMExitMetricName, VMExitsMetric); 1226 } 1227 1228 for (QMap<QString, UIMetric>::const_iterator iterator = m_subMetrics.begin(); 1160 1229 iterator != m_subMetrics.end(); ++iterator) 1161 1230 { … … 1164 1233 m_strQueryString += iterator.value().queryString(); 1165 1234 } 1166 } 1235 1236 } 1237 1167 1238 1168 1239 bool UIInformationRuntime::guestAdditionsAvailable(int iMinimumMajorVersion) … … 1187 1258 void UIInformationRuntime::enableDisableGuestAdditionDependedWidgets(bool fEnable) 1188 1259 { 1189 for (QMap<QString, UI SubMetric>::const_iterator iterator = m_subMetrics.begin();1260 for (QMap<QString, UIMetric>::const_iterator iterator = m_subMetrics.begin(); 1190 1261 iterator != m_subMetrics.end(); ++iterator) 1191 1262 { … … 1207 1278 void UIInformationRuntime::updateCPUGraphsAndMetric(ULONG iExecutingPercentage, ULONG iOtherPercentage) 1208 1279 { 1209 UI SubMetric &CPUMetric = m_subMetrics[m_strCPUMetricName];1280 UIMetric &CPUMetric = m_subMetrics[m_strCPUMetricName]; 1210 1281 CPUMetric.addData(0, iExecutingPercentage); 1211 1282 CPUMetric.addData(1, iOtherPercentage); … … 1233 1304 void UIInformationRuntime::updateRAMGraphsAndMetric(quint64 iTotalRAM, quint64 iFreeRAM) 1234 1305 { 1235 UI SubMetric &RAMMetric = m_subMetrics[m_strRAMMetricName];1306 UIMetric &RAMMetric = m_subMetrics[m_strRAMMetricName]; 1236 1307 RAMMetric.setMaximum(iTotalRAM); 1237 1308 RAMMetric.addData(0, iTotalRAM - iFreeRAM); … … 1253 1324 void UIInformationRuntime::updateNetworkGraphsAndMetric(qulonglong iReceiveTotal, qulonglong iTransmitTotal) 1254 1325 { 1255 UI SubMetric &NetMetric = m_subMetrics[m_strNetworkMetricName];1326 UIMetric &NetMetric = m_subMetrics[m_strNetworkMetricName]; 1256 1327 1257 1328 qulonglong iReceiveRate = iReceiveTotal - NetMetric.total(0); … … 1261 1332 NetMetric.setTotal(1, iTransmitTotal); 1262 1333 1263 /* Do not set data and maximum if the timer has just started since we need to initialize totals "(t-1)" first: */ 1264 if (m_iTimeStep <= 1) 1265 return; 1334 /* Do not set data and maximum if the metric has not been initialized since we need to initialize totals "(t-1)" first: */ 1335 if (!NetMetric.isInitialized()) 1336 { 1337 NetMetric.setIsInitialized(true); 1338 return; 1339 } 1340 1266 1341 NetMetric.addData(0, iReceiveRate); 1267 1342 NetMetric.addData(1, iTransmitRate); … … 1293 1368 void UIInformationRuntime::updateDiskIOGraphsAndMetric(qulonglong uDiskIOTotalWritten, qulonglong uDiskIOTotalRead) 1294 1369 { 1295 UISubMetric &NetMetric = m_subMetrics[m_strDiskIOMetricName]; 1296 1297 qulonglong iWriteRate = uDiskIOTotalWritten - NetMetric.total(0); 1298 qulonglong iReadRate = uDiskIOTotalRead - NetMetric.total(1); 1299 1300 NetMetric.setTotal(0, uDiskIOTotalWritten); 1301 NetMetric.setTotal(1, uDiskIOTotalRead); 1302 1303 /* Do not set data and maximum if the timer has just started since we need to initialize totals "(t-1)" first: */ 1304 if (m_iTimeStep <= 1) 1305 return; 1306 NetMetric.addData(0, iWriteRate); 1307 NetMetric.addData(1, iReadRate); 1308 qulonglong iMaximum = qMax(NetMetric.maximum(), qMax(iWriteRate, iReadRate)); 1309 NetMetric.setMaximum(iMaximum); 1370 UIMetric &diskMetric = m_subMetrics[m_strDiskIOMetricName]; 1371 1372 qulonglong iWriteRate = uDiskIOTotalWritten - diskMetric.total(0); 1373 qulonglong iReadRate = uDiskIOTotalRead - diskMetric.total(1); 1374 1375 diskMetric.setTotal(0, uDiskIOTotalWritten); 1376 diskMetric.setTotal(1, uDiskIOTotalRead); 1377 1378 /* Do not set data and maximum if the metric has not been initialized since we need to initialize totals "(t-1)" first: */ 1379 if (!diskMetric.isInitialized()) 1380 { 1381 diskMetric.setIsInitialized(true); 1382 return; 1383 } 1384 diskMetric.addData(0, iWriteRate); 1385 diskMetric.addData(1, iReadRate); 1386 qulonglong iMaximum = qMax(diskMetric.maximum(), qMax(iWriteRate, iReadRate)); 1387 diskMetric.setMaximum(iMaximum); 1310 1388 1311 1389 if (m_infoLabels.contains(m_strDiskIOMetricName) && m_infoLabels[m_strDiskIOMetricName]) … … 1332 1410 } 1333 1411 1412 void UIInformationRuntime::updateVMExitMetric(qulonglong uTotalVMExits) 1413 { 1414 UIMetric &VMExitMetric = m_subMetrics[m_strVMExitMetricName]; 1415 1416 qulonglong iRate = uTotalVMExits - VMExitMetric.total(0); 1417 1418 VMExitMetric.setTotal(0, uTotalVMExits); 1419 1420 /* Do not set data and maximum if the metric has not been initialized since we need to initialize totals "(t-1)" first: */ 1421 if (!VMExitMetric.isInitialized()) 1422 { 1423 VMExitMetric.setIsInitialized(true); 1424 return; 1425 } 1426 1427 VMExitMetric.addData(0, iRate); 1428 qulonglong iMaximum = qMax(VMExitMetric.maximum(), iRate); 1429 VMExitMetric.setMaximum(iMaximum); 1430 } 1431 1334 1432 QString UIInformationRuntime::dataColorString(const QString &strChartName, int iDataIndex) 1335 1433 { … … 1350 1448 1351 1449 QString strStats = debugger.GetStats(strQuery, false); 1450 1352 1451 QXmlStreamReader xmlReader; 1353 1452 xmlReader.addData(strStats); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h
r80411 r80419 61 61 }; 62 62 63 class UI SubMetric63 class UIMetric 64 64 { 65 65 public: 66 66 67 UI SubMetric(const QString &strName, const QString &strUnit, int iMaximumQueueSize);68 UI SubMetric();67 UIMetric(const QString &strName, const QString &strUnit, int iMaximumQueueSize); 68 UIMetric(); 69 69 const QString &name() const; 70 70 … … 81 81 qulonglong total(int iDataSeriesIndex) const; 82 82 83 84 85 83 bool requiresGuestAdditions() const; 86 84 void setRequiresGuestAdditions(bool fRequiresGAs); … … 89 87 void setDeviceTypeList(const QStringList &list); 90 88 89 void setQueryPrefix(const QString &strPrefix); 90 91 91 const QStringList &metricDataSubString() const; 92 92 void setMetricDataSubString(const QStringList &list); 93 93 94 94 const QString &queryString() const; 95 96 void setIsInitialized(bool fIsInitialized); 97 bool isInitialized() const; 98 99 void reset(); 95 100 96 101 private: … … 103 108 * it is ReceiveBytes/TransmitBytes */ 104 109 QStringList m_metricDataSubString; 110 QString m_strQueryPrefix; 105 111 106 112 QString m_strName; 107 113 QString m_strUnit; 108 114 /** This string is used while calling IMachineDebugger::getStats(..). It is composed of 109 * m_ deviceTypeList andm_metricDataSubString. */115 * m_strQueryPrefix, m_deviceTypeList, and m_metricDataSubString. */ 110 116 QString m_strQueryString; 111 117 qulonglong m_iMaximum; … … 116 122 int m_iMaximumQueueSize; 117 123 bool m_fRequiresGuestAdditions; 118 124 /** Used for metrices whose data is computed as total deltas. That is we receieve only total value and 125 * compute time step data from total deltas. m_isInitialised is true if the total has been set first time. */ 126 bool m_fIsInitialized; 119 127 }; 120 128 121 129 /** UIInformationRuntime class displays some high level performance metric of the guest system. 122 130 * The values are read in certain periods and cached in the GUI side. Currently we draw some line charts 123 * and pie charts (where applicable) alongside with some text. */ 131 * and pie charts (where applicable) alongside with some text. Additionally it displays a table including some 132 * run time attributes. */ 124 133 class UIInformationRuntime : public QIWithRetranslateUI<QWidget> 125 134 { … … 153 162 void updateNetworkGraphsAndMetric(qulonglong iReceiveTotal, qulonglong iTransmitTotal); 154 163 void updateDiskIOGraphsAndMetric(qulonglong uDiskIOTotalWritten, qulonglong uDiskIOTotalRead); 164 void updateVMExitMetric(qulonglong uTotalVMExits); 155 165 156 166 QString dataColorString(const QString &strChartName, int iDataIndex); … … 174 184 QVector<CUnknown> m_objectList; 175 185 176 QMap<QString, UI SubMetric> m_subMetrics;186 QMap<QString, UIMetric> m_subMetrics; 177 187 QMap<QString,UIChart*> m_charts; 178 188 QMap<QString,QLabel*> m_infoLabels; … … 185 195 QString m_strNetworkMetricName; 186 196 QString m_strDiskIOMetricName; 197 QString m_strVMExitMetricName; 187 198 /** @} */ 188 199
Note:
See TracChangeset
for help on using the changeset viewer.