Notes on Data Latency for Embeds

When opening an embedded Periscope dashboard, we check the most recent refresh timestamp for the given filter set, and if this is less than the specified “data_ts” parameter, then we will refresh the embedded dashboard at the time of opening. Specifically, this parameter determines whether or not the embedded version is considered "stale" relative to the time you're comparing against, and should help it update accordingly.

Our documentation page below covers what this would look like as a parameter under the "Data Latency" section:

https://doc.periscopedata.com/article/embed-api-options#content

Since the data_ts parameter is compared against the "last_refreshed" time of the embedded version, it's important to ensure that the data_ts parameter is dynamic so that it will continue to refresh the dashboard.

Additionally, the parameter should be older than the current timestamp. So, a good recommendation is to make the variable dynamic by setting it to be between 5 or 10 minutes back from the current timestamp.

You will need to convert the current timestamp to epoch. This can be done dynamically in your programming language of choice, for example, in Ruby, it would look like this:

Time.now.getlocal('-07:00').to_i - (5 * 60)

The above code generates an epoch of 5 minutes prior to the current time. Which will be passed through as the data_ts parameter in the JSON blob.

 

We would love to see how you would write this in your native programming language in the comments below!

 

Additionally, when setting the data_ts parameter, it is important to confirm two factors:

  1. The precision of the returned epoch timestamp is in seconds and not milliseconds.

  2. Your current time function is in UTC

As an example to help surface the data_ts parameter, I created a shared dashboard of my own using the following JSON:

{
"dashboard": 266951,
"embed": "v2",
"data_ts": 1527023391
}

Creates the following URL:

app.periscopedata. com/shared/3ab1e426-7d74-4f5d-baa3-2eafc0e96453?data_ts=1527023391&embed=v2

In the URL, you can see the data_ts parameter that was used to generate the report:

data_ts=1527023391

The parameter was hard-coded in this case as opposed to having a dynamic function to return X minutes before the current timestamp. If you update the URL to use a fresher data_ts parameter, then the chart itself does update to show the current timestamp (in PST).

The data_ts parameter is only applicable to embedded dashboards. To control refresh rates for internal Periscope dashboards or shared dashboards, please see our doc page below.

https://doc.periscopedata.com/article/dashboard-refresh#article-title

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
reply to topic
Like4 Follow
  • 4 Likes
  • 4 wk agoLast active
  • 230Views
  • 1 Following