Skip to content

Commit

Permalink
Fix plot scripts and doc for traceAnalyzer (#68)
Browse files Browse the repository at this point in the history
* Fix scripts for traceAnalyzer

* Update doc of traceAnalyzer
  • Loading branch information
haochengxia authored Jun 20, 2024
1 parent 3abee5f commit 84a44b2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions doc/quickstart_traceAnalyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ After generating plot data, we can plot access pattern, request rate, size, reus
python3 scripts/traceAnalysis/access_pattern.py ${dataname}.accessRtime

# plot the access pattern using logical/virtual (request count) time
python3 scripts/traceAnalysis/access_pattern.py ${dataname}.accessRtime
python3 scripts/traceAnalysis/access_pattern.py ${dataname}.accessVtime
```

Some example plots are shown below:
Expand Down Expand Up @@ -243,7 +243,7 @@ There are two versions of the plots, one is line plot, and the other is a heatma
```bash
# this requires a long trace (e.g., 7 day) to generate a meaningful plot
# and most block workloads do not have enough requests to plot meaningful popularity decay
python3 scripts/traceAnalysis/popularity_decay.py ${dataname}.popularityDecay_w300
python3 scripts/traceAnalysis/popularity_decay.py ${dataname}.popularityDecay_w300_obj
```

<!-- Some example plots are shown below:
Expand Down
4 changes: 2 additions & 2 deletions scripts/traceAnalysis/access_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def plot_access_pattern(
is_real_time = "Rtime" in datapath
if is_real_time:
xlabel = "Time (hour)"
figname = "fig/{}_access_rt.{}".format(figname_prefix, FIG_TYPE)
figname = "{}/{}_access_rt.{}".format(FIG_DIR, figname_prefix, FIG_TYPE)
for idx, ts_list in enumerate(access_time_list):
# access_rtime_list stores N objects, each object has one access pattern list
plt.scatter(
Expand All @@ -117,7 +117,7 @@ def plot_access_pattern(
"Vtime" in datapath
), "the input file might not be accessPattern data file"
xlabel = "Time (# million requests)"
figname = "fig/{}_access_vt.{}".format(figname_prefix, FIG_TYPE)
figname = "{}/{}_access_vt.{}".format(FIG_DIR, figname_prefix, FIG_TYPE)
for idx, ts_list in enumerate(access_time_list):
# access_rtime_list stores N objects, each object has one access pattern list
plt.scatter(
Expand Down
4 changes: 2 additions & 2 deletions scripts/traceAnalysis/experimental/scanSize.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def plot_scan_size(datapath, figname_prefix=""):

plt.xlabel("Scan size")
plt.ylabel("Count")
plt.savefig("{}_scan_size.png".format(figname_prefix), bbox_inches="tight")
plt.savefig("{}/{}_scan_size.{}".format(FIG_DIR, figname_prefix, FIG_TYPE), bbox_inches="tight")
plt.clf()

x, y = conv_to_cdf(scan_size_cnt)
Expand All @@ -74,7 +74,7 @@ def plot_scan_size(datapath, figname_prefix=""):
plt.grid(linestyle="--")
plt.xlabel("Scan size")
plt.ylabel("CDF")
plt.savefig("{}_scan_size_cdf.png".format(figname_prefix), bbox_inches="tight")
plt.savefig("{}/{}_scan_size_cdf.{}".format(FIG_DIR, figname_prefix, FIG_TYPE), bbox_inches="tight")
plt.clf()


Expand Down
5 changes: 3 additions & 2 deletions scripts/traceAnalysis/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

dataname=$1

python3 access_pattern.py ${dataname}.access
python3 access_pattern.py ${dataname}.accessRtime
python3 access_pattern.py ${dataname}.accessVtime
python3 req_rate.py ${dataname}.reqRate_w300
python3 size.py ${dataname}.size
python3 reuse.py ${dataname}.reuse
Expand All @@ -11,5 +12,5 @@ python3 popularity.py ${dataname}.popularity
python3 size_heatmap.py ${dataname}.sizeWindow_w300
# python3 futureReuse.py ${dataname}.access

python3 popularity_decay.py ${dataname}.popularityDecay_w300
python3 popularity_decay.py ${dataname}.popularityDecay_w300_obj
python3 reuse_heatmap.py ${dataname}.reuseWindow_w300

0 comments on commit 84a44b2

Please sign in to comment.