Closed miyconst closed 9 years ago
Thanks for the question. What kind of statistics would you like to have there? Summary, or individual for each?
@alemoi this is not a question, this is a task for myself. I created it after discussion with @warpech.
In puppet.js there is only one active socket connection per page, correct me if I am wrong. The connection has its state, it may be closed or opened, these state change events should also be visible on the Network tab.
@alemoi this is a frontend task about the new "Network" tab in starcounter-debug-aid. You can see it in Launcher since today:
@warpech the bug with empty patch type for virtual url is already fixed.
@miyconst, @warpech, could you take a look at https://github.com/PuppetJs/PuppetJs/commit/f885771759fc4ee614d41d7390141f4811eadf00#commitcomment-10604329?
@tomalec I agree with your suggestion to remove JSON.stringify.
I made it to follow the structure of the events we already have. The event occurs about 1-2 times after page load, so it won't take much resources.
Anyway, if you think it is better to pass a single status code, I could rework it.
I think, we can pass that._ws.readyState
, event.data
, upgradeURL
. Other callback sends ( patches, url )
so we will not send exactly same parameters anyway. I would like to minimize overhead of events itself, as we need them only in debug mode, and we will not use them on production.
After we will implement feature to re-opening connection ,and reconfiguration, onopen
and onclose
may occur more often. Even now we would like to decrease time to first load to minimum, as every other part of UI waits for puppet to get the initial data.
Okay then. I open the issue again and fix the event.
WebSoket upgrades, open/close connection should also be visible on the Network tab.