Debian Codegraph @

src/LomiriMetrics/events_p.h

raw
1 // Copyright © 2016 Canonical Ltd.
2 // Author: Loïc Molinari <[email protected]>
3 //
4 // This file is part of Lomiri UI Toolkit.
5 //
6 // Lomiri UI Toolkit is free software: you can redistribute it and/or modify it
7 // under the terms of the GNU Lesser General Public License as published by the
8 // Free Software Foundation; version 3.
9 //
10 // Lomiri UI Toolkit is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 // for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with Lomiri UI Toolkit. If not, see <http://www.gnu.org/licenses/>.
17
18 #ifndef EVENTS_P_H
19 #define EVENTS_P_H
20
21 #include <QtGlobal>
22
23 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
24 #include <LomiriMetrics-Qt6/events.h>
25 #else
26 #include <LomiriMetrics/events.h>
27 #endif
28
29 #include <sys/times.h>
30
31 #include <QtCore/QElapsedTimer>
32
33 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
34 #include <LomiriMetrics-Qt6/private/lomirimetricsglobal_p.h>
35 #else
36 #include <LomiriMetrics/private/lomirimetricsglobal_p.h>
37 #endif
38
39 class LOMIRI_METRICS_PRIVATE_EXPORT EventUtilsPrivate
40 {
41 public:
42 EventUtilsPrivate();
43 ~EventUtilsPrivate();
44
45 void updateCpuUsage(UMEvent* event);
46 void updateProcStatMetrics(UMEvent* event);
47
48 char* m_buffer;
49 QElapsedTimer m_cpuTimer;
50 struct tms m_cpuTimes;
51 clock_t m_cpuTicks;
52 quint16 m_cpuOnlineCores;
53 quint16 m_pageSize;
54 };
55
56 #endif // EVENTS_P_H