More improvements
This commit is contained in:
@@ -240,58 +240,45 @@ def accesses_per_activate(connection):
|
||||
return round(result[0]*1.0/number_of_activates(connection), 1)
|
||||
|
||||
|
||||
def get_total_time_in_phase(connection, phase):
|
||||
cursor = connection.cursor()
|
||||
query = "SELECT SUM(PhaseEnd - PhaseBegin) / 1000 from Phases where PhaseName = :phase"
|
||||
cursor.execute(query, {"phase": phase})
|
||||
time = cursor.fetchone()
|
||||
totalTime = time[0]
|
||||
if (totalTime is None):
|
||||
totalTime = 0.0
|
||||
return totalTime
|
||||
|
||||
|
||||
@metric
|
||||
def time_in_PDNA_in_ns(connection):
|
||||
cursor = connection.cursor()
|
||||
result = []
|
||||
cursor.execute("SELECT SUM(PhaseEnd - PhaseBegin)/1000 from Phases where PhaseName = 'PDNA'")
|
||||
timeInPDNA = cursor.fetchone()
|
||||
totalTimeInPDNA = timeInPDNA[0]
|
||||
if (totalTimeInPDNA is None):
|
||||
totalTimeInPDNA = 0.0
|
||||
return totalTimeInPDNA
|
||||
return get_total_time_in_phase(connection, "PDNA")
|
||||
|
||||
|
||||
@metric
|
||||
def time_in_PDNA_percent(connection):
|
||||
totalTimeAllBanks = trace_length_in_ns(connection)
|
||||
return time_in_PDNA_in_ns(connection) * 1.0 / totalTimeAllBanks
|
||||
return (time_in_PDNA_in_ns(connection) * 1.0 / trace_length_in_ns(connection)) * 100
|
||||
|
||||
|
||||
@metric
|
||||
def time_in_PDNP_in_ns(connection):
|
||||
cursor = connection.cursor()
|
||||
result = []
|
||||
cursor.execute("SELECT SUM(PhaseEnd - PhaseBegin)/1000 from Phases where PhaseName = 'PDNP'")
|
||||
timeInPDNP = cursor.fetchone()
|
||||
totalTimeInPDNP = timeInPDNP[0]
|
||||
if (totalTimeInPDNP is None):
|
||||
totalTimeInPDNP = 0.0
|
||||
return totalTimeInPDNP
|
||||
return get_total_time_in_phase(connection, "PDNP")
|
||||
|
||||
|
||||
@metric
|
||||
def time_in_PDNP_percent(connection):
|
||||
totalTimeAllBanks = trace_length_in_ns(connection)
|
||||
return (time_in_PDNP_in_ns(connection) * 1.0 / totalTimeAllBanks) * 100
|
||||
return (time_in_PDNP_in_ns(connection) * 1.0 / trace_length_in_ns(connection)) * 100
|
||||
|
||||
|
||||
@metric
|
||||
def time_in_SREF_in_ns(connection):
|
||||
cursor = connection.cursor()
|
||||
result = []
|
||||
cursor.execute("SELECT SUM(PhaseEnd - PhaseBegin)/1000 from Phases where PhaseName = 'SREF'")
|
||||
timeInSREF = cursor.fetchone()
|
||||
totalTimeInSREF = timeInSREF[0]
|
||||
if (totalTimeInSREF is None):
|
||||
totalTimeInSREF = 0.0
|
||||
return totalTimeInSREF
|
||||
return get_total_time_in_phase(connection, "SREF")
|
||||
|
||||
|
||||
@metric
|
||||
def time_in_SREF_percent(connection):
|
||||
totalTimeAllBanks = trace_length_in_ns(connection)
|
||||
return (time_in_SREF_in_ns(connection) * 1.0 / totalTimeAllBanks) * 100
|
||||
return (time_in_SREF_in_ns(connection) * 1.0 / trace_length_in_ns(connection)) * 100
|
||||
|
||||
|
||||
@metric
|
||||
|
||||
Reference in New Issue
Block a user