What's the expected delay for update propagation in the Google Sheet API? - google-sheets-api

In general, for our usage of the Google Sheet API, the data appears to be eventually consistent-- that is, updates in the UI (Chrome) take some time to be reflected when the sheet is read via the API. In some instances, this delay is roughly half an hour.
I was just wondering if there's an expected or maximum value for this delay or if it's just "best effort".
I've found this question that mentions eventual consistency with the Sheet API, but that's about it.
I'm using version 4 of the Java API to access the data.

According to the Google Docs documentation:
Functions that pull data from outside the spreadsheet recalculate at the following times:
ImportRange: 30 minutes
ImportHtml, ImportFeed, ImportData, ImportXml: 1 hour
GoogleFinance: may be delayed up to 20 minutes
It turns out that the issue reported by the user dealt with roughly a half-hour delay with the ImportRange function.

Related

"Whats new" date restriction on API

I am developing an app with the Active Collab API using the What's New endpoint.
I am retrieving this regularly, so I have the latest information. I was wondering if there was a way to specify the activity by date to get the items since then?
For example, instead of getting 50 records and processing the 50 every time, if I could pass a from parameter (with a timestamp) to only collate activity since that time then that would help with both my processing and the size of the request (and knowing how many things have happened since)
Is this possible?
What's New API end point only has a daily filter:
/whats-new/daily/YYYY-MM-DD
Both global and daily What's new API end-points are paginated, so you can loop through responses by providing (and incrementing) page GET argument:
/whats-new?page=2
until you reach records that are older than the timestamp that you are looking for (or get an empty result). At that point, you just break and you have all the updates that were looking for.

What is the difference between parsing betting website for live scores vs official website API?

I want to monitor some live scores on soccer matches. I have 2 ways to do this:
official api from the website(free)
parse websites source code myself and get data from it( need to do it every second)
What is the difference? Is calling API faster?
This can depend on quite a lot external to this specific scenario, but given the context, yes the API's would much faster. The difference is in what data is being sent/received/parsed.
In either scenario you'd need some timer to tick and parse the results (website or API) so there's no performance difference in the "wait code", but the big difference will be in the data itself that is parsed. When you call the API, chances are more likely that you will send a specific parameter or call a specific function that indicates what you're looking for, pseudo-code example:
SoccerSiteApi.GetValue(SCORE, team1, team2);
Or
SoccerSiteApi.GetCurrentScores(team1, team2);
By calling the API, you are only sending and receiving a few hundred bytes (or more depending on data) and getting back exactly what you want, that is, you don't need to parse the scores out of the values sent back since they are the scores, so no processing time is spent doing anything additional with the data itself.
If, however, you were to parse the entire web site, you would need to make an HTTP GET request (and all that entails) to get the entire page (which could be a couple hundred KB or MB depending on content) and then spend processing time extracting the exact data you were looking for, and then doing this every second.
So the biggest difference is amount of data and time spent processing it.
Hope that can help

How to get daily steps from the Microsoft Band

With Microsoft Band and Windows Phone app I want to get from the MSBand the steps taken in the current day. Today, when I subscribe to the pedometer, the totalsteps attribute returns the steps taken overall. For example, my MSBand is returning 1M 444K steps. Does anyone knows how to get only the total daily steps?
The Band SDK does not expose the number of steps (by its internal count) taken by the wearer in the current day. The closest approximation to your goal would be to register a time-triggered background task that retrieves a pedometer sensor reading every n-number of minutes/hours and then calculates the number of steps taken on the current day based on a delta between successive readings. Obviously this implies a certain margin of error, based on how often (and when) that background task executes.
(On Windows Phone (8.1), for example, a background task can execute at most every ~30 minutes and isn't necessarily aligned to any given minute of the hour, which means steps could be attributed to one day or the next based on which side of the "midnight" hour the task happens to run.)
If you are accessing microsoft health cloud API. You can get the step counts(Per day) from the Summary URL Cloud API. refer my post https://stackoverflow.com/questions/32221481/android-get-active-minutes-for-the-step-counts-in-microsoft-band Else if you want it from the band SDK alone, Its good to go with Phil's above suggestion. Hope this may help who use health cloud API.

Why isn't an update reflected right away when posting changes to a Rally story via the REST API?

I've noticed when retrieving a story/defect after first updating it, sometimes the retrieve response returns the field values as if the update never happened. Retrying the retrieve after a short delay (~500ms) returns the updated field values as expected. Is this a known behaviour? Is there any way of avoiding this?
I'm using the Rally API 2.0 - https://rally1.rallydev.com/slm/webservice/v2.0/
The update is being performed using this URI:
POST /slm/webservice/v2.0/Defect/14173461229?key=<key> HTTP/1.1
I'm retrieving the story after update as follows:
GET /slm/webservice/v2.0/artifact?query=(ObjectId%20=%2014173461229)&start=1&pagesize=20&fetch=true HTTP/1.1
What is your integration doing that it needs to re-poll the artifact within < 1 second of POST'ing an update? Is there a second process that does polling that is revealing the latency for the updates? Does your integration run multiple threads? Does the response time vary at all depending on time of day, etc.? There are any number of factors that could be at play here, but 500 ms doesn't seem like an un-reasonable refresh rate given factors such as latency over HTTP/S as well as server-side database and cache updates. That said, for an in-depth look you may wish to inquire with Rally Support (rallysupport#rallydev.com) as they have tools that can help evaluate server-side response time corresponding to requests by specific UserID.

FaceBook Graph API

When I use FaceBook API for retrieving posts information, I found that the returned information are changing all the time.
for e.g., when I retrieved information 2 times with 1mins interval, one record appears in the 1st time, and disapeared in the 2nd time.
https://graph.facebook.com/search?q=baby&type=post&limit=100&since=2010-05-19&until=2010-05-21
Does anyone know what happen?
Cheers,
LingChen
Searches of large datasets are (in general) nondeterministic.