Changeset 88067 in vbox
- Timestamp:
- Mar 10, 2021 11:20:46 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIPerformanceMonitor.cpp
r88064 r88067 689 689 } 690 690 691 void UIMetric::setDataSeriesName(int iDataSeriesIndex, const QString &strName) 692 { 693 if (iDataSeriesIndex >= DATA_SERIES_SIZE) 694 return; 695 m_strDataSeriesName[iDataSeriesIndex] = strName; 696 } 697 698 QString UIMetric::dataSeriesName(int iDataSeriesIndex) const 699 { 700 if (iDataSeriesIndex >= DATA_SERIES_SIZE) 701 return QString(); 702 return m_strDataSeriesName[iDataSeriesIndex]; 703 } 704 691 705 void UIMetric::setTotal(int iDataSeriesIndex, quint64 iTotal) 692 706 { … … 739 753 stream << "Unit: " << m_strUnit << "\n"; 740 754 stream << "Maximum: " << m_iMaximum << "\n"; 741 foreach (const quint64& data, m_data[0]) 742 stream << data << " "; 755 for (int i = 0; i < 2; ++i) 756 { 757 if (!m_data[i].isEmpty()) 758 { 759 stream << "Data Series: " << m_strDataSeriesName[i] << "\n"; 760 foreach (const quint64& data, m_data[i]) 761 stream << data << " "; 762 stream << "\n"; 763 } 764 } 743 765 stream << "\n"; 744 foreach (const quint64& data, m_data[1])745 stream << data << " ";746 stream << "\n\n";747 766 } 748 767 … … 1071 1090 if (strName.contains("RAM", Qt::CaseInsensitive) && strName.contains("Free", Qt::CaseInsensitive)) 1072 1091 { 1073 UIMetric newMetric(m_strRAMMetricName, metrics[i].GetUnit(), g_iMaximumQueueSize); 1074 newMetric.setRequiresGuestAdditions(true); 1075 m_metrics.insert(m_strRAMMetricName, newMetric); 1092 UIMetric ramMetric(m_strRAMMetricName, metrics[i].GetUnit(), g_iMaximumQueueSize); 1093 ramMetric.setDataSeriesName(0, "Free"); 1094 ramMetric.setDataSeriesName(1, "Used"); 1095 ramMetric.setRequiresGuestAdditions(true); 1096 m_metrics.insert(m_strRAMMetricName, ramMetric); 1076 1097 } 1077 1098 } … … 1079 1100 } 1080 1101 1081 m_metrics.insert(m_strCPUMetricName, UIMetric(m_strCPUMetricName, "%", g_iMaximumQueueSize)); 1082 { 1083 /* Network metric: */ 1084 UIMetric networkMetric(m_strNetworkMetricName, "B", g_iMaximumQueueSize); 1085 m_metrics.insert(m_strNetworkMetricName, networkMetric); 1086 } 1102 /* CPU Metric: */ 1103 UIMetric cpuMetric(m_strCPUMetricName, "%", g_iMaximumQueueSize); 1104 cpuMetric.setDataSeriesName(0, "Guest Load"); 1105 cpuMetric.setDataSeriesName(1, "VMM Load"); 1106 m_metrics.insert(m_strCPUMetricName, cpuMetric); 1107 1108 /* Network metric: */ 1109 UIMetric networkMetric(m_strNetworkMetricName, "B", g_iMaximumQueueSize); 1110 networkMetric.setDataSeriesName(0, "Receive Rate"); 1111 networkMetric.setDataSeriesName(1, "Transmit Rate"); 1112 m_metrics.insert(m_strNetworkMetricName, networkMetric); 1087 1113 1088 1114 /* Disk IO metric */ 1089 {1090 UIMetric diskIOMetric(m_strDiskIOMetricName, "B", g_iMaximumQueueSize);1091 m_metrics.insert(m_strDiskIOMetricName, diskIOMetric);1092 }1115 UIMetric diskIOMetric(m_strDiskIOMetricName, "B", g_iMaximumQueueSize); 1116 diskIOMetric.setDataSeriesName(0, "Write Rate"); 1117 diskIOMetric.setDataSeriesName(1, "Read Rate"); 1118 m_metrics.insert(m_strDiskIOMetricName, diskIOMetric); 1093 1119 1094 1120 /* VM exits metric */ 1095 { 1096 UIMetric VMExitsMetric(m_strVMExitMetricName, "times", g_iMaximumQueueSize); 1097 m_metrics.insert(m_strVMExitMetricName, VMExitsMetric); 1098 } 1121 UIMetric VMExitsMetric(m_strVMExitMetricName, "times", g_iMaximumQueueSize); 1122 m_metrics.insert(m_strVMExitMetricName, VMExitsMetric); 1099 1123 } 1100 1124 -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIPerformanceMonitor.h
r88064 r88067 72 72 const QQueue<quint64> *data(int iDataSeriesIndex) const; 73 73 74 void setDataSeriesName(int iDataSeriesIndex, const QString &strName); 75 QString dataSeriesName(int iDataSeriesIndex) const; 76 74 77 void setTotal(int iDataSeriesIndex, quint64 iTotal); 75 78 quint64 total(int iDataSeriesIndex) const; … … 82 85 83 86 void reset(); 84 85 87 void toFile(QTextStream &stream) const; 86 88 … … 89 91 QString m_strName; 90 92 QString m_strUnit; 93 QString m_strDataSeriesName[DATA_SERIES_SIZE]; 91 94 quint64 m_iMaximum; 92 95 QQueue<quint64> m_data[DATA_SERIES_SIZE]; … … 206 209 QMap<QString,QLabel*> m_infoLabels; 207 210 208 /** @name These metric names are used for map keys to identify metrics. 211 /** @name These metric names are used for map keys to identify metrics. They are not translated. 209 212 * @{ */ 210 213 QString m_strCPUMetricName;
Note:
See TracChangeset
for help on using the changeset viewer.