13#ifndef INTERFACE_STATISTICS_H
14#define INTERFACE_STATISTICS_H
74 QList<int>
pointsFor(
const QString &interfaceName)
const;
96 bool isActive(
const QString &interfaceName)
const;
103 unsigned rate(
const QString &interfaceName)
const;
195 void setWorkerInterval(
int intervalMsec);
196 void setWorkerFilter(
const QStringList &interfaceNames);
204 void onWorkerFailed(
int exitCode,
const QString &message);
208 void appendCapped(QList<int> &
buffer,
int value)
const;
211 void trimToCapacity(QList<int> &
buffer)
const;
214 void resetBaselines();
217 QThread workerThread_;
219 QHash<QString, quint64> lastReceived_;
220 QHash<QString, quint64> lastDropped_;
221 QHash<QString, QList<int> > receivedHistory_;
222 QHash<QString, QList<int> > droppedHistory_;
223 QSet<QString> active_;
225 QStringList interfaceFilter_;
226 int historyCapacity_;
227 int updateIntervalMsec_;
230 bool warned_no_interfaces_;
void setUpdateInterval(int intervalMsec)
Sets the sampling interval and forwards it to the worker.
Definition interface_statistics.cpp:190
void stop()
Stops sampling and tears down the dumpcap stream.
Definition interface_statistics.cpp:143
unsigned rate(const QString &interfaceName) const
Most recent received-packet delta for an interface.
Definition interface_statistics.cpp:103
int historyCapacity() const
Returns the per-interface history capacity, in entries.
Definition interface_statistics.cpp:116
bool isRunning() const
Returns true between start() and stop() (sampling requested).
Definition interface_statistics.cpp:121
void pauseSampling()
Temporarily suspends sampling (e.g. while a capture is active).
Definition interface_statistics.cpp:153
void start()
Begins sampling: opens the dumpcap statistics stream via the worker.
Definition interface_statistics.cpp:126
QList< int > pointsFor(const QString &interfaceName) const
Received-packet deltas for an interface, oldest to newest.
Definition interface_statistics.cpp:88
void statisticsUpdated()
Emitted after a worker snapshot has been folded into the history.
void resumeSampling()
Resumes sampling previously suspended with pauseSampling().
Definition interface_statistics.cpp:165
int updateInterval() const
Returns the current sampling interval, in milliseconds.
Definition interface_statistics.cpp:111
void resetActivity()
Re-evaluates interface activity, e.g. on a manual interface refresh.
Definition interface_statistics.cpp:222
void activityChanged()
Emitted when the set of active interfaces changes.
void removeInterfaces(const QStringList &removedInterfaceNames)
Drops all retained state for the given (vanished) interfaces.
Definition interface_statistics.cpp:205
InterfaceStatistics(QObject *parent=nullptr)
Constructs the facade and starts the worker thread (idle).
Definition interface_statistics.cpp:43
void setInterfaceFilter(const QStringList &interfaceNames)
Restricts which interfaces are sampled/emitted (empty = all).
Definition interface_statistics.cpp:199
void setHistoryCapacity(int maxEntries)
Sets the per-interface history capacity in entries.
Definition interface_statistics.cpp:232
QList< int > droppedPointsFor(const QString &interfaceName) const
Dropped-packet deltas for an interface, oldest to newest.
Definition interface_statistics.cpp:93
bool isActive(const QString &interfaceName) const
Whether an interface is currently considered active for sorting.
Definition interface_statistics.cpp:98
~InterfaceStatistics() override
Tears down the worker and its thread safely, then destroys.
Definition interface_statistics.cpp:75
Worker that runs a dumpcap "-S" statistics stream off the GUI thread.
Definition interface_stats_worker.h:81
QHash< QString, InterfaceStatsSample > InterfaceStatsSnapshot
A full set of per-interface counters keyed by interface name.
Definition interface_stats_worker.h:42
Sliding window buffer tracking per-stream burst and bandwidth statistics.
Definition mcast_stream.h:34