MCPcopy Create free account
hub / github.com/boxbeam/RedLib / start

Method start

src/redempt/redlib/dev/profiler/BurstProfiler.java:44–63  ·  view source on GitHub ↗

Start this profiler. Must be run from the thread you intend to profile.

()

Source from the content-addressed store, hash-verified

42 * Start this profiler. Must be run from the thread you intend to profile.
43 */
44 @Override
45 public void start() {
46 samples.clear();
47 if (server != null) {
48 return;
49 }
50 server = Thread.currentThread();
51 scheduler = Executors.newSingleThreadScheduledExecutor();
52 scheduler.scheduleAtFixedRate(() -> {
53 new Thread(() -> {
54 if (server == null) {
55 return;
56 }
57 Sample sample = new Sample(server.getStackTrace(), System.currentTimeMillis());
58 while (!samples.offer(sample)) {
59 samples.poll();
60 }
61 }).start();
62 }, 1, 1, TimeUnit.MILLISECONDS);
63 }
64
65 protected void end() {
66 if (scheduler != null) {

Callers

nothing calls this directly

Calls 2

getStackTraceMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected