Skip to content

Commit 14e63c2

Browse files
committed
Enable non-percent graph for Tasks meter
Before this commit, the Graph of Tasks meter always shows 100%, which conveys no useful information. Signed-off-by: Kang-Che Sung <[email protected]>
1 parent 1a69c54 commit 14e63c2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

TasksMeter.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ static void TasksMeter_updateValues(Meter* this) {
2929
this->values[1] = pl->userlandThreads;
3030
this->values[2] = pl->totalTasks - pl->kernelThreads - pl->userlandThreads;
3131
this->values[3] = MINIMUM(pl->runningTasks, pl->cpuCount);
32-
this->total = pl->totalTasks;
3332

34-
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%d/%d", (int) this->values[3], (int) this->total);
33+
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%d/%d", (int) this->values[3], pl->totalTasks);
3534
}
3635

3736
static void TasksMeter_display(const Object* cast, RichString* out) {
@@ -68,7 +67,7 @@ const MeterClass TasksMeter_class = {
6867
.updateValues = TasksMeter_updateValues,
6968
.defaultMode = TEXT_METERMODE,
7069
.maxItems = 4,
71-
.total = 100.0,
70+
.total = -1.0,
7271
.attributes = TasksMeter_attributes,
7372
.name = "Tasks",
7473
.uiName = "Task counter",

0 commit comments

Comments
 (0)