Plot diagrams more recognizable.
This commit is contained in:
parent
3e38472696
commit
743f1f0e39
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -24,6 +24,28 @@ colorMap = { "md_file_create": cm.tab10(0),
|
||||||
"write_calls": cm.tab10(8)
|
"write_calls": cm.tab10(8)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
markerMap = { "md_file_create": "^",
|
||||||
|
"md_file_delete": "v",
|
||||||
|
"md_other": ".",
|
||||||
|
"md_mod": "<",
|
||||||
|
"md_read": ">",
|
||||||
|
"read_bytes": "h",
|
||||||
|
"read_calls": "H",
|
||||||
|
"write_bytes": "D",
|
||||||
|
"write_calls": "d"
|
||||||
|
}
|
||||||
|
|
||||||
|
linestyleMap = { "md_file_create": ":",
|
||||||
|
"md_file_delete": ":",
|
||||||
|
"md_mod": ":",
|
||||||
|
"md_other": ":",
|
||||||
|
"md_read": ":",
|
||||||
|
"read_bytes": "--",
|
||||||
|
"read_calls": "--",
|
||||||
|
"write_bytes": "-.",
|
||||||
|
"write_calls": "-."
|
||||||
|
}
|
||||||
|
|
||||||
# Plot the timeseries
|
# Plot the timeseries
|
||||||
def plot(prefix, header, row):
|
def plot(prefix, header, row):
|
||||||
x = { h : d for (h, d) in zip(header, row)}
|
x = { h : d for (h, d) in zip(header, row)}
|
||||||
|
@ -50,16 +72,23 @@ def plot(prefix, header, row):
|
||||||
metrics = DataFrame()
|
metrics = DataFrame()
|
||||||
labels = []
|
labels = []
|
||||||
colors = []
|
colors = []
|
||||||
|
style = []
|
||||||
for name, group in groups:
|
for name, group in groups:
|
||||||
metrics[name] = [x[2] for x in group.values]
|
metrics[name] = [x[2] for x in group.values]
|
||||||
labels.append(name)
|
labels.append(name)
|
||||||
|
style.append(linestyleMap[name] + markerMap[name])
|
||||||
colors.append(colorMap[name])
|
colors.append(colorMap[name])
|
||||||
|
|
||||||
fsize = (8, 1 + 1.5 * len(labels))
|
fsize = (8, 1 + 1.5 * len(labels))
|
||||||
|
fsizeFixed = (8, 3)
|
||||||
|
|
||||||
ax = metrics.plot(subplots=True, legend=False, sharex=True, grid = True, sharey=True, marker='.', markersize=10, figsize=fsize, color=colors)
|
if len(labels) < 4 :
|
||||||
for (i, l) in zip(range(0, len(labels)), labels):
|
ax = metrics.plot(legend=True, sharex=True, grid = True, sharey=True, markersize=10, figsize=fsizeFixed, color=colors, style=style)
|
||||||
ax[i].set_ylabel(l)
|
ax.set_ylabel("Value")
|
||||||
|
else:
|
||||||
|
ax = metrics.plot(subplots=True, legend=False, sharex=True, grid = True, sharey=True, markersize=10, figsize=fsize, color=colors, style=style)
|
||||||
|
for (i, l) in zip(range(0, len(labels)), labels):
|
||||||
|
ax[i].set_ylabel(l)
|
||||||
|
|
||||||
pyplot.xlabel("Segment number")
|
pyplot.xlabel("Segment number")
|
||||||
pyplot.savefig(prefix + "timeseries" + jobid + ".pdf")
|
pyplot.savefig(prefix + "timeseries" + jobid + ".pdf")
|
||||||
|
@ -68,9 +97,14 @@ def plot(prefix, header, row):
|
||||||
if len(timeseries) <= 50:
|
if len(timeseries) <= 50:
|
||||||
return
|
return
|
||||||
|
|
||||||
ax = metrics.plot(subplots=True, legend=False, sharex=True, grid = True, sharey=True, marker='.', color=colors, markersize=10, xlim=(0,30), figsize=fsize)
|
|
||||||
for (i, l) in zip(range(0, len(labels)), labels):
|
if len(labels) < 4 :
|
||||||
ax[i].set_ylabel(l)
|
ax = metrics.plot(legend=True, xlim=(0,30), sharex=True, grid = True, sharey=True, markersize=10, figsize=fsizeFixed, color=colors, style=style)
|
||||||
|
ax.set_ylabel("Value")
|
||||||
|
else:
|
||||||
|
ax = metrics.plot(subplots=True, xlim=(0,30), legend=False, sharex=True, grid = True, sharey=True, markersize=10, figsize=fsize, color=colors, style=style)
|
||||||
|
for (i, l) in zip(range(0, len(labels)), labels):
|
||||||
|
ax[i].set_ylabel(l)
|
||||||
|
|
||||||
pyplot.xlabel("Segment number")
|
pyplot.xlabel("Segment number")
|
||||||
pyplot.savefig(prefix + "timeseries" + jobid + "-30.pdf")
|
pyplot.savefig(prefix + "timeseries" + jobid + "-30.pdf")
|
||||||
|
|
Loading…
Reference in New Issue