Files
DRAMSys/dram/static/metrics.py
2014-03-21 13:46:38 +01:00

25 lines
571 B
Python

import sys
import sqlite3
def the_answer_to_life_the_universe_and_everything(connection):
return 42
def number_of_precharges(connection):
return 21
def calculateMetrics(pathToTrace):
connection = sqlite3.connect(pathToTrace)
metrics = [the_answer_to_life_the_universe_and_everything, number_of_precharges]
result = []
for metric in metrics:
result.append((metric.__name__.replace("_"," "), metric(connection)))
connection.close()
print(result)
return result
if __name__ == "__main__":
path = sys.argv[1]
calculateMetrics(path)