Commit 22a5f447 authored by Mario Hock's avatar Mario Hock
Browse files

simple_plotter: print general header (to terminal)

parent 6fd3e3df
......@@ -42,6 +42,9 @@ def calc_ema(values, alpha=0.2):
def pretty_json(data):
return json.dumps(data, sort_keys=True, indent=4)
## Helper functions for CNLParser -- but they could also be handy in other contexts.
......
......@@ -4,7 +4,7 @@
import sys
import matplotlib
from cnl_library import CNLParser, calc_ema, merge_lists
from cnl_library import CNLParser, calc_ema, merge_lists, pretty_json
## matplotlib.use('QT4Agg') # override matplotlibrc
import matplotlib.pyplot as plt
......@@ -27,15 +27,6 @@ def parse_cnl_file(filename):
## * Parse input file. *
cnl_file = CNLParser(filename)
## Display header informations.
print( cnl_file.get_type() )
print( cnl_file.get_comment() )
print( "CPUs: " + str(cnl_file.get_cpus()) )
print( "NICs: " + str(cnl_file.get_nics()) )
## Prepare data for matplotlib
#nics = cnl_file.get_nics()
......@@ -116,9 +107,12 @@ if __name__ == "__main__":
for i in range(1, num_files+1):
## Read file
filename = sys.argv[i]
print( filename )
cnl_file = parse_cnl_file(filename)
print( filename )
print( pretty_json(cnl_file.get_general_header()) )
print()
## Plot with matplotlib.
## Draw comment on the figure (use absolute positioning).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment