# Spotting Latency Regressions Ahead of Time at Teams Mobile

DevFeed: [Spotting Latency Regressions Ahead of Time at Teams Mobile](<https://devfeed.tech/articles/spotting-latency-regressions-ahead-of-time-at-teams-mobile-22785.md>)

Original publisher: [Read original article](<https://medium.com/microsoft-mobile-engineering/spotting-latency-regressions-ahead-of-time-at-teams-mobile-e0e5a5ef6390?source=rss----87f10537e947---4>)

Author: Saumye Srivastava

Published: 2024-02-02T18:18:47Z

Content type: article

Language: en

Sources: [Android@Microsoft - Medium](<https://devfeed.tech/sources/android-microsoft-medium.md>)

Topics: [Latency](<https://devfeed.tech/topics/latency.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [telemetry](<https://devfeed.tech/topics/telemetry.md>), [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>), [Grafana](<https://devfeed.tech/topics/grafana.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [dashboards](<https://devfeed.tech/topics/dashboards.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [app-performance](<https://devfeed.tech/tags/app-performance.md>), [dashboards](<https://devfeed.tech/tags/dashboards.md>), [database](<https://devfeed.tech/tags/database.md>), [grafana](<https://devfeed.tech/tags/grafana.md>), [latency](<https://devfeed.tech/tags/latency.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [performance](<https://devfeed.tech/tags/performance.md>), [performance-testing](<https://devfeed.tech/tags/performance-testing.md>), [telemetry](<https://devfeed.tech/tags/telemetry.md>), [user-experience](<https://devfeed.tech/tags/user-experience.md>)

## AI overview

This article describes how the Teams Mobile Android team measures and monitors latency in critical app scenarios using scenario telemetry. It explains how execution time, metadata, device information, status, steps, and correlation IDs are recorded and visualized to detect regressions earlier, while noting that latency graphs alone can make diagnosis and rollout response difficult.

## Source excerpt

In the realm of mobile applications, subpar performance not only results in user frustration but also contributes to high user dissatisfaction scores (DSAT), a lower app Net Promoter Score (NPS), and increased uninstallations. Developers continually implement numerous code optimizations in each release, bringing about substantial improvements in App Vitals and critical user scenarios such as application launch, chat loading time, and channel loading time. Our Android codebase sees contributions from over 350 developers on a monthly basis, with a staggering 50+ commits merged into the mainline every day. The pace of innovation remains high, as we introduce more than 20 new features daily to our internal users across the organization and our partners. In this dynamic environment, the need to maintain optimal app performance is paramount, emphasizing the importance of identifying and mitigating latency issues before they have a chance to impact user experience. All code is guilty until proven innocent.-- Uncle BobScenario Measurement & Monitoring We employ a method called scenario telemetry to measure execution time at the beginning and end of critical usage scenarios of our app. The latency telemetry for all usage scenarios is recorded in our database along with user details. The ScenarioContext handle facilitates the transfer of context information related to a user scenario throughout the app, including execution time, metadata, device information, status, steps, and correlation ID. fun onCreate() { val scenarioContext = scenarioManager.startScenario(AppScenarioNames.App.APP_START_WARM_FIRST_DRAW); // do critical work, load screen scenarioManager.stopScenario(scenarioContext); } Creating dashboards at Microsoft is a straightforward process, involving crafting a query on our internal portal that our internal framework executes every minute to chart into graphs. You can send the usage telemetry to your internal or third party Database and host a Grafana instance for