-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: iipeace <[email protected]>
- Loading branch information
Showing
1 changed file
with
44 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
__credits__ = "Peace Lee" | ||
__license__ = "GPLv2" | ||
__version__ = "3.9.8" | ||
__revision__ = "241003" | ||
__revision__ = "241004" | ||
__maintainer__ = "Peace Lee" | ||
__email__ = "[email protected]" | ||
__repository__ = "https://github.com/iipeace/guider" | ||
|
@@ -116868,7 +116868,7 @@ def _getProcName(pinfo): | |
def _getter(func, var): | ||
return [ | ||
func([i[0] for i in var]), | ||
func([i[1] for i in var]), | ||
func([i[1] if len(i) > 1 else i[0] for i in var]), | ||
] | ||
|
||
def _updateStats(target, usage): | ||
|
@@ -116983,8 +116983,26 @@ def _updateStats(target, usage): | |
if not stats: | ||
continue | ||
elif r in ("psiUsage"): | ||
# TODO: handle PSI usage # | ||
continue | ||
itemList = [] | ||
for res, subStats in stats.items(): | ||
subStats = [ | ||
list(map(long, x.split("/"))) | ||
for x in subStats.split() | ||
] | ||
subStats = _getter(lambda x: x, subStats) | ||
rname = "psi" + res[0].upper() + res[1:] | ||
itemList.append( | ||
( | ||
rname + "Some", | ||
subStats[0], | ||
) | ||
) | ||
itemList.append( | ||
( | ||
rname + "Full", | ||
subStats[1], | ||
) | ||
) | ||
elif r in ("nrTask"): | ||
subStats = [list(map(long, x.split("/"))) for x in stats] | ||
subStats = _getter(lambda x: x, subStats) | ||
|
@@ -117536,9 +117554,11 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
if unit: | ||
newStatStr = "%7s(%2d)(%4s%s/%6.1f%s/%4s%s/%5s%s) |" | ||
diffStr = "{0:>6}{1:1}" | ||
diffStr2 = "%6.1f%s" | ||
else: | ||
newStatStr = "%7s(%2d)(%5s%s/%7.1f%s/%5s%s/%6s%s) |" | ||
diffStr = "{0:>7}{1:0}" | ||
diffStr2 = "%7.1f%s" | ||
jsonData[res] = {} | ||
|
||
# print diff # | ||
|
@@ -117565,7 +117585,9 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
nrPrint = 0 | ||
|
||
for pname, value in sorted( | ||
unionList.items(), key=lambda e: float(e[1]), reverse=True | ||
unionList.items(), | ||
key=lambda e: (float(e[1]), e[0]), | ||
reverse=True, | ||
): | ||
if pname == "[ TOTAL ]": | ||
continue | ||
|
@@ -117595,8 +117617,9 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
# no target process in this file # | ||
if not pname in procList: | ||
if idx > 0 and pname in prevProcList: | ||
diff = "%6.1f%s" % ( | ||
-(prevProcList[pname][item]), | ||
diffVal = prevProcList[pname][item] | ||
diff = diffStr2 % ( | ||
-(diffVal) if diffVal else 0, | ||
unit, | ||
) | ||
diff = convColor(diff, "WARNING", 6) | ||
|
@@ -117632,11 +117655,9 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
else: | ||
diff = "0" | ||
|
||
total = convNum(procStat["total"]) | ||
|
||
jsonData[res][pname][fname] = { | ||
"diff": diff.strip(" %"), | ||
"total": total, | ||
"total": procStat["total"], | ||
"cnt": procStat["cnt"], | ||
"min": procStat["minimum"], | ||
"avg": procStat["average"], | ||
|
@@ -117646,13 +117667,13 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
newStat = newStatStr % ( | ||
diff, | ||
procStat["cnt"], | ||
procStat["minimum"], | ||
convNum(procStat["minimum"]), | ||
unit, | ||
procStat["average"], | ||
unit, | ||
procStat["maximum"], | ||
convNum(procStat["maximum"]), | ||
unit, | ||
total, | ||
convNum(procStat["total"]), | ||
unit, | ||
) | ||
|
||
|
@@ -117736,7 +117757,7 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
nrPrint = 0 | ||
|
||
for pname, value in sorted( | ||
unionBlkList.items(), key=lambda e: sum(e[1]), reverse=True | ||
unionBlkList.items(), key=lambda e: (sum(e[1]), e[0]), reverse=True | ||
): | ||
if pname == "[ TOTAL ]": | ||
continue | ||
|
@@ -117896,7 +117917,9 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
nrPrint = 0 | ||
|
||
for pname, value in sorted( | ||
unionRssList.items(), key=lambda e: long(e[1]), reverse=True | ||
unionRssList.items(), | ||
key=lambda e: (long(e[1]), e[0]), | ||
reverse=True, | ||
): | ||
if pname == "FREE": | ||
printBuf = "%16s | " % "[FREE]" | ||
|
@@ -118090,9 +118113,9 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
if initDiff: | ||
initDiffStr = convNum(initDiff, True, 1) | ||
if initDiff > 0: | ||
initDiff = convColor(initDiffStr, "RED") | ||
initDiff = convColor(initDiffStr, "RED", 5) | ||
elif initDiff < 0: | ||
initDiff = convColor(initDiffStr, "GREEN") | ||
initDiff = convColor(initDiffStr, "GREEN", 5) | ||
else: | ||
initDiff = "-" | ||
diff = "%5s(%5s)/%5s(%5s) |" % ( | ||
|
@@ -118158,9 +118181,9 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
if "startDiff" in sdUnitStat: | ||
startDiff = convNum(sdUnitStat["startDiff"], True, 1) | ||
if sdUnitStat["startDiff"] > 0: | ||
startDiff = convColor(startDiff, "RED") | ||
startDiff = convColor(startDiff, "RED", 5) | ||
elif sdUnitStat["startDiff"] < 0: | ||
startDiff = convColor(startDiff, "GREEN") | ||
startDiff = convColor(startDiff, "GREEN", 5) | ||
|
||
if sortStd == "startDiff": | ||
totalerr += abs(sdUnitStat["startDiff"]) | ||
|
@@ -118170,9 +118193,9 @@ def _getFileMenu(printBuf, menuBuf, menuStat, lenStat): | |
if "initDiff" in sdUnitStat: | ||
initDiff = convNum(sdUnitStat["initDiff"], True, 1) | ||
if sdUnitStat["initDiff"] > 0: | ||
initDiff = convColor(initDiff, "RED") | ||
initDiff = convColor(initDiff, "RED", 5) | ||
elif sdUnitStat["initDiff"] < 0: | ||
initDiff = convColor(initDiff, "GREEN") | ||
initDiff = convColor(initDiff, "GREEN", 5) | ||
|
||
if sortStd != "startDiff": | ||
totalerr += abs(sdUnitStat["initDiff"]) | ||
|