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

Maybe it can be compatible with non-websocket mode? Some CDNs do not allow websocket connections. #117

Open
mzzsfy opened this issue Dec 11, 2023 · 11 comments

Comments

@mzzsfy
Copy link

mzzsfy commented Dec 11, 2023

If you use long polling, you will have the following advantages:
better compatibility
The server does not have multiple sets of time.Tick
Have smaller dependencies

@AlekSi
Copy link
Sponsor

AlekSi commented Dec 21, 2023

Another option is to use server-sent events.

@mzzsfy
Copy link
Author

mzzsfy commented Dec 21, 2023

Another option is to use server-sent events.

good idea,use server-sent events changes much less than long polling

@arl
Copy link
Owner

arl commented Dec 21, 2023

The server does not have multiple sets of time.Tick

Statsviz uses a single timer. How would that change with any other solution?
Unless I'm missing something you will still send stats at a given frequency, and you need a timer for that?

Can't you circumvent CDN restrictions by using a proxy?

Another option is to use server-sent events.

Server side events are a solution but they're one way only iirc, which would work with the current feature set but would prevent potential features we have in mind.

@mzzsfy
Copy link
Author

mzzsfy commented Dec 21, 2023

Statsviz uses a single timer. How would that change with any other solution?
Unless I'm missing something you will still send stats at a given frequency, and you need a timer for that?

When I open multiple pages, the custom indicator is called multiple times per second, which causes errors in some of my statistics. Using other solutions has nothing to do with this. Maybe I should open a separate issue.

Can't you circumvent CDN restrictions by using a proxy?

I don't have that access.

Server side events are a solution but they're one way only iirc, which would work with the current feature set but would prevent potential features we have in mind.

Can you give an example? If the client needs to send data, it can be solved through a new request.

@AlekSi
Copy link
Sponsor

AlekSi commented Dec 21, 2023

If the client needs to send data, it can be solved through a new request.

That's what I think, too.

My main reason for wanting that improvement is to avoid dependency on github.com/gorilla/websocket.

@arl
Copy link
Owner

arl commented Dec 21, 2023

Can you give an example? If the client needs to send data, it can be solved through a new request

I'm thinking if the browser needs to send data to statsviz. For now it doesn't need to but SSE are a one way street (app->browser)

@arl
Copy link
Owner

arl commented Dec 21, 2023

the custom indicator is called multiple times per second

What custom indicator?

@mzzsfy
Copy link
Author

mzzsfy commented Dec 21, 2023

What custom indicator?

userPlots
statsviz.TimeSeries.GetValue is called multiple times per second

@arl
Copy link
Owner

arl commented Dec 21, 2023

What custom indicator?

userPlots statsviz.TimeSeries.GetValue is called multiple times per second

Uhm ok that's not normal. Could you please open an issue for this? And post a simple reproducer if you can?

@mzzsfy
Copy link
Author

mzzsfy commented Dec 21, 2023

userPlots statsviz.TimeSeries.GetValue is called multiple times per second

Uhm ok that's not normal. Could you please open an issue for this? And post a simple reproducer if you can?

Open 2 web pages and you can see the phenomenon .
I'll create a new issue

@mzzsfy
Copy link
Author

mzzsfy commented Dec 21, 2023

#119

mzzsfy added a commit to mzzsfy/statsviz that referenced this issue Jan 5, 2024
mzzsfy added a commit to mzzsfy/statsviz that referenced this issue Jan 5, 2024
mzzsfy added a commit to mzzsfy/statsviz that referenced this issue Jan 6, 2024
mzzsfy added a commit to mzzsfy/statsviz that referenced this issue Jan 6, 2024
delete websocket
done arl#117
done arl#119
done arl#120
mzzsfy added a commit to mzzsfy/statsviz that referenced this issue Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants