Skip to content

More efficient heart beat timer #15049

@tsteur

Description

@tsteur

Currently the heart beat timer is pinging the site every 15s if enabled.

Since we're now using sendBeacon and can quite ensure a request will make it through onPageUnload, we don't really need to ping every 15 seconds. I reckon it's fine to only ping

  • onWindowBlur
  • every 15 minutes (since a visit is usually active for say 30 minutes anyway)
  • stop pinging after maybe 1 hour? or earlier? I think heart beat is not keeping the visit alive anyway so we should stop after 30 minutes from page view start by default (or whatever is configured as visit length).
  • When tab / window closes (if the window was not focussed before (a blur happened) we would maybe only send the ping event if the window had focus after a blur for at least 10 seconds... and only if the tab is being closed within the visit length of eg 30 minutes)

This will significantly reduce the footprint of this feature and would possibly allow us to enable this feature by default in #8225

Metadata

Metadata

Assignees

Labels

MajorIndicates the severity or impact or benefit of an issue is much higher than normal but not critical.c: PerformanceFor when we could improve the performance / speed of Matomo.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions