Skip to content

More time reported than actual usage #626

@ErikBjare

Description

@ErikBjare
  • I am on the latest ActivityWatch version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • OS name and version: Arch Linux

  • ActivityWatch version: v0.11.0 (rust) and master (aw-server-python)

Describe the bug

Incorrect time reported by aw-server (long stretch of AFK time was incorrectly included).

I exported the buckets and imported into aw-server-rust, which reported the correct time.

I'm assuming this is originally an issue with negative gaps arising from the heartbeat, the resulting events of which are not handled correctly in aw-server-python during flooding.

To Reproduce

Not yet sure how to reproduce.

Expected behavior

Time would be correctly reported.

Documentation

Note how aw-server-python spams a lot more than aw-server-rust.

aw-server-python logs from a standard Activity query:

2021-07-01 14:09:23 [WARNING]: Gap was negative but could be safely merged (-13697.784s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:23 [WARNING]: Gap was negative and could NOT be safely merged (-3299.374s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:23 [WARNING]: Gap was negative and could NOT be safely merged (-17430.965s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:23 [WARNING]: Gap was negative and could NOT be safely merged (-17434.787s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:23 [WARNING]: Gap was negative but could be safely merged (-90.99s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-15404.006s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative but could be safely merged (-10525.176769s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-17700.514s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative but could be safely merged (-185.146656s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-22499.96s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-46264.473s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-43804.859s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative but could be safely merged (-225.186657s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-9531.942s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative but could be safely merged (-185.137312s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-15422.322s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative but could be safely merged (-3327.664003s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative but could be safely merged (-11550.794s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-10684.987s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-18918.895s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative but could be safely merged (-185.136619s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative but could be safely merged (-23840.324s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative but could be safely merged (-811.350929s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-45969.923s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-27116.948s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-18499.34s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:24 [WARNING]: Gap was negative and could NOT be safely merged (-17430.965s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:26 [WARNING]: Gap was negative but could be safely merged (-3310.693s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:26 [WARNING]: Gap was negative but could be safely merged (-456.917s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:27 [WARNING]: Gap was negative but could be safely merged (-119.197s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:27 [WARNING]: Gap was negative and could NOT be safely merged (-111.03s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:27 [WARNING]: Gap was negative and could NOT be safely merged (-53.098s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:28 [WARNING]: Gap was negative and could NOT be safely merged (-106.023s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:28 [WARNING]: Gap was negative and could NOT be safely merged (-3014.439s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:28 [WARNING]: Gap was negative and could NOT be safely merged (-60.729s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:29 [WARNING]: Gap was negative and could NOT be safely merged (-62.047s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:29 [WARNING]: Gap was negative and could NOT be safely merged (-11.861s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:29 [WARNING]: Gap was negative and could NOT be safely merged (-3428.054s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:29 [WARNING]: Gap was negative and could NOT be safely merged (-12.883s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:30 [WARNING]: Gap was negative and could NOT be safely merged (-18.88s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:30 [WARNING]: Gap was negative and could NOT be safely merged (-16.828s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:30 [WARNING]: Gap was negative and could NOT be safely merged (-33.148s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:30 [WARNING]: Gap was negative and could NOT be safely merged (-32.249s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:30 [WARNING]: Gap was negative but could be safely merged (-90.99s). Will only warn once per batch.  (aw_transform.flood:116)
2021-07-01 14:09:31 [WARNING]: Gap was negative and could NOT be safely merged (-2.169s). Will only warn once per batch.  (aw_transform.flood:126)
2021-07-01 14:09:31 [WARNING]: Gap was negative and could NOT be safely merged (-3.65s). Will only warn once per batch.  (aw_transform.flood:126)

aw-server-rust logs from a standard Activity query:

[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT0.029Ss) and could NOT be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT17700.514Ss), but could be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT5750.916Ss), but could be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT0.093Ss) and could NOT be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT0.001Ss), but could be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT6150.373Ss) and could NOT be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT1954.677Ss), but could be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT0.001Ss) and could NOT be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT0.001Ss) and could NOT be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT3919.230Ss), but could be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT865.807Ss), but could be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT15761.708Ss), but could be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT10363.291Ss), but could be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT0.001Ss) and could NOT be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT1874.841Ss), but could be safely merged. This error will only show once per batch.
[2021-07-01 14:05:37][WARN][aw_transform::flood]: Gap was of negative duration (-PT0.001Ss) and could NOT be safely merged. This error will only show once per batch.

Screenshots

aw-server-python, with bad data:

image

aw-server-python, with bad data and no AFK filtering:

image

aw-server-rust, with bad data (imported from aw-server-python):

image

I also tried importing data from testing buckets into the prod instance (after renaming the buckets their hostnames), but did not find any issue there.

Additional context

Something similar has probably been reported before, I'm noting this instance in particular as I have data for it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions