简体   繁体   中英

Is it possible to retrieve the server response time for a URL using the Google PageSpeed Insights API?

I am looking to retrieve the actual server response time for a URL as reported by Google PageSpeed Insights by using the API.

This can be seen when the rule is broken in the GPSI GUI. For example, see the following screen capture:

在此处输入图片说明

In this case it is 0.89 seconds.

I have looked at their API documentation but so far have not found anything pertaining to this. However this seems incomplete since it is available in the GUI, so I'm hoping I am just missing something.

According to PageSpeed documentation for server response time measurements Reduce Server response time

Server response time measures how long it takes to load the necessary HTML to begin rendering the page from your server, subtracting out the network latency between Google and your server

This means, it measures latency(which depends upon your bandwidth) between your server and machine on which you are running GPSI. It subtracts the latency from (total response time - rendering time) and if it is more than 200ms then it indicates as high server response time.

Though its not a accurate measure but collecting it multiple times and average of those values can be considered with pinch of salt.

Coming to your question, GPSI is a client side utility. To get actual application server statistics (server processing time) you need to have access to server through an agent or API's exposed by appllication/app server. Without any of those getting actual stats is not possible. IMHO GPSI Api's wont help you in this situation.

GPSI is providing you a rough estimate by math. calculation of various factors. (total response time = server time + latency + rendering time) GPSI knows total response time, latency, rendering time and thus it is providing you approximate server time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM