How to get the latency between two peers in a real time?

Title says it, how to do that in cli? and preferably to get the latency updated every second or so?

Doing

zerotier-cli peers

Will list latency but for all peers, not the current one

and

zerotier-cli info -j

Doesn’t show any latency.
And how to measure the latency between two peers?

zerotier-cli peers
Will list latency but for all peers, not the current one

I’m not sure what you mean by this. The only way to get latency is relative to another peer since ZeroTier is peer to peer. So zerotier-cli peers is how you would get the latency between yourself & another peer. Or you could just ping over the zerotier network.

Yes I’m aware of the peer latency hence asking of getting the latency of the connected peer (like from my machine to it).
I’m building an app to show the latency in a realtime of zt and displays it, but it seems there’s no direct way from the cli? is there a way to display it in the json format in

zerotier-cli info -j

I’m seeing a unix timestamp but not sure if that any useful.

zerotier-cli peers -j will output a JSON blob with latency information for each peer. It doesn’t update each second because doing so would require too much overhead traffic.

In order to get value updated each second you’d need to ping like Grant suggested.

Oh sweet, I didn’t know this command zerotier-cli peers -j, thanks.

In order to get value updated each second you’d need to ping like Grant suggested.

You mean with zerotier-cli peers or just the usual ping?
And correct me if I’m wrong, there’s no centralized way to manage or display that I assume like how you authenticate/add/etc clients (like from my.zerotier)?

The data provided by peers -j is only updated every several seconds at best, no matter how often you call it. In order to get more up to date latency information you should just ping the other peer yourself at whatever interval you want and collect the data directly from the ping command, not ZT.

Also: Sometimes ZT reports -1 as a latency when it should be reporting a positive number. This is something that we need to fix and that you should be aware of before building a dashboard based on it. Using the results of ping won’t have this issue.

I got it, thanks for the info especially the peers -j, saved me the time before using it as the basis in (ms) as well as the -1.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.