]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/src/third_party/duktape-1.8.0/examples/alloc-logging/log2gnuplot.py
3 # Analyze allocator logs and write total-bytes-in-use after every
4 # operation to stdout. The output can be gnuplotted as:
6 # $ python log2gnuplot.py </tmp/duk-alloc-log.txt >/tmp/output.txt
8 # > plot "output.txt" with lines
17 for line
in sys
.stdin
:
19 parts
= line
.split(' ')
21 # A ptr/NULL/FAIL size
23 # R ptr/NULL oldsize ptr/NULL/FAIL newsize
25 # Note: ajduk doesn't log oldsize (uses -1 instead)
28 if parts
[1] != 'NULL' and parts
[1] != 'FAIL':
29 allocated
+= long(parts
[2])
31 allocated
-= long(parts
[2])
33 allocated
-= long(parts
[2])
34 if parts
[3] != 'NULL' and parts
[3] != 'FAIL':
35 allocated
+= long(parts
[4])
40 if __name__
== '__main__':