API-twoDPlots¶
- this module provides functions for all the two dimensional figure plotting, currently including:
### time related ### request_rate_2d, cold_miss_count_2d, cold_miss_ratio_2d, namemapping_2d (mapping block to a LBA) for visualization of scan and so on interval_hit_ratio_2d
### static ### popularity_2d (frequency popularity) rd_freq_popularity_2d, rd_popularity_2d, rt_popularity_2d,
In time related plots, the x-axis should be real or virtual time.
- TODO:
add percentage to rd_popularity_2d
Author: Jason Yang <peter.waynechina@gmail.com> 2016/10
- PyMimircache.profiler.twoDPlots.request_rate_2d(reader, time_mode, time_interval, figname='request_rate.png', **kwargs)¶
plot the number of requests per time_interval vs time :param reader: :param time_mode: either ‘r’ or ‘v’ for real time(wall-clock time) or virtual time(reference time) :param time_interval: :param figname: :return: the list of data points
- PyMimircache.profiler.twoDPlots.cold_miss_count_2d(reader, time_mode, time_interval, figname='cold_miss_count2d.png', **kwargs)¶
plot the number of cold miss per time_interval :param reader: :param time_mode: either ‘r’ or ‘v’ for real time(wall-clock time) or virtual time(reference time) :param time_interval: :param figname: :return: the list of data points
- PyMimircache.profiler.twoDPlots.cold_miss_ratio_2d(reader, time_mode, time_interval, figname='cold_miss_ratio2d.png', **kwargs)¶
plot the percent of cold miss per time_interval :param reader: :param time_mode: either ‘r’ or ‘v’ for real time(wall-clock time) or virtual time(reference time) :param time_interval: :param figname: :return: the list of data points
- PyMimircache.profiler.twoDPlots.scan_vis_2d(reader, partial_ratio=0.1, figname=None, **kwargs)¶
rename all the ojbID for items in the trace for visualization of trace so the first obj is renamed to 1, the second obj is renamed to 2, etc. Notice that it is not first request, second request…
- Parameters:
reader
partial_ratio – take first partial_ratio of trace for zooming in
figname
- Returns:
- PyMimircache.profiler.twoDPlots.popularity_2d(reader, logX=True, logY=False, cdf=True, plot_type='obj', figname='popularity_2d.png', **kwargs)¶
plot the popularity curve of the obj in the trace X axis is object frequency, Y axis is either obj percentage or request percentage depending on plot_type
- Parameters:
reader
logX
logY
cdf
plot_type
figname
- Returns:
the list of data points
- PyMimircache.profiler.twoDPlots.rd_freq_popularity_2d(reader, logX=True, logY=True, cdf=False, figname='rdFreq_popularity_2d.png', **kwargs)¶
plot the reuse distance distribution in a two dimensional figure, X axis is reuse distance frequency Y axis is the number of requests in percentage :param reader: :param logX: :param logY: :param cdf: :param figname: :return: the list of data points
- PyMimircache.profiler.twoDPlots.rd_popularity_2d(reader, logX=True, logY=False, cdf=True, figname='rd_popularity_2d.png', **kwargs)¶
plot the reuse distance distribution in two dimension, cold miss is ignored X axis is reuse distance Y axis is number of requests (not in percentage) :param reader: :param logX: :param logY: :param cdf: :param figname: :return: the list of data points
- PyMimircache.profiler.twoDPlots.rt_popularity_2d(reader, granularity=10, logX=True, logY=False, cdf=True, figname='rt_popularity_2d.png', **kwargs)¶
plot the reuse time distribution in the trace X axis is reuse time, Y axis is number of requests (not in percentage)
- Parameters:
reader
granularity
logX
logY
cdf
figname
kwargs – time_bin
- Returns:
the list of data points
- PyMimircache.profiler.twoDPlots.interval_hit_ratio_2d(reader, cache_size, decay_coef=0.8, time_mode='v', time_interval=10000, figname='IHRC_2d.png', **kwargs)¶
The hit ratio curve over time interval, each pixel in the plot represents the exponential weight moving average (ewma) of hit ratio of the interval
- Parameters:
reader
cache_size
decay_coef – used in ewma
time_mode
time_interval
figname
- Returns:
the list of data points