-
-
Save jribeiro/7f69011377e76d8f96ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stap | |
global samples | |
global all_samples | |
global timestamp | |
probe process("node").mark("gc__start") | |
{ | |
timestamp = gettimeofday_us() | |
} | |
probe process("node").mark("gc__done") | |
{ | |
sample = gettimeofday_us() - timestamp | |
samples <<< sample | |
all_samples <<< sample | |
} | |
probe timer.s(5) | |
{ | |
print(@hist_log(samples)) | |
printf("min:%d avg:%d max:%d count:%d\n", | |
@min(samples), @avg(samples), | |
@max(samples), @count(samples)) | |
delete samples | |
} | |
probe end | |
{ | |
print(@hist_log(all_samples)) | |
printf("min:%d avg:%d max:%d count:%d\n", | |
@min(all_samples), @avg(all_samples), | |
@max(all_samples), @count(all_samples)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment