- Timestamp:
- Dec 18, 2019 5:33:56 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135507
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationPerformanceMonitor.cpp
r82131 r82620 773 773 } 774 774 775 const QStringList &UIMetric::deviceTypeList() const776 {777 return m_deviceTypeList;778 }779 780 void UIMetric::setDeviceTypeList(const QStringList &list)781 {782 m_deviceTypeList = list;783 composeQueryString();784 }785 786 const QStringList &UIMetric::metricDataSubString() const787 {788 return m_metricDataSubString;789 }790 791 void UIMetric::setQueryPrefix(const QString &strPrefix)792 {793 m_strQueryPrefix = strPrefix;794 composeQueryString();795 796 }797 798 void UIMetric::setMetricDataSubString(const QStringList &list)799 {800 m_metricDataSubString = list;801 composeQueryString();802 }803 804 const QString &UIMetric::queryString() const805 {806 return m_strQueryString;807 }808 809 775 bool UIMetric::isInitialized() const 810 776 { … … 826 792 } 827 793 m_iMaximum = 0; 828 }829 830 void UIMetric::composeQueryString()831 {832 /* Compose of if both m_metricDataSubString and m_deviceTypeList are not empty: */833 if (m_deviceTypeList.isEmpty() || m_metricDataSubString.isEmpty())834 return;835 m_strQueryString.clear();836 foreach (const QString &strDeviceName, m_deviceTypeList)837 {838 foreach (const QString &strSubString, m_metricDataSubString)839 {840 /** @todo r=bird: It is much more efficient to (1) start a query with '/' and841 * (2) not use multiple expressions. If you don't start with '/',842 * STAM must search all the statistics. If you have multiple843 * expressions it is not yet clever enough to optimize the search and844 * will search all the statistics. There are several thousand in a845 * debug builds, some 400-600 in a typical release build (config dep). */846 m_strQueryString += QString("*%1*%2*%3*|").arg(m_strQueryPrefix).arg(strDeviceName).arg(strSubString);847 }848 }849 794 } 850 795 … … 1159 1104 1160 1105 m_metrics.insert(m_strCPUMetricName, UIMetric(m_strCPUMetricName, "%", iMaximumQueueSize)); 1161 /** @todo r=bird: This way of constructing queries is inefficient, see1162 * comment in query composer. Also, both the network and disk bits1163 * have moved now. The update timer method has been updated and no1164 * longer makes use of this for the statistics querying. */1165 1106 { 1166 1107 /* Network metric: */ 1167 1108 UIMetric networkMetric(m_strNetworkMetricName, "B", iMaximumQueueSize); 1168 networkMetric.setQueryPrefix("Public");1169 QStringList networkDeviceList;1170 networkDeviceList << "E1k" << "VNet" << "PCNet";1171 networkMetric.setDeviceTypeList(networkDeviceList);1172 QStringList networkMetricDataSubStringList;1173 networkMetricDataSubStringList << "BytesReceived" << "BytesTransmitted";1174 networkMetric.setMetricDataSubString(networkMetricDataSubStringList);1175 1109 m_metrics.insert(m_strNetworkMetricName, networkMetric); 1176 1110 } … … 1179 1113 { 1180 1114 UIMetric diskIOMetric(m_strDiskIOMetricName, "B", iMaximumQueueSize); 1181 diskIOMetric.setQueryPrefix("Devices");1182 QStringList diskTypeList;1183 diskTypeList << "LSILOGICSCSI" << "BUSLOGIC"1184 << "AHCI" << "PIIX3IDE" << "I82078" << "LSILOGICSAS" << "MSD" << "NVME";1185 diskIOMetric.setDeviceTypeList(diskTypeList);1186 QStringList diskIODataSubStringList;1187 diskIODataSubStringList << "WrittenBytes" << "ReadBytes";1188 diskIOMetric.setMetricDataSubString(diskIODataSubStringList);1189 1115 m_metrics.insert(m_strDiskIOMetricName, diskIOMetric); 1190 1116 } … … 1193 1119 { 1194 1120 UIMetric VMExitsMetric(m_strVMExitMetricName, "times", iMaximumQueueSize); 1195 VMExitsMetric.setQueryPrefix("PROF");1196 QStringList typeList;1197 typeList << "CPU";1198 VMExitsMetric.setDeviceTypeList(typeList);1199 QStringList subStringList;1200 subStringList << "RecordedExits";1201 VMExitsMetric.setMetricDataSubString(subStringList);1202 1121 m_metrics.insert(m_strVMExitMetricName, VMExitsMetric); 1203 1122 } 1204 1205 for (QMap<QString, UIMetric>::const_iterator iterator = m_metrics.begin(); 1206 iterator != m_metrics.end(); ++iterator) 1207 { 1208 if (iterator.value().queryString().isEmpty()) 1209 continue; 1210 m_strQueryString += iterator.value().queryString(); 1211 } 1212 } 1213 1123 } 1214 1124 1215 1125 bool UIInformationPerformanceMonitor::guestAdditionsAvailable(int iMinimumMajorVersion) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationPerformanceMonitor.h
r82131 r82620 85 85 void setRequiresGuestAdditions(bool fRequiresGAs); 86 86 87 const QStringList &deviceTypeList() const;88 void setDeviceTypeList(const QStringList &list);89 90 void setQueryPrefix(const QString &strPrefix);91 92 const QStringList &metricDataSubString() const;93 void setMetricDataSubString(const QStringList &list);94 95 const QString &queryString() const;96 97 87 void setIsInitialized(bool fIsInitialized); 98 88 bool isInitialized() const; … … 101 91 102 92 private: 103 104 void composeQueryString();105 106 /** @name The following strings are string list are used while making IMachineDebugger::getStats calls and parsing the resultin107 * xml stream.108 * @{ */109 /** This string is used while calling IMachineDebugger::getStats(..). It is composed of110 * m_strQueryPrefix, m_deviceTypeList, and m_metricDataSubString. */111 QString m_strQueryString;112 /** This list is used to differentiate xml data we get from the IMachineDebugger. */113 QStringList m_deviceTypeList;114 /** This is used to select data series of the metric. For example, for network metric115 * it is ReceiveBytes/TransmitBytes */116 QStringList m_metricDataSubString;117 QString m_strQueryPrefix;118 /** @} */119 93 120 94 QString m_strName; … … 243 217 QString m_strVMExitLabelTotal; 244 218 /** @} */ 245 /** The following string is used while querrying CMachineDebugger. */246 QString m_strQueryString;247 219 quint64 m_iTimeStep; 248 220 }; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp
r79365 r82620 178 178 m_strDefaultExtension = defaultExtension(mediumFormat()); 179 179 if (m_pLocationEditor) 180 { 180 181 m_pLocationEditor->setText(absoluteFilePath(m_strDefaultName, m_strDefaultPath, m_strDefaultExtension)); 182 printf("%s\n", qPrintable(absoluteFilePath(m_strDefaultName, m_strDefaultPath, m_strDefaultExtension))); 183 } 181 184 } 182 185 … … 213 216 if (fileInfo.completeSuffix() != m_strDefaultExtension) 214 217 { 215 QString strNewFilePath = QString("%1/%2.%3").arg(fileInfo.absoluteDir().absolutePath()).arg(fileInfo. baseName()).arg(m_strDefaultExtension);218 QString strNewFilePath = QString("%1/%2.%3").arg(fileInfo.absoluteDir().absolutePath()).arg(fileInfo.fileName()).arg(m_strDefaultExtension); 216 219 m_pLocationEditor->setText(strNewFilePath); 220 printf("%s %s\n", qPrintable(fileInfo.absoluteDir().absolutePath()), qPrintable(fileInfo.baseName())); 217 221 } 218 222 }
Note:
See TracChangeset
for help on using the changeset viewer.