VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/activity/UIMonitorCommon.h@ 100347

Last change on this file since 100347 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: UIMonitorCommon.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMonitorCommon class declaration.
4 */
5
6/*
7 * Copyright (C) 2016-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_activity_UIMonitorCommon_h
29#define FEQT_INCLUDED_SRC_activity_UIMonitorCommon_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/** UIDebuggerMetricData is used as data storage while parsing the xml stream received from IMachineDebugger. */
35struct UIDebuggerMetricData
36{
37 UIDebuggerMetricData()
38 : m_counter(0){}
39 UIDebuggerMetricData(const QString &strName, quint64 counter)
40 : m_strName(strName)
41 , m_counter(counter){}
42 QString m_strName;
43 quint64 m_counter;
44};
45
46
47class SHARED_LIBRARY_STUFF UIMonitorCommon
48{
49
50public:
51
52 /** @name Static utility methods that query and parse IMachineDebugger outputs for specific metrix types.
53 * @{ */
54 static void getNetworkLoad(CMachineDebugger &debugger, quint64 &uOutNetworkReceived, quint64 &uOutNetworkTransmitted);
55 static void getDiskLoad(CMachineDebugger &debugger, quint64 &uOutDiskWritten, quint64 &uOutDiskRead);
56 static void getVMMExitCount(CMachineDebugger &debugger, quint64 &uOutVMMExitCount);
57 /** @} */
58 static void getRAMLoad(CPerformanceCollector &comPerformanceCollector, QVector<QString> &nameList,
59 QVector<CUnknown>& objectList, quint64 &iOutTotalRAM, quint64 &iOutFreeRAM);
60
61
62 static QPainterPath doughnutSlice(const QRectF &outerRectangle, const QRectF &innerRectangle, float fStartAngle, float fSweepAngle);
63 static QPainterPath wholeArc(const QRectF &rectangle);
64 static void drawCombinedDoughnutChart(quint64 data1, const QColor &data1Color,
65 quint64 data2, const QColor &data2Color,
66 QPainter &painter, quint64 iMaximum,
67 const QRectF &chartRect, const QRectF &innerRect, int iOverlayAlpha);
68
69 /* Returns a rectangle which is co-centric with @p outerFrame and scaled by @p fScaleX and fScaleY. */
70 static QRectF getScaledRect(const QRectF &outerFrame, float fScaleX, float fScaleY);
71
72 static void drawDoughnutChart(QPainter &painter, quint64 iMaximum, quint64 data,
73 const QRectF &chartRect, const QRectF &innerRect, int iOverlayAlpha, const QColor &color);
74
75private:
76
77 /** Parses the xml string we get from the IMachineDebugger and returns an array of UIDebuggerMetricData. */
78 static QVector<UIDebuggerMetricData> getAndParseStatsFromDebugger(CMachineDebugger &debugger, const QString &strQuery);
79
80};
81
82#endif /* !FEQT_INCLUDED_SRC_activity_UIMonitorCommon_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette