Fix getThreads() in metrics script.

Bug introduced by pull request #191.

https://git.rhrk.uni-kl.de/EIT-Wehn/dram.vp.system/pull/191

Tests with refresh disabled made the bug evident.
This commit is contained in:
Éder F. Zulian
2018-08-02 14:44:20 +02:00
parent bfdf1577de
commit 9a4f8eda1e
2 changed files with 9 additions and 1 deletions

View File

@@ -90,3 +90,9 @@ def getMaxRefBurst(connection):
cursor.execute(" SELECT MaxRefBurst FROM GeneralInfo ")
result = cursor.fetchone()
return result[0]
def getControllerThread(connection):
cursor = connection.cursor()
cursor.execute("SELECT ControllerThread FROM GeneralInfo")
result = cursor.fetchone()
return result[0]

View File

@@ -18,8 +18,10 @@ def threadMetric(function):
def getThreads(connection):
cthread = getControllerThread(connection)
cursor = connection.cursor()
cursor.execute("SELECT DISTINCT(TThread) FROM transactions WHERE TThread != 0 ORDER BY TThread")
query = "SELECT DISTINCT(TThread) FROM transactions WHERE TThread != " + str(cthread) + " ORDER BY TThread"
cursor.execute(query)
result = []
for currentRow in cursor:
result.append(currentRow[0])