public interface ProfilingScheduler
| Modifier and Type | Method and Description |
|---|---|
void |
start(Profiler profiler)
Use Profiler's to start, stop, dumpProfile
Profiler.start()
Profiler.stop()
Profiler.dumpProfile(Instant)
Here is an example of naive implementation |
void start(Profiler profiler)
Profiler.start()
Profiler.stop()
Profiler.dumpProfile(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.