Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect server statistics only on server #6724

Open
4 tasks
mshabarov opened this issue Aug 30, 2024 · 0 comments
Open
4 tasks

Collect server statistics only on server #6724

mshabarov opened this issue Aug 30, 2024 · 0 comments
Assignees

Comments

@mshabarov
Copy link
Contributor

mshabarov commented Aug 30, 2024

Describe your motivation

Follows up the #6720.

As the diagram below shows, the UsageStatistics API sends the stats data to browser, then browser sends it back to server. This looks like a redundant loop that can be avoided: UsageStatistics should cache the stats in-memory and then persist to the JSON file directly (showed on diagram as a blue arrow).

image

Acceptance Criteria

  • BootstrapHandle doesn't send any JavaScript to update window.Vaadin.registrations in browser, this code can be just removed.
    - [ ] (?) To be confirmed by @mshabarov :vaadin-dev-tools.ts doesn't read the stats from Local Storage and doesn't send anything to server, as vaadin-usage-statistics.js also read the date and sends it to V1 of the stats endpoint of stats server. Should we still send it to server, as server sends it to V2 endpoint.
  • vaadin-dev-tools.ts should send stats from browser to server as usual, because we aim to use V2 stats endpoint that is in turn used by server nowadays.
  • UsageStatistics writes stats to the JSON file directly at the end of page load and on shutdown. On shutdown is better as some of the records may appear after page load.
  • web-components should continue reporting their stats as usual.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

Vaadin 24.4 and 24.5.

mcollovati added a commit to vaadin/flow that referenced this issue Sep 9, 2024
Server side statistics are not sent to the browser anymore
but directly registered when dev-tools websocket connection
is opened and closed.

Fixes vaadin/platform#6724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔎Iteration reviews
Development

Successfully merging a pull request may close this issue.

2 participants