erlanglab / erlangpl

Tool for developers working with systems running on the Erlang VM (BEAM). It helps with performance analysis.
http://www.erlang.pl/
Apache License 2.0
549 stars 40 forks source link

Cache state in localStorage #65

Open baransu opened 7 years ago

baransu commented 7 years ago

When we're for some reason reloading page, we lose all state and in the worst case we have to wait 5s for the new state from the server. My idea is to cache state in localStorage and when we're reloading page it will be loaded from cache. If observed node crashes and we're reloading page to reconnect we don't want to display old, cached state so we have to wipe it on WebSocket connection crash. It's a small change but can be nice quality of life improvement.

arkgil commented 7 years ago

I like the idea of improving our UX 👍 The crucial part here is to make sure old data is cleaned up.

michalslaski commented 7 years ago

If I don't have any browser tabs open, then I restart ./erlangpl script and then again open the browser, the local cache is not cleaned up. The only way to clean it up is to have a tab opened, so that it can discover the WebSocket connection crash. This may be confusing.

baransu commented 7 years ago

We're storing start timestamp in ets and then sending it to client on new connection so client should clean when connection crashes or ./erlangpl was restarted.

baransu commented 6 years ago

I've disabled caching for now: https://github.com/erlanglab/erlangpl/commit/476688bdec5b0dc14d0d970e2e63fb6ce33a0490 so it' no longer blocking release.

This issue is still relevant and definitely needs better solution. Unfortunately I don't have time to focus more on Erlang Perf Lab right now, but I hope I'll find more time in the future to work on parts that needs improvement to make it better software :)