diff --git a/DRAMSys/traceAnalyzer/scripts/metrics.py b/DRAMSys/traceAnalyzer/scripts/metrics.py index 24bf8e1e..26e55057 100644 --- a/DRAMSys/traceAnalyzer/scripts/metrics.py +++ b/DRAMSys/traceAnalyzer/scripts/metrics.py @@ -57,6 +57,13 @@ def trans_with_max_response_latency(connection): result = cursor.fetchone() return result[0] +@metric +def duration_max_response_latency(connection): + cursor = connection.cursor() + cursor.execute(""" SELECT max(RESP.PHASEBEGIN - REQ.PHASEBEGIN)/1000 FROM PHASES REQ, PHASES RESP WHERE REQ.PHASENAME = 'REQ' AND RESP.PHASENAME='RESP' AND REQ.TRANSACT = RESP.TRANSACT """) + result = cursor.fetchone() + return result[0] + @metric def memory_active(connection): diff --git a/DRAMSys/traceAnalyzer/scripts/plots.py b/DRAMSys/traceAnalyzer/scripts/plots.py index cf24d23d..7576fd8a 100755 --- a/DRAMSys/traceAnalyzer/scripts/plots.py +++ b/DRAMSys/traceAnalyzer/scripts/plots.py @@ -4,7 +4,7 @@ from memUtil import * from math import * import ntpath import os -numberOfBins = 50 +numberOfBins = "auto" latencyRange = None plots = [] @@ -238,7 +238,7 @@ def latency_histogram(connection, tracePath, steps): import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages - plt.hist(dataArray, numberOfBins, range=latencyRange, histtype='bar', facecolor='green') + plt.hist(dataArray, bins=numberOfBins, range=latencyRange, histtype='bar', facecolor='green') plt.grid(True) plt.xlabel("Access Time [ns]") plt.ylabel("Number of Accesses (Frequency)") @@ -315,6 +315,7 @@ def generatePlots(pathToTrace): if __name__ == "__main__": path = sys.argv[1] if ((len(sys.argv)) > 2): - numberOfBins = int(sys.argv[2]) # Optional argument to use a different number of bins - latencyRange = (0, int(sys.argv[3])) # Optional argument to use a different range + latencyRange = (0, int(sys.argv[2])) # Optional argument to use a different range + if ((len(sys.argv)) > 3): + numberOfBins = int(sys.argv[3]) # Optional argument to use a different number of bins generatePlots(path)