Repository navigation
New mechanism for usage data collection - #12381
Conversation
|
I will do some cleanup for this |
Collects usage statistics in development mode via DevModeHandler. Can be opt out with devmode.usageStatistics.enabled configuration parameter.
| // Send usage statistics asynchronously, if enough time has | ||
| // passed | ||
| if (isIntervalElapsed(json)) { | ||
| CompletableFuture.runAsync(() -> { |
There was a problem hiding this comment.
FutureReturnValueIgnored: Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
(at-me in a reply with help or ignore)
|
Is this something that need to be in v22 ? |
|
It's a bit late for 22.0.0 |
|
If you have earlier opted out from stats, you have run We could check this so that stats are disabled if returns |
| // Use default value in case of any problems | ||
| getLogger().debug( | ||
| FAILED_TO_READ + StatisticsConstants.FIELD_LAST_SENT, e); | ||
| private static ObjectNode getProjectData(ObjectNode fullJson, |
There was a problem hiding this comment.
Nit: getOrCreateProjectData would be better so the side effect is easier to understand
| /** | ||
| * Checks if the old npm opt-out mechanism is active. | ||
| */ | ||
| public boolean isOldNpmOptOutUsed() { |
There was a problem hiding this comment.
| public boolean isOldNpmOptOutUsed() { | |
| public boolean isOldNpmStatisticsOptOutUsed() { |
| // Initialize the usage statistics if enabled | ||
| if (config.isUsageStatisticsEnabled()) { | ||
| FrontendTools frontendTools = new FrontendTools(config, new File(baseDir)); | ||
| if (config.isUsageStatisticsEnabled() && !frontendTools.isOldNpmOptOutUsed()) { |
There was a problem hiding this comment.
| if (config.isUsageStatisticsEnabled() && !frontendTools.isOldNpmOptOutUsed()) { | |
| if (config.isUsageStatisticsEnabled() && !frontendTools.isOldNpmStatisticsOptOutUsed()) { |
|
SonarQube analysis reported 22 issues Top 10 issues
|
Collects usage statistics once a day in development mode. Can be opt out with `devmode.usageStatistics.enabled` configuration parameter. Co-authored-by: Pekka Hyvönen <pekka@vaadin.com> Co-authored-by: Artur Signell <artur@vaadin.com>
Collects usage statistics once a day in development mode. Can be opt out with `devmode.usageStatistics.enabled` configuration parameter. Co-authored-by: Pekka Hyvönen <pekka@vaadin.com> Co-authored-by: Artur Signell <artur@vaadin.com> Co-authored-by: Sami Ekblad <sami@vaadin.com> Co-authored-by: Pekka Hyvönen <pekka@vaadin.com> Co-authored-by: Artur Signell <artur@vaadin.com>
|
I'm currently trying v23.alpha1 and I get the following in the JS log from a new starter project: Given URL (https://tools.vaadin.com/usage-stats/submit) returns 400 via browser as well. |




Move client-side component usage statistics collection and data to server-side.