Changeset 81097 in vbox
- Timestamp:
- Oct 2, 2019 12:45:04 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 133708
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationPerformanceMonitor.cpp
r80999 r81097 18 18 /* Qt includes: */ 19 19 #include <QApplication> 20 #include <QHeaderView>21 20 #include <QLabel> 22 21 #include <QMenu> … … 26 25 #include <QStyle> 27 26 #include <QXmlStreamReader> 28 #include <QVBoxLayout>29 #include <QTableWidget>30 27 #include <QTimer> 31 28 32 29 /* GUI includes: */ 33 30 #include "UICommon.h" 34 #include "UIConverter.h"35 #include "UIExtraDataManager.h"36 #include "UIIconPool.h"37 31 #include "UIInformationPerformanceMonitor.h" 38 32 #include "UISession.h" … … 42 36 #include "CPerformanceCollector.h" 43 37 #include "CPerformanceMetric.h" 44 #include "CVRDEServerInfo.h"45 38 46 39 /* External includes: */ … … 1072 1065 quint64 uTotalVMExits = 0; 1073 1066 1074 QVector< DebuggerMetricData> xmlData = getTotalCounterFromDegugger(m_strQueryString);1067 QVector<UIDebuggerMetricData> xmlData = getTotalCounterFromDegugger(m_strQueryString); 1075 1068 for (QMap<QString, UIMetric>::iterator iterator = m_subMetrics.begin(); 1076 1069 iterator != m_subMetrics.end(); ++iterator) … … 1080 1073 foreach (const QString &strDeviceType, deviceTypeList) 1081 1074 { 1082 foreach (const DebuggerMetricData &data, xmlData)1075 foreach (const UIDebuggerMetricData &data, xmlData) 1083 1076 { 1084 1077 if (data.m_strName.contains(strDeviceType, Qt::CaseInsensitive)) … … 1412 1405 } 1413 1406 1414 QVector< DebuggerMetricData> UIInformationPerformanceMonitor::getTotalCounterFromDegugger(const QString &strQuery)1415 { 1416 QVector< DebuggerMetricData> xmlData;1407 QVector<UIDebuggerMetricData> UIInformationPerformanceMonitor::getTotalCounterFromDegugger(const QString &strQuery) 1408 { 1409 QVector<UIDebuggerMetricData> xmlData; 1417 1410 if (strQuery.isEmpty()) 1418 1411 return xmlData; … … 1432 1425 iTotal += iCounter; 1433 1426 xmlReader.skipCurrentElement(); 1434 xmlData.push_back( DebuggerMetricData(*(attributes.value("name").string()), iCounter));1427 xmlData.push_back(UIDebuggerMetricData(*(attributes.value("name").string()), iCounter)); 1435 1428 } 1436 1429 else if (xmlReader.name() == "U64") … … 1440 1433 iTotal += iCounter; 1441 1434 xmlReader.skipCurrentElement(); 1442 xmlData.push_back( DebuggerMetricData(*(attributes.value("name").string()), iCounter));1435 xmlData.push_back(UIDebuggerMetricData(*(attributes.value("name").string()), iCounter)); 1443 1436 } 1444 1437 else -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationPerformanceMonitor.h
r80999 r81097 27 27 #include <QQueue> 28 28 29 30 29 /* COM includes: */ 31 30 #include "COMEnums.h" … … 38 37 /* GUI includes: */ 39 38 #include "QIWithRetranslateUI.h" 40 #include "UIMainEventListener.h"41 42 39 43 40 /* Forward declarations: */ … … 51 48 #define DATA_SERIES_SIZE 2 52 49 53 struct DebuggerMetricData 50 /** UIDebuggerMetricData is used as data storage while parsing the xml stream received from IMachineDebugger. */ 51 struct UIDebuggerMetricData 54 52 { 55 DebuggerMetricData()53 UIDebuggerMetricData() 56 54 : m_counter(0){} 57 DebuggerMetricData(const QString & strName, quint64 counter)55 UIDebuggerMetricData(const QString & strName, quint64 counter) 58 56 :m_strName(strName) 59 57 , m_counter(counter){} … … 62 60 }; 63 61 62 /** UIMetric represents a performance metric and is used to store data related to the corresponding metric. */ 64 63 class UIMetric 65 64 { 65 66 66 public: 67 67 … … 134 134 /** UIInformationPerformanceMonitor class displays some high level performance metric of the guest system. 135 135 * The values are read in certain periods and cached in the GUI side. Currently we draw some line charts 136 * and pie charts (where applicable) alongside with some text. Additionally it displays a table including some 137 * run time attributes. */ 136 * and pie charts (where applicable) alongside with some text. IPerformanceCollector and IMachineDebugger are 137 * two sources of the performance metrics. Unfortunately these two have very distinct APIs resulting a bit too much 138 * special casing etc.*/ 138 139 class UIInformationPerformanceMonitor : public QIWithRetranslateUI<QWidget> 139 140 { … … 149 150 150 151 protected: 152 151 153 void retranslateUi(); 152 154 153 155 private slots: 156 154 157 /** Reads the metric values for several sources and calls corresponding update functions. */ 155 158 void sltTimeout(); … … 172 175 /** Returns a QColor for the chart with @p strChartName and data series with @p iDataIndex. */ 173 176 QString dataColorString(const QString &strChartName, int iDataIndex); 174 /** Parses the xml string we get from the IMachineDebugger and returns an array of DebuggerMetricData. */175 QVector< DebuggerMetricData> getTotalCounterFromDegugger(const QString &strQuery);177 /** Parses the xml string we get from the IMachineDebugger and returns an array of UIDebuggerMetricData. */ 178 QVector<UIDebuggerMetricData> getTotalCounterFromDegugger(const QString &strQuery); 176 179 177 180 bool m_fGuestAdditionsAvailable; … … 191 194 QMap<QString, UIMetric> m_subMetrics; 192 195 QMap<QString,UIChart*> m_charts; 193 QMap<QString,QLabel*> m_infoLabels; 194 ComObjPtr<UIMainEventListenerImpl> m_pQtGuestListener; 196 /** Stores the QLabel instances which we show next to each UIChart. The value is the name of the metric. */ 197 QMap<QString,QLabel*> m_infoLabels; 198 195 199 196 200 /** @name These metric names are used for map keys to identify metrics. -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp
r81094 r81097 26 26 #include "UICommon.h" 27 27 #include "UIConverter.h" 28 #include "UIExtraDataManager.h"29 28 #include "UIIconPool.h" 30 29 #include "UIInformationRuntime.h" … … 34 33 #include "CGuest.h" 35 34 #include "CVRDEServerInfo.h" 36 37 35 38 36 enum InfoRow … … 486 484 } 487 485 488 UIInformationRuntime::~UIInformationRuntime()489 {490 }491 492 486 void UIInformationRuntime::retranslateUi() 493 487 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h
r81000 r81097 33 33 /* GUI includes: */ 34 34 #include "QIWithRetranslateUI.h" 35 #include "UIMainEventListener.h"36 37 35 38 36 /* Forward declarations: */ 39 37 class QVBoxLayout; 40 class QLabel;41 class UIChart;42 38 class UISession; 43 39 class UIRuntimeInfoWidget; … … 55 51 * @param console is machine console reference. */ 56 52 UIInformationRuntime(QWidget *pParent, const CMachine &machine, const CConsole &console, const UISession *pSession); 57 ~UIInformationRuntime();58 53 59 54 protected: 55 60 56 void retranslateUi(); 61 57 62 58 private slots: 63 59 64 /** @name These functions are connected to API events and implement necessary updates .60 /** @name These functions are connected to API events and implement necessary updates on the table. 65 61 * @{ */ 66 62 void sltGuestAdditionsStateChange(); … … 82 78 QVBoxLayout *m_pMainLayout; 83 79 UIRuntimeInfoWidget *m_pRuntimeInfoWidget; 84 85 QMap<QString,QLabel*> m_infoLabels;86 ComObjPtr<UIMainEventListenerImpl> m_pQtGuestListener;87 80 }; 88 81
Note:
See TracChangeset
for help on using the changeset viewer.