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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Roku Guru

Measuring API response time accurately - possible?


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?
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.