# How to interpret telemetry for household tasks (task groups)

**URL:** <https://forum.communityhealthtoolkit.org/t/how-to-interpret-telemetry-for-household-tasks-task-groups/2777>\
**Category:** Development\
**Tags:** tasks, data, telemetry\
**Created:** [May 24, 2023, 7:49pm UTC](https://forum.communityhealthtoolkit.org/t/how-to-interpret-telemetry-for-household-tasks-task-groups/2777 "2023-05-24T19:49:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/michael/32/319_2.png) [@michael](https://forum.communityhealthtoolkit.org/u/michael)\
**Post date:** [May 24, 2023, 7:49pm UTC](https://forum.communityhealthtoolkit.org/t/how-to-interpret-telemetry-for-household-tasks-task-groups/2777/1 "2023-05-24T19:49:11Z")

</div>

I’m trying to interpret [telemetry](https://docs.communityhealthtoolkit.org/apps/guides/performance/telemetry/) data for [household tasks](https://docs.communityhealthtoolkit.org/apps/features/tasks/#household-tasks) ([#5886](https://github.com/medic/cht-core/issues/5886#issuecomment-915044287)) and I want to make sure I am understanding the data correctly. The telemetry documentation states that each metric includes “performance” data such as `min`, `max` and `sum` _represented as time in milliseconds_ as well as a `count`, which _represents the number of times the metric was recorded_. However, for some metrics I don’t think this is what it represents.

# _Metric →_ `tasks:group:ready`

* * *

_Definition_ → _Number of tasks in “Ready” state for the household, when displaying household tasks page._

### Example data

_This is recorded per user per day. Here are a few example entries I’m seeing, 4 different users on the same day._

| user | metric | min | max | sum | count |
| --- | --- | --- | --- | --- | --- |
| user\_1 | tasks:group:ready | 0 | 1 | 1 | 4 |
| user\_2 | tasks:group:ready | 0 | 6 | 121 | 52 |
| user\_3 | tasks:group:ready | 0 | 2 | 8 | 15 |
| user\_4 | tasks:group:ready | 0 | 0 | 0 | 1 |

### Interpretation (Data)

_For the **DAY** that `tasks:group:ready` telemetry was recorded…_

| Property | What it represents (I think) |
| --- | --- |
| min | The fewest number of tasks shown _(out of all times the HH tasks page was shown)_ |
| max | The maximum number of tasks shown _(out of all times the HH tasks page was shown)_ |
| sum | The sum total number of tasks shown _(out of all times the HH tasks page was shown)_ |
| count | The number of times the HH tasks page was shown |

### Interpretation (Narrative)

Using the sample data provided above, `user_3` saw the HH tasks page `15` times. The maximum number of tasks they saw on the HH tasks page at any one time was `2`. The total number of tasks shown on the HH tasks page across all times they saw the HH tasks page was `8`.

It seems strange that we would see a `min = 0` (and a `sum < count`), I would have hoped we wouldn’t show the HH tasks page if there are no other tasks to show… **or is it actually incrementing `count` even when the CHT determines that the HH tasks screen _does not need to be shown_?**

---

<div class="post-metadata">

**Author:** ![kenn](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/kenn/32/55_2.png) [@kenn](https://forum.communityhealthtoolkit.org/u/kenn)\
**Post date:** [May 25, 2023, 5:06am UTC](https://forum.communityhealthtoolkit.org/t/how-to-interpret-telemetry-for-household-tasks-task-groups/2777/2 "2023-05-25T05:06:26Z")

</div>

Just from a quick code inspection, I suspect you’ve found a new measurement issue.

We record `this.telemetryService.record('tasks:group:ready', this.tasks.length);` but `this.tasks` isn’t assigned a value until [after it is measured](https://github.com/medic/cht-core/blob/master/webapp/src/ts/modules/tasks/tasks-group.component.ts#L189).

If this theory is correct, you can’t trust this data. An example of how it is wrong is that, it will measure `0` for all users the first time the experience is shown no matter how many tasks are visible. That aligns with the data you shared, and explains the min=0 for all users.

@michael Do you “know how”/“are willing” to test this to confirm the theory? Get the household tasks experience to trigger, view the user’s telemetry data, see if the value reflects the number of tasks you saw?

---

<div class="post-metadata">

**Author:** ![michael](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/michael/32/319_2.png) [@michael](https://forum.communityhealthtoolkit.org/u/michael)\
**Post date:** [May 26, 2023, 2:19pm UTC](https://forum.communityhealthtoolkit.org/t/how-to-interpret-telemetry-for-household-tasks-task-groups/2777/3 "2023-05-26T14:19:18Z")

</div>

Thanks @kenn . I ran a test yesterday and looked at the telemetry data today. Here’s what I found…

**Scenario**

1. There were 3 tasks for Jennifer Mbae’s _ **household** _ (1 for her and 2 for her children)
2. I tapped on and completed the task for Jennifer Mbae
3. The “Other household tasks” screen showed up
4. When the screen first rendered, there were only 2 tasks (for Peter and Mary)
5. After a second or two, the task for Jennifer showed up, so there are 3 tasks on this screen
6. _The task for Jennifer was generated as a result of the original task I just completed_

**Observations**

Interestingly, `tasks:group:ready` → `min` did _not_ `=0`, but it also didn’t include the newly generated (3rd) task that showed up after a few moments. It’s a tough call, but I think I’m OK with it not including the newly generated task because I imagine it is unlikely CHWs would want to complete a task that was a result of another task they just completed 5 seconds ago (though there may be some cases where they do).

_Is there something else you think I should try that might recreate `min = 0` ?_

 ![Screenshot 2023-05-26 at 9.49.34 AM](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/5/5059b32ad3178e99f099111b38cd2a588e658804.jpeg)

---

<div class="post-metadata">

**Author:** ![michael](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/michael/32/319_2.png) [@michael](https://forum.communityhealthtoolkit.org/u/michael)\
**Post date:** [May 26, 2023, 4:39pm UTC](https://forum.communityhealthtoolkit.org/t/how-to-interpret-telemetry-for-household-tasks-task-groups/2777/4 "2023-05-26T16:39:26Z")

</div>

Looking at the data some more (see example below)… there are many entries for `tasks:group:ready` where the `count` is non-zero but all other entries are 0, so it must be incrementing the `count` even when the household tasks screen is **not** shown. The reason I don’t think the screen is being shown is that for the example below, there were no entries for `tasks:group:modal:confirm` or `tasks:group:modal:reject` _(when you try to navigate away from the household tasks screen it will pop up a confirmation modal)._

So I guess we can know how many times the household tasks screen was shown and then cancelled (using the `tasks:group:modal:confirm` property), but I don’t think I can know how many times it was shown, and we can’t know how many times it was shown and a task from it was completed directly from there. _(By looking at submitted reports I can tell if other tasks were completed for that household around the same time, but I don’t think there’s a way to know if it was directly from the HH task screen - something like [this might help](https://forum.communityhealthtoolkit.org/t/what-do-the-various-source-types-represent-on-reports/492/7))._

| period\_start | metric | min | max | sum | count | sumsqr |
| --- | --- | --- | --- | --- | --- | --- |
| 2023-02-24 | tasks:group:all-tasks | 0 | 3 | 12 | 9 | 28 |
| 2023-02-24 | tasks:group:ready | 0 | 0 | 0 | 9 | 0 |
