Roundtrip timer ("ping"?) between browser and server?

I have a Vaadin 14 app hosted in Sydney for an Australian customer. All OK. They are trialing a user in the Philippines, however there seems to be massive problems with performance. All they see is my product being bad, but I’m sure the new user is having connection issues.

Is this a legitimate measure of roundtrip between browser and server?

final long REQUESTED_AT = System.currentTimeMillis();
UI.getCurrent().getElement().executeJs(“return ‘ping’;”)
.then(String.class, pong → {
if (“ping”.equals(pong)) {
long ping = System.currentTimeMillis() - REQUESTED_AT;
// record the ping

If this is not a good measure … is there a way to measure this?

I’m a classic “Java Swing > Vaadin” guy so my Javascript is pretty weak.

Any suggestions appreciated.

Thx. Damian.

Sounds pretty much right. I wonder what kind of network they have there if it is slow :man_shrugging:, not “that far” geographically.

You could try @Push(transport = Transport.WEBSOCKET). In case there is long latency in the network and e.g. some proxy shuts dow the connection, that may have a noticeable difference.

For more heavy-duty analysis, there are many kinds of performance monitoring tooling, and Vaadin’s Observability Kit plugs into some of those to give you more data

You’d need to upgrade to a newer version than Vaadin 14 to take advantage of that, though

Thx Olli. Def need to move past V14 :slightly_smiling_face: Backend is currently tied to Java8, and I’ve been adding a whole Microstream serialization layer (33 handler classes & 400+ methods) to separate Vaadin so it can move past J8/V14. 70+ TemplateRenderers to translate too. The architecture “seemed like a good idea at the time” to reskin a Swing product.

Thx Matti. I’m sure it is not generic a Australia-Philippines issue, just a specific issue for this user. I did get them to do a ping test and it was 200+ msecs, but I strongly suspect that was the best they got. Other users were not getting this issue. I am kept at arms length from end users (good for me:-), so users only see it as a product issue. I just am looking for a programmatic way to objectively test ping & network performance in general. I am very interested to try @Push(transport = Transport.WEBSOCKET). So that may help with less robust / laggy connections? Are there down sides? Thx.

With 200-300 you should still get quite decent UX for most UIs, unless you are making some first person shooter games. The issue for this user is probably somewhere else. Is that screenshot of his UI? Looks like push is already on, but connection dropped. Maybe there is some ancient proxy that is not handling the connection properly :man_shrugging:

Pure websocket push might have some issues with certain security configurations and then there may be certain proxies that cause issues.