@Dino @Anil Sagar @ Google @Siddharth Barahalikar
There are some APIS which has huge traffic
let this api named "abc" has records more than 20000.But if exclude limit=14400 in the request then i got just only 1000 records.
https://{host}/v1/organizations/{xyz}/environments/{abc}/stats/apiproxy?select=sum(message_count)&timeRange=01/16/2019%2000:00~2/01/2019%2000:00&timeUnit=month&filter=(apiproxy%20eq%20'abc')
and then i have added limit=14400 in this request as shown below
https://{host}/v1/organizations/{xyz}/environments/{abc}/stats/apiproxy?select=sum(message_count)&timeRange=01/16/2019%2000:00~2/01/2019%2000:00&timeUnit=month&filter=(apiproxy%20eq%20'abc')&limit=14400
now i could able to get 14400 records ..but it has more than 14400 records and lost some data
I programmed this entire functionality in java program.
can anyone please assist me on how to retrieve full records????.
Thanks in advance..
Yes, two ideas for you:
- use larger time units . If you use "month" as a time unit you will get 1 record per month. If you use hour, you will get 24 per day. If you use minute you will get 1440 records for each day in your time interval. Using a larger time unit will give you fewer records.
- break up the query into multiple queries with adjacent timespans. If you want 2 weeks of data and you want to query by minute, that is 14 days * 1440 records/day = 20160 records, which is over the limit enforced by the stats API of 14400 records. So... query for each week separately, retrieving 10080 records for each query.
--break up the query into multiple queries with adjacent timespans.