public class ContinuousProfilingScheduler extends java.lang.Object implements ProfilingScheduler
| Constructor and Description |
|---|
ContinuousProfilingScheduler(Config config,
Exporter exporter,
Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
start(Profiler profiler)
Use Profiler's to start, stop, dumpProfile
Profiler.start()
Profiler.stop()
Profiler.dumpProfile(Instant, Instant)
Here is an example of naive implementation |
public void start(Profiler profiler)
ProfilingSchedulerProfiler.start()
Profiler.stop()
Profiler.dumpProfile(Instant, Instant)
Here is an example of naive implementation
public void start(Profiler profiler) {
new Thread(() -> {
while (true) {
Instant startTime = Instant.now();
profiler.start();
sleep(10);
profiler.stop();
exporter.export(
profiler.dumpProfile(startTime)
);
sleep(50);
}
}).start();
}
The real-world example will be more complex since profile start and stop time should be aligned to 10s intervals
See ContinuousProfilingScheduler and
Github issue #40 for more details.start in interface ProfilingScheduler