[rust] Selenium Manager decrease frequency of statistics reporting #13555
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR makes SM decrease the frequency of statistics reporting, as requested and discussed on #13521.
To decrease this frequency, we rely on the value of TTL, one day by default. This way, when the same stats properties are used (i.e., the properties sent to Plausible:
browser
,browser_version
,os
,arch
,lang
, andselenium_version
), the request to Plausible will be done only once. For that, the SM metadata file is used (~/.cache/selenium/sm-metadata.json
). For example, when calling SM for the first time:After that, the metadata file will contain the following:
The field
stats_ttl
is used in the following same calls (in terms of properties) to prevent requesting Plausible again. Only whenstats_ttl
is stale (i.e., in 1 day), the same properties will be sent to Plausible.Note that, as discussed on Slack, the path for the new calls to Plausible is
/sm-usage
. Plausible already has counted my tests:https://plausible.io/manager.selenium.dev
Motivation and Context
This PR implements #13521.
Types of changes
Checklist