Calculating the amount of data (bytes) a user using - mysql

We are a subscription based platform that charges per data used. How do we calculate the total amount of data used by 'get' and 'post' requests by a user? Also, how can we calculate the HTTP request size?
As we are using AWS does AWS have some mechanism or service to calculate our user data usage for us?

Related

how to get bandwith consumption in yii2 per request

How can I get the bandwidth consumption of user per request in yii2?
I tried afteraction and beforeaction in \yii\web\Controller but I don't get it.

Viber REST API[GATEWAY_TIMEOUT]

I am making REST API call to Viber back-end but intermittently I am getting 504 GATEWAY_TIMEOUT error.
Are there any limitations when we send multiple requests to Viber back-end at the same time?
Yes, they have limitations. See Broadcast Message section.
Maximum total JSON size of the request is 30kb. The maximum list
length is 300 receivers. The Broadcast API is used to send messages to
multiple recipients with a rate limit of 500 requests in a 10 seconds
window.

how i can increase URLFetch data received size per day

is that possible to increase URLFetch data received size per day form external URL data received? my quota limits dashboard shows 0mB / day.

Refreshing Box API token from multiple servers

We are planning on migrating our Box v1 integration to v2.
Our integration implementation includes API calls accessing user box account and files from different servers at the same time.
With v2, and the introduction of refresh token, we would like to know whether multiple refresh token requests can be made concurrently from multiple servers over the same user account.
Moreover, and as a consequence of multiple refresh calls, we would also like to know whether it is possible to have more than one access key per user at any given time.
Thanks for the help
Assaf
We recommend that you use some sort of coordination between your servers to manage auth tokens and refresh tokens. While a user can have multiple access tokens for the same service, they will have to authenticate multiple times in order to get them. You can't mint extra auth tokens off a single auth-token/refresh-token pair.
Here's what we recommend.
Create a pair of encrypted columns in your database to store the auth token, the refresh token, a datetime for "token_expires", and a flag for "token_refresh_in_progress". Identify it by userID.
Write your code so that when you are about to make a call, if you are close (say, within a minute) of the token-expires datetime, instead of making your call, you check to see if the refresh-flag has been set, or if there's already a new token pair. If the flag hasn't been by some other server in the cluster, set the flag that you are doing the refresh. Make the refresh-grant call, and update the database with the new pair, and of course reset the flag.

JSON response data size issue

I am using Discover the Google Analytics platform to generate queries in order to make callouts to GA from inside a SalesForce application. Upon creating the custom the report an API Query URI is generated which presents the data from the report in a JSON format.
One example uri looks like the following:
https://www.googleapis.com/analytics/v3/data/ga?ids=[my gi id] &start-date=[start date]&end-date=[end date[&metrics=ga%3Asessions%2Cga%3AsessionDuration&dimensions=ga%3AdaysSinceLastSession%2Cga%3Acampaign%2Cga%3AsourceMedium%2Cga%3AsocialNetwork%2Cga%3Adimension2&filters=ga%3AsessionDuration%3E1&access_token=[my access token]
The issue is that the presented data is limited to 1000 rows max, and I am not sure how can I surpass this size view limit.
The google analytics API has a field you can send called max-results if you add
&max-results=10000
to your request you will get paging of 10000 rows. That is the max you can set it to if there are more results a nextlink will be returned with the results that you can use to make more requests to get the additional data.