Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joetesta
Roku Guru

Measuring API response time accurately - possible?

Greetings,

In the app I'm working on, we are trying to measure the response time of our APIs for monitoring and troubleshooting,

With each API request, the app will initiate a counter with
 context.timespan: CreateObject("roTimespan")
then when the request succeeds or fails, the app evaluates how long it took
 responseTime = evalString(context.timespan.totalMilliseconds())
and reports the response time back to server where it's logged for reference.

When we compare the time to the duration in charles proxy, there is often a substantial difference. From testing, it seems to be device-dependent, meaning older (slower) devices report a longer response time than newer devices, and both are (usually) longer than the duration reported in charles. Also seems that requests called async with other requests are reporting much longer response times in the application than on the proxy software passing the requests back and forth.

Question: can we accurately measure the response times of our APIs from within our Roku application?
aspiring
0 Kudos