Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
stalleventsource_p.h
Go to the documentation of this file.
1#pragma once
2
6
8
9#include "stacksampler_p.h"
10
11#include <QtCore/QElapsedTimer>
12#include <QtCore/QTimer>
13
14#include <memory>
15
16namespace Sonde {
17
20{
21public:
23 static StallEventSourcePrivate *get(StallEventSource *source) { return source->d.get(); }
24
27 QString startSampling();
29 void stopSampling();
30
31 std::chrono::milliseconds threshold{ 1 };
32 QTimer timer;
33 QElapsedTimer since;
34 std::function<bool()> inBackground;
37 std::shared_ptr<Detail::StackSampler> sampler;
38};
39
40} // namespace Sonde
StallEventSource's private part.
Definition stalleventsource_p.h:20
QElapsedTimer since
Time since the previous tick.
Definition stalleventsource_p.h:33
std::function< bool()> inBackground
Optional: whether the application is in the background.
Definition stalleventsource_p.h:34
static StallEventSourcePrivate * get(StallEventSource *source)
The private part of source.
Definition stalleventsource_p.h:23
QTimer timer
The 100 ms tick.
Definition stalleventsource_p.h:32
void stopSampling()
Stops sampling.
Definition stalleventsource.cpp:31
QString startSampling()
Starts sampling this source's thread during stalls; call it on that thread.
Definition stalleventsource.cpp:18
std::chrono::milliseconds threshold
Smallest stall reported.
Definition stalleventsource_p.h:31
std::shared_ptr< Detail::StackSampler > sampler
Samples the stack during stalls while the server says so; shared with the server's app_status and app...
Definition stalleventsource_p.h:37
Reports when the event loop of its thread was blocked, as events from source "stalls".
Definition stalleventsource.h:34
PrivatePtr< StallEventSourcePrivate > d
Implementation.
Definition stalleventsource.h:55
Embeddable Model Context Protocol server for Qt applications.
Definition dispatch.cpp:10
Private: Sonde::Detail::StackSampler, which samples a thread's stack while it is stalled (design 0016...
Sonde::StallEventSource: events when the main thread was blocked.