Skip to content

Instantly share code, notes, and snippets.

@justdoit0823
Last active March 20, 2021 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justdoit0823/e9feedde78ec3c29ad62144a35b864a4 to your computer and use it in GitHub Desktop.
Save justdoit0823/e9feedde78ec3c29ad62144a35b864a4 to your computer and use it in GitHub Desktop.
Stat g1 gc interval in jvm 8 with awk.
# pipe
awk '/GC pause/ {split($2, a, ":"); print a[1]}'|awk 'NR % 2 == 1 {t1 = $1}; NR % 2 == 0 {d = $1 - t1; print d; next}'
# gc log file
awk '/GC pause/ {split($2, a, ":"); print a[1]}' gc.log|awk 'NR % 2 == 1 {t1 = $1}; NR % 2 == 0 {d = $1 - t1; print d; next}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment