Paytm Feb 16, 2022

Instrumenting App Flows for Performance Monitoring

Article Summary

The Paytm Editorial Team reveals how they measure the real cost of user friction: tracking payment flows down to the millisecond, excluding network delays that mask app performance issues.

Paytm's engineering team faced a critical challenge: existing monitoring tools like Firebase couldn't separate app performance from API latency when tracking user flows. They needed to answer questions like 'How long does a QR payment actually take?' without network noise skewing the data.

Key Takeaways

Critical Insight

Paytm engineered a hybrid tracing system that isolates pure app performance from network latency, giving them accurate flow-time measurements across millions of devices.

The article includes actual Swift code showing how they architected the trace hierarchy and calculated idle time during API calls.

About This Article

Problem

Paytm needed to understand how its app performed on millions of iOS devices with varying capabilities. The problem was that Firebase and similar platforms kept logging during network calls, which meant API latency got mixed into the performance metrics. This made it hard to see what was actually happening in the app versus what was just slow internet.

Solution

Paytm built a custom LogManager with three trace classes: JRPerformanceTrace, JRHawkeyeTrace, and JRFIRTrace. These classes let engineers pause and resume logging around API calls. This way, they could measure app performance without network delays getting in the way. The logs then went to both Hawkeye and Firebase for analysis.

Impact

The system now captures real app performance during payment flows like UPI transactions. Engineers can track the full journey from 'upiClick_MTLandingScreenReady' to 'pinRetreived_transactionStatus' with millisecond precision. Network noise no longer distorts the timing data.

Related Articles