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)
|
||||
}
|
||||
|
||||
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
|
||||
def plot(prefix, header, row):
|
||||
x = { h : d for (h, d) in zip(header, row)}
|
||||
|
@ -50,14 +72,21 @@ def plot(prefix, header, row):
|
|||
metrics = DataFrame()
|
||||
labels = []
|
||||
colors = []
|
||||
style = []
|
||||
for name, group in groups:
|
||||
metrics[name] = [x[2] for x in group.values]
|
||||
labels.append(name)
|
||||
style.append(linestyleMap[name] + markerMap[name])
|
||||
colors.append(colorMap[name])
|
||||
|
||||
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 :
|
||||
ax = metrics.plot(legend=True, sharex=True, grid = True, sharey=True, markersize=10, figsize=fsizeFixed, color=colors, style=style)
|
||||
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)
|
||||
|
||||
|
@ -68,7 +97,12 @@ def plot(prefix, header, row):
|
|||
if len(timeseries) <= 50:
|
||||
return
|
||||
|
||||
ax = metrics.plot(subplots=True, legend=False, sharex=True, grid = True, sharey=True, marker='.', color=colors, markersize=10, xlim=(0,30), figsize=fsize)
|
||||
|
||||
if len(labels) < 4 :
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue