Revert latest docker builds
[functest-kubernetes.git] / docker / benchmarking / plotperf.py.patch
1 --- plotperf.py.orig    2021-05-09 10:42:17.858983226 +0200
2 +++ plotperf.py 2021-05-09 10:43:09.410934186 +0200
3 @@ -18,11 +18,13 @@
4  # Generates matplotlib line and bar charts from the netperf.csv raw data file
5  #
6  
7 +from __future__ import print_function
8 +from builtins import range
9  try:
10    import matplotlib.pyplot as plt
11 -except Exception, e:
12 +except Exception as e:
13    # Translate the traceback to a more friendly error message
14 -  print "Exception (%s) while importing matplotlib - install with apt-get install python-matplotlib (or equivalent package manager)" % e
15 +  print("Exception (%s) while importing matplotlib - install with apt-get install python-matplotlib (or equivalent package manager)" % e)
16    raise
17  
18  import numpy
19 @@ -93,7 +95,7 @@
20    for ext in [ "png", "svg" ]:
21      fname = os.path.join(options.outputdir, "{0}.{1}".format(options.suffix, ext))
22      plt.savefig(fname, dpi=100)
23 -    print "Saved {0}".format(fname)
24 +    print("Saved {0}".format(fname))
25  
26    barlabels = []
27    barvalues = []
28 @@ -105,7 +107,7 @@
29      barvalues.append(float(data[n][1]))
30  
31    plt.clf()
32 -  plt.barh(bottom=range(0, len(data)-1),
33 +  plt.barh(list(range(0, len(data)-1)),
34             height=0.5,
35             width=barvalues,
36             align='center')
37 @@ -117,4 +119,4 @@
38    for ext in [ "png", "svg" ]:
39      fname = os.path.join(options.outputdir, "{0}.bar.{1}".format(options.suffix, ext))
40      plt.savefig(fname, dpi=100)
41 -    print "Saved {0}".format(fname)
42 +    print("Saved {0}".format(fname))