Skip to content

Commit

Permalink
Enable non-percent graph for Tasks meter
Browse files Browse the repository at this point in the history
Before this commit, the Graph of Tasks meter always shows 100%, which
conveys no useful information.

Signed-off-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 committed Aug 3, 2021
1 parent d317f71 commit 0760ab7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions TasksMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ static void TasksMeter_updateValues(Meter* this) {
this->values[1] = pl->userlandThreads;
this->values[2] = pl->totalTasks - pl->kernelThreads - pl->userlandThreads;
this->values[3] = MINIMUM(pl->runningTasks, pl->cpuCount);
this->total = pl->totalTasks;

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

static void TasksMeter_display(const Object* cast, RichString* out) {
Expand Down Expand Up @@ -68,7 +67,7 @@ const MeterClass TasksMeter_class = {
.updateValues = TasksMeter_updateValues,
.defaultMode = TEXT_METERMODE,
.maxItems = 4,
.total = 100.0,
.total = -1.0,
.attributes = TasksMeter_attributes,
.name = "Tasks",
.uiName = "Task counter",
Expand Down

0 comments on commit 0760ab7

Please sign in to comment.