cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

How can you get the exact latency in ms between sending data from a device until it gets displayed in the Mashup?

frocheteau
1-Visitor

How can you get the exact latency in ms between sending data from a device until it gets displayed in the Mashup?

Hello Community,

I have a Raspberry Pi with whom I send data to the Thingworx cloud, in which I have a mashup which displays the data.

What I need to know is the exact latency between sending the data and displaying the data in the mashup.

I thought maybe I can display the time in MS when  I send the data on my device, and display the time when the mashup displays the time in Thingworx.

However I don't manage to display the exact time in MS inThingworx.

The Overall Aim is to determin the cost in Terms of latency depend on what security we install.

Doe someone have an idea?

BR

Fabien Rocheteau

4 REPLIES 4
supandey
19-Tanzanite
(To:frocheteau)

Hi Fabien, are you connecting RaspberryPi via an EDGE SDK to ThingWorx?

Iam using the Python Library http.client to get the Connection.

I used JSON to get the correct data on the payload.

Hi Fabien,

But this depends on too many factors:

  1. Network latency between Edge and Cloud ( which if it's public internet, can be totally random )
  2. Network latency between Cloud and Browser PC ( which for sure it's public internet, will be totally random )
  3. TW Cloud Instance load ( depending on the load you can get different throughput )
  4. Browser PC Performance ( on rendering the mashup )
  5. Perfect Time Sync between Edge and Browser PC, otherwise you won't be able to calculate exactly the latency

Anyway, if you want to have an aproximate, just send from Edge the exact time, and when you receive the data ( Push Mashup ) on the mashup with an expression widget just substract the received data from new Date().getTime().

I agree that time-sync will be quite challenging because otherwise, you have no clear reference. Anyhow, if you just need to measure the difference between different security settings this could work also with some milli seconds difference between server and edge.

I would generate a timestamp on the edge and transfer this to the server. On the server site, you can create a service (data change) using a specific user credential to read the value and calculate the difference between now() and the time in the timestamp. The difference you add continuously into an info table.

In this scenario, you missed the rendering of the browser and the transfer back to e.g. chrome. But you make things much easier and able to automate. I assume that credential and security impact (if noticeable) can be evaluated with this method, too.

Announcements


Top Tags