feat(#10438): add telemetry for visible task count on recalculation#10755
Conversation
dianabarsan
left a comment
There was a problem hiding this comment.
Great work! One small comment about naming.
| ...this.getTaskLineage(subjects, task) | ||
| })); | ||
| this.tasksActions.setTasksList(tasksWithLineage); | ||
| this.telemetryService.record('tasks:visible-count', tasksWithLineage.length); |
There was a problem hiding this comment.
I think that using visible is too bespoke here. Please just use tasks:all-tasks, because it matches with other telemetry entries that we have: https://docs.communityhealthtoolkit.org/technical-overview/data/performance/telemetry/
There was a problem hiding this comment.
Hi @dianabarsan, thank you for the feedback!
I have updated the telemetry key from tasks:visible-count to tasks:all-tasks to match the existing naming conventions.
dianabarsan
left a comment
There was a problem hiding this comment.
Beautiful!
I will have to ask for a followup PR to cht-docs telemetry to document the new entry.
|
Thanks @dianabarsan! I’ll create a follow-up PR in cht-docs to document the new telemetry entry. |
|
Hello @dianabarsan |
Description
Fixes #10438
Docs PR:medic/cht-docs#2171
Each time tasks are recalculated in
tasks.component.ts, there was no way to know how many tasks are visible to auser without querying the server directly.
This PR adds a telemetry entry
tasks:visible-countthat records the number of visible tasks each timerefreshTasks()is called — covering both initial load and subsequent recalculations triggered by changes or rules engine updates.
Changes Made
TelemetryServiceintoTasksComponenttelemetryService.record('tasks:visible-count', tasksWithLineage.length)after tasks are recalculatedthe correct key and count
Code review checklist
implementation approach and test structure