Skip to content
Phosphor
/
API Reference
Search
PlasmaZones
Libraries
Guides
Brand
Palette
About
GitHub
Discord
Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
SystemStatsReader.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2026 fuddlesworth
2
// SPDX-License-Identifier: LGPL-2.1-or-later
3
#pragma once
4
5
#include <PhosphorShell/phosphorshell_export.h>
6
#include <QByteArray>
7
#include <QVariantMap>
8
#include <memory>
9
10
namespace
PhosphorShell
{
11
// A synchronous Linux collector. Run on a worker thread; paths may point to a
12
// proc/sys snapshot. Unavailable numeric fields use -1, never a fabricated zero.
13
class
PHOSPHORSHELL_EXPORT
SystemStatsReader
14
{
15
public
:
16
explicit
SystemStatsReader
(
const
QString& procRoot = QStringLiteral(
"/proc"
),
17
const
QString& sysRoot = QStringLiteral(
"/sys"
));
18
~SystemStatsReader
();
19
QVariantMap
sample
();
20
void
resetRates
();
21
static
QVariantMap
memoryFrom
(
const
QByteArray& content);
22
static
double
counterRate
(quint64 previous, quint64 current,
double
seconds);
23
24
private
:
25
struct
Private;
26
std::unique_ptr<Private> d;
27
};
28
}
PhosphorShell::SystemStatsReader::memoryFrom
static QVariantMap memoryFrom(const QByteArray &content)
PhosphorShell::SystemStatsReader::SystemStatsReader
SystemStatsReader(const QString &procRoot=QStringLiteral("/proc"), const QString &sysRoot=QStringLiteral("/sys"))
PhosphorShell::SystemStatsReader::resetRates
void resetRates()
PhosphorShell::SystemStatsReader::sample
QVariantMap sample()
PhosphorShell::SystemStatsReader::counterRate
static double counterRate(quint64 previous, quint64 current, double seconds)
PhosphorShell::SystemStatsReader::~SystemStatsReader
~SystemStatsReader()
PhosphorShell
Definition
Environment.h:11
phosphor-shell
include
PhosphorShell
SystemStatsReader.h
Generated by
1.15.0