### Install Dependencies and Setup Git Hooks Source: https://github.com/measure-sh/measure/blob/main/docs/CONTRIBUTING.md Run these commands in the repository root after cloning to install dependencies and set up git hooks for a smooth contribution experience. This is a one-time setup. ```sh npm install npm run prepare ``` -------------------------------- ### Setup Flutter Module Source: https://github.com/measure-sh/measure/blob/main/samples/frank/README.md Change directory to the Flutter module and run 'flutter pub get' to fetch dependencies. This prepares the Flutter integration. ```bash cd flutter flutter pub get cd .. ``` -------------------------------- ### Copy Environment File Source: https://github.com/measure-sh/measure/blob/main/samples/frank/README.md Copy the example environment file to start configuring Measure SDK keys. This is the first step in setting up the SDK. ```bash cp .env.example .env ``` -------------------------------- ### Run Setup Script Source: https://github.com/measure-sh/measure/blob/main/samples/frank/README.md Execute the setup script to process the .env file and generate necessary configuration files for Android and iOS builds. ```bash ./setup-secrets.sh ``` -------------------------------- ### Run measure.sh Installation with Podman Source: https://github.com/measure-sh/measure/blob/main/docs/hosting/README.md Use the `--podman` flag with `install.sh` to configure the installation to use Podman instead of Docker. This installs Podman and related packages, allowing continued use of Docker commands. ```sh sudo ./install.sh --podman ``` -------------------------------- ### SDK Initialization Examples Source: https://github.com/measure-sh/measure/blob/main/docs/features/configuration-options.md Examples of initializing the Measure SDK with various configuration options for Android, iOS, and Flutter. ```APIDOC ## Android Initialization ### Description Initializes the Measure SDK for Android with specified configuration options. ### Method `Measure.init` ### Endpoint N/A (SDK method) ### Parameters #### Request Body - **context** (Context) - Required - The Android application context. - **config** (MeasureConfig) - Required - An object containing SDK configuration options. - **enableLogging** (boolean) - Optional - Enables or disables internal SDK logging. Defaults to `false`. - **autoStart** (boolean) - Optional - Controls whether to start tracking immediately. Defaults to `true`. - **maxDiskUsageInMb** (integer) - Optional - Maximum disk usage in megabytes for SDK data. Defaults to `50`. - **trackActivityIntentData** (boolean) - Optional - Enables collection of intent data for certain events. Defaults to `false`. - **requestHeadersProvider** (Function) - Optional - Provides custom HTTP headers for SDK requests. Defaults to `null`. - **enableFullCollectionMode** (boolean) - Optional - Enables full data collection mode. Defaults to `false`. - **enableDiagnosticMode** (boolean) - Optional - Enables diagnostic mode for the SDK. Defaults to `false`. ### Request Example ```kotlin Measure.init( context, MeasureConfig( enableLogging = true, autoStart = true, maxDiskUsageInMb = 50, trackActivityIntentData = true, requestHeadersProvider = customRequestHeadersProvider, enableFullCollectionMode = false, enableDiagnosticMode = false, ) ) ``` ### Response #### Success Response (200) N/A (Initialization method) ### Response Example N/A ``` ```APIDOC ## iOS Initialization ### Description Initializes the Measure SDK for iOS with specified configuration options. ### Method `Measure.initialize` ### Endpoint N/A (SDK method) ### Parameters #### Request Body - **clientInfo** (ClientInfo) - Required - Information about the client. - **config** (BaseMeasureConfig) - Required - An object containing SDK configuration options. - **enableLogging** (boolean) - Optional - Enables or disables internal SDK logging. Defaults to `false`. - **autoStart** (boolean) - Optional - Controls whether to start tracking immediately. Defaults to `true`. - **maxDiskUsageInMb** (integer) - Optional - Maximum disk usage in megabytes for SDK data. Defaults to `50`. - **requestHeadersProvider** (Function) - Optional - Provides custom HTTP headers for SDK requests. Defaults to `null`. - **enableFullCollectionMode** (boolean) - Optional - Enables full data collection mode. Defaults to `false`. ### Request Example ```swift let config = BaseMeasureConfig(enableLogging: true, autoStart: true, maxDiskUsageInMb: 50, requestHeadersProvider: customRequestHeadersProvider, enableFullCollectionMode: false) Measure.initialize(with: clientInfo, config: config) ``` ### Response #### Success Response (200) N/A (Initialization method) ### Response Example N/A ``` ```APIDOC ## Flutter Initialization ### Description Initializes the Measure SDK for Flutter with specified configuration options. ### Method `Measure.instance.init` ### Endpoint N/A (SDK method) ### Parameters #### Request Body - **runAppCallback** (Function) - Required - A callback function to run the application. - **config** (MeasureConfig) - Optional - An object containing SDK configuration options. - **enableLogging** (boolean) - Optional - Enables or disables internal SDK logging. Defaults to `false`. - **autoStart** (boolean) - Optional - Controls whether to start tracking immediately. Defaults to `true`. - **maxDiskUsageInMb** (integer) - Optional - Maximum disk usage in megabytes for SDK data. Defaults to `50`. - **enableFullCollectionMode** (boolean) - Optional - Enables full data collection mode. Defaults to `false`. ### Request Example ```dart await Measure.instance.init( () => runApp(MeasureWidget(child: MyApp())), config: const MeasureConfig( enableLogging: true, autoStart: true, maxDiskUsageInMb: 50, enableFullCollectionMode: false, ), ); ``` ### Response #### Success Response (200) N/A (Initialization method) ### Response Example N/A ``` -------------------------------- ### Start Configuration Wizard Source: https://github.com/measure-sh/measure/blob/main/docs/CONTRIBUTING.md Navigate to the self-host directory and run this command to start the configuration wizard. It prepares environment variable files for local development. ```sh cd self-host ./config.sh --development --wizard ``` -------------------------------- ### Setup iOS Dependencies Source: https://github.com/measure-sh/measure/blob/main/samples/frank/README.md Install iOS dependencies using CocoaPods. This command fetches all required native libraries, including Measure SDK and Flutter/React Native pods. ```bash cd ios pod install cd .. ``` -------------------------------- ### Build and Start Services Separately Source: https://github.com/measure-sh/measure/blob/main/docs/CONTRIBUTING.md Alternatively, build the Docker images and then start the services. This command also includes the --profile migrate flag for database migrations. ```sh docker compose build docker compose --profile migrate up ``` -------------------------------- ### Start Measure Containers in Production Source: https://github.com/measure-sh/measure/blob/main/docs/hosting/README.md Use this command to start Measure containers in production mode with build and migration profiles. ```sh docker compose -f compose.yml -f compose.prod.yml \ --profile migrate \ up --build ``` -------------------------------- ### Setup React Native Module Source: https://github.com/measure-sh/measure/blob/main/samples/frank/README.md Install Node.js dependencies for the React Native module. This ensures all necessary packages are available. ```bash cd react_native yarn install cd .. ``` -------------------------------- ### Start Services with Database Migrations Source: https://github.com/measure-sh/measure/blob/main/docs/CONTRIBUTING.md Use this command to start all services using Docker Compose. Include the --profile migrate flag for the initial run to trigger database migrations. This profile is idempotent. ```sh docker compose --profile migrate up ``` -------------------------------- ### Start Development Server Source: https://github.com/measure-sh/measure/blob/main/docs/CONTRIBUTING.md Command to start the development server using Docker Compose's watch functionality. This command is used for local development after migrations. ```sh docker compose watch ``` -------------------------------- ### Install Caddy Web Server Source: https://github.com/measure-sh/measure/blob/main/docs/hosting/README.md Installs the Caddy web server on Debian/Ubuntu systems. Ensure you have curl and necessary apt packages. ```shell sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl && \ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg && \ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list && \ sudo apt update && \ sudo apt install caddy ``` -------------------------------- ### Start Metro Server Source: https://github.com/measure-sh/measure/blob/main/react-native/example/rnExample/README.md Use this command to start the Metro bundler, which is essential for running your React Native application. It should be run from the root of your project. ```bash npm start ``` ```bash yarn start ``` -------------------------------- ### Upgrade Measure using Git and Install Script Source: https://github.com/measure-sh/measure/blob/main/docs/hosting/migration-guides/v0.6.x/README.md Execute these commands to fetch the latest tags, checkout a specific version, and run the installation script for Measure self-hosting. Ensure you have local modifications reset if necessary. ```sh cd ~/measure git reset --hard # only applies if you have local modifications git fetch --tags git checkout cd self-host sudo ./install.sh ``` -------------------------------- ### Clean Measure Installation Source: https://github.com/measure-sh/measure/blob/main/docs/hosting/README.md Completely remove Measure Docker containers, images, and volumes to start the installation over. ```sh sudo docker compose down --rmi all --remove-orphans --volumes ``` -------------------------------- ### Start a Span with Custom Start Time Source: https://github.com/measure-sh/measure/blob/main/docs/features/feature-performance-tracing.md Starts a span and allows specifying a custom start time using a monotonic clock. This is useful when the operation began before Measure APIs were available. ```kotlin val span: Span = Measure.startSpan("span-name", timestamp = Measure.getCurrentTime()) ``` ```swift let span: Span = Measure.startSpan(name: "operation-name", timestamp: Measure.getCurrentTime()) ``` ```dart final span = Measure.instance.startSpan("span-name", timestamp: Measure.instance.getCurrentTime()); ``` -------------------------------- ### Compare Startup Benchmark Results Source: https://github.com/measure-sh/measure/blob/main/android/benchmarks/README.md Use the main.py script to compare startup benchmark data between two different runs. Navigate to the scripts directory first. ```bash cd android/benchmarks/scripts python main.py compare-startup path-to-before-benchmarkData.json path-to-after-benchmarkData.json ``` -------------------------------- ### Start Measurement API Source: https://github.com/measure-sh/measure/blob/main/self-host/session-data/sh.measure.android.flutter/0.0.1/2/mapping.txt API endpoint for starting a measurement session. ```APIDOC ## POST /measure/start ### Description Initiates a new measurement session. This method is typically called at the beginning of a process or task you want to measure. ### Method POST ### Endpoint /measure/start ### Parameters #### Query Parameters - **result** (io.flutter.plugin.common.MethodChannel$Result) - Required - The callback to receive the result of the operation. ### Request Body This endpoint does not require a request body. ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "started" } ``` ``` -------------------------------- ### Example App Configuration Source: https://github.com/measure-sh/measure/blob/main/self-host/sessionator/README.md This TOML snippet shows how to configure apps and their API keys in `config.toml` for ingestion. Ensure directory names under `session-data` match these app names. ```toml [apps.sample-app] api-key = "msrsh_xxxxxx_xxxx" [apps.wikipedia] api-key = "msrsh_xxxxxx_xxxx" ``` -------------------------------- ### Request Body Example Source: https://github.com/measure-sh/measure/blob/main/docs/api/dashboard/README.md This is an example of a request body. Ensure it is in JSON format. ```json { screenshot_mask_level: "all_text" } ``` -------------------------------- ### Navigate to Self-Host Directory and Run Install Script Source: https://github.com/measure-sh/measure/blob/main/docs/hosting/README.md Change to the `self-host` directory and execute the `install.sh` script with sudo privileges to perform the upgrade. This script handles the necessary changes for the new version. ```sh # change to `self-host` directory cd self-host # run the `install.sh` script sudo ./install.sh ``` -------------------------------- ### Troubleshoot `pod install` with Firebase Source: https://github.com/measure-sh/measure/blob/main/samples/frank/README.md When `pod install` fails due to git cloning issues with large repositories like `firebase-ios-sdk`, temporarily switch git to use HTTP/1.1, run `pod install`, and then revert the git configuration. ```bash git config --global http.version HTTP/1.1 pod install git config --global --unset http.version ``` -------------------------------- ### Show Root Usage Help Source: https://github.com/measure-sh/measure/blob/main/self-host/sessionator/README.md Run this command to see the overall usage instructions for the Sessionator tool. ```sh go run . --help ``` -------------------------------- ### Deferred Span Start Source: https://github.com/measure-sh/measure/blob/main/docs/features/feature-performance-tracing.md Enables pre-configuring a span without starting it immediately using the span builder API. ```APIDOC ## Deferred Span Start The span builder API allows pre-configuring a span without starting it immediately. ### Android ```kotlin val spanBuilder: SpanBuilder = Measure.createSpan("span-name") val span: Span = spanBuilder.startSpan() ``` ### iOS ```swift let spanBuilder: SpanBuilder = Measure.createSpanBuilder(name: "span-name")! let span: Span = spanBuilder.startSpan() ``` ### Flutter ```dart final spanBuilder = Measure.instance.createSpanBuilder("span-name"); final span = spanBuilder.startSpan(); ``` ``` -------------------------------- ### Span Structure Example Source: https://github.com/measure-sh/measure/blob/main/docs/api/sdk/README.md Illustrates the JSON structure of an 'app_startup' span, including trace and span IDs, timestamps, duration, and checkpoints. ```json { "trace_id": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "span_id": "1234567890abcdef", "parent_id": null, "session_id": "633a2fbc-a0d1-4912-a92f-9e43e72afbc6", "name": "app_startup", "status": 0, "start_time": "2023-08-24T14:51:38.000000534Z", "end_time": "2023-08-24T14:51:38.000000834Z", "duration": 3000, "checkpoints": [ { "name": "dagger_init_complete", "timestamp": "2023-08-24T14:51:38.000000634Z" } ], "attributes": { // snip attributes fields } } ``` -------------------------------- ### Deferred Span Start Source: https://github.com/measure-sh/measure/blob/main/docs/features/feature-performance-tracing.md Allows for starting a span at a later point in time than its logical beginning, useful for asynchronous operations. ```APIDOC ## Deferred Span Start ### Description Starts a span at a time different from when the `startSpan` method is called. This is useful for operations where the start time is not immediately known or needs to be backdated. ### Method Not applicable (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```kotlin // Android val startTime = System.currentTimeMillis() - 5000 // 5 seconds ago val span = Measure.startSpan("deferred-operation", startTime = startTime) ``` ```swift // iOS let startTime = Date().addingTimeInterval(-5.0) // 5 seconds ago let span = Measure.startSpan("deferred-operation", startTime: startTime) ``` ```dart // Flutter final startTime = DateTime.now().subtract(const Duration(seconds: 5)); // 5 seconds ago final span = Measure.instance.startSpan("deferred-operation", startTime: startTime); ``` ### Response #### Success Response (200) Returns the span object with the specified start time. #### Response Example ```json { "spanId": "deferred-span-id", "traceId": "some-trace-id", "name": "deferred-operation", "startTime": "2023-10-27T09:59:55Z", "endTime": null } ``` ``` -------------------------------- ### Run Installation Script Source: https://github.com/measure-sh/measure/blob/main/docs/hosting/smtp-email.md Execute this script after configuring SMTP settings and shutting down services for the changes to take effect. ```sh sudo ./install.sh ``` -------------------------------- ### Get Methods Source: https://github.com/measure-sh/measure/blob/main/self-host/session-data/sh.measure.android.flutter/0.0.1/2/mapping.txt Provides details on various 'get' methods available for retrieving data, including those with time units and without. ```APIDOC ## GET /api/measure-sh/measure/get ### Description Retrieves an object with a specified timeout. ### Method GET ### Endpoint /api/measure-sh/measure/get ### Parameters #### Query Parameters - **timeout** (long) - Required - The time duration to wait for the object. - **unit** (java.util.concurrent.TimeUnit) - Required - The time unit for the timeout duration. ### Response #### Success Response (200) - **result** (java.lang.Object) - The retrieved object. #### Response Example ```json { "result": "someObject" } ``` ``` ```APIDOC ## GET /api/measure-sh/measure/get-no-timeout ### Description Retrieves an object without a specified timeout. ### Method GET ### Endpoint /api/measure-sh/measure/get-no-timeout ### Response #### Success Response (200) - **result** (java.lang.Object) - The retrieved object. #### Response Example ```json { "result": "someObject" } ``` ``` -------------------------------- ### Navigate to self-host Directory Source: https://github.com/measure-sh/measure/blob/main/docs/hosting/README.md Change into the `self-host` directory. Subsequent commands for installation should be executed from this directory. ```sh cd self-host ``` -------------------------------- ### Flutter Error Example Source: https://github.com/measure-sh/measure/blob/main/docs/features/feature-crash-reporting.md Example of a Flutter crash log, showing exception type, method name, and file name for grouping. ```text FlutterError (setState() called after dispose(): _MyHomePageState#12345(ticker: _TickerModeEnabled)) at _MyHomePageState._incrementCounter (package:my_app/main.dart:42:9) at _MyHomePageState.build (package:my_app/main.dart:30:5) at StatelessElement.build (package:flutter/src/widgets/framework.dart:4620:27) ... ``` -------------------------------- ### Build React Native SDK Source: https://github.com/measure-sh/measure/blob/main/samples/frank/README.md Navigate to the React Native SDK directory, install dependencies, and build the module. This is required before integrating into the sample app. ```bash cd ../../react-native yarn install npx bob build --target module cd ../samples/frank ``` -------------------------------- ### Initialize TextInputChannel$Configuration$Autofill Source: https://github.com/measure-sh/measure/blob/main/self-host/session-data/sh.measure.android.flutter/0.0.1/1/mapping.txt Constructor for Autofill configuration, taking String, String array, String, and TextEditState. ```kotlin void io.flutter.embedding.engine.systemchannels.TextInputChannel$Configuration$Autofill.(java.lang.String,java.lang.String[],java.lang.String,io.flutter.embedding.engine.systemchannels.TextInputChannel$TextEditState):632:636 ``` -------------------------------- ### GET /prefs/notifPrefs - Get Notification Preferences Source: https://github.com/measure-sh/measure/blob/main/docs/api/dashboard/README.md Retrieves the user's notification preferences. Specific parameters are not detailed in the provided text. ```APIDOC ## GET /prefs/notifPrefs ### Description Get notification preferences. ### Method GET ### Endpoint /prefs/notifPrefs ### Parameters *Note: Specific query parameters or request body are not detailed in the provided text.* ### Request Headers - **Content-Type**: application/json; charset=utf-8 ### Response #### Success Response (200) *Note: Response body details are not provided in the source text.* #### Response Example *Note: Response body example is not provided in the source text.* ``` -------------------------------- ### Navigate to Home Directory Source: https://github.com/measure-sh/measure/blob/main/docs/hosting/README.md Change the current directory to your home directory before cloning the repository. ```sh cd ~ ``` -------------------------------- ### Example JSON Response for Metrics Source: https://github.com/measure-sh/measure/blob/main/docs/api/dashboard/README.md This is an example of a successful response body when fetching metrics. It includes version information and aggregated performance data. ```json [ { "id": "0.9.0-SNAPSHOT.debug (900)", "data": [ { "datetime": "2024-11-18", "p50": 82, "p90": 85, "p95": 85, "p99": 85 } ] } ] ``` -------------------------------- ### WindowInsetsCompat.BuilderImpl29 Methods Source: https://github.com/measure-sh/measure/blob/main/self-host/session-data/sh.measure.android.flutter/0.0.1/2/mapping.txt Methods available in the BuilderImpl29 class. ```APIDOC ## WindowInsetsCompat.BuilderImpl29 Methods ### Description Methods for constructing WindowInsetsCompat objects using the BuilderImpl29 implementation. ### Method - (No specific methods detailed in the provided text for BuilderImpl29) ### Endpoint N/A (Class methods) ``` -------------------------------- ### Initialize iOS SDK Source: https://context7.com/measure-sh/measure/llms.txt Install the Measure SDK using CocoaPods or Swift Package Manager. Initialize the SDK in your AppDelegate with client information and configuration settings. ```swift // Podfile pod 'measure-sh', :linkage => :static // Or Package.swift for SPM dependencies: [ .package(url: "https://github.com/measure-sh/measure.git", branch: "ios-v0.10.0") ] // AppDelegate.swift import Measure func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let config = BaseMeasureConfig( enableLogging: true, autoStart: true, maxDiskUsageInMb: 50, enableFullCollectionMode: false ) let clientInfo = ClientInfo(apiKey: "", apiUrl: "") Measure.initialize(with: clientInfo, config: config) return true } ``` -------------------------------- ### Deferred Span Start Source: https://github.com/measure-sh/measure/blob/main/docs/features/feature-performance-tracing.md Use the span builder API to pre-configure a span without starting it immediately. Call startSpan() on the builder to initiate the span. ```kotlin val spanBuilder: SpanBuilder = Measure.createSpan("span-name") val span: Span = spanBuilder.startSpan() ``` ```swift let spanBuilder: SpanBuilder = Measure.createSpanBuilder(name: "span-name")! let span: Span = spanBuilder.startSpan() ``` ```dart final spanBuilder = Measure.instance.createSpanBuilder("span-name"); final span = spanBuilder.startSpan(); ``` -------------------------------- ### Initialize SystemServiceProviderImpl Source: https://github.com/measure-sh/measure/blob/main/self-host/session-data/sh.measure.android.flutter/0.0.1/2/mapping.txt Constructor for SystemServiceProviderImpl. Requires an Android Context. ```kotlin sh.measure.android.utils.SystemServiceProviderImpl.(android.content.Context) ``` -------------------------------- ### WindowInsetsCompat State and Configuration Source: https://github.com/measure-sh/measure/blob/main/self-host/session-data/sh.measure.android.flutter/0.0.1/1/mapping.txt Methods for checking the state and configuring WindowInsetsCompat. ```APIDOC ## GET /window-insets/consumed ### Description Checks if the insets have been consumed. ### Method GET ### Endpoint /window-insets/consumed ### Parameters None ### Response #### Success Response (200) - **consumed** (boolean) - True if the insets are consumed, false otherwise. #### Response Example ```json { "consumed": false } ``` ## GET /window-insets/round ### Description Checks if the window is round. ### Method GET ### Endpoint /window-insets/round ### Parameters None ### Response #### Success Response (200) - **round** (boolean) - True if the window is round, false otherwise. #### Response Example ```json { "round": false } ``` ## POST /window-insets/overridden ### Description Sets the overridden insets for the window. ### Method POST ### Endpoint /window-insets/overridden ### Parameters #### Request Body - **insets** (array of androidx.core.graphics.Insets) - Required - The array of overridden insets. ### Request Example ```json { "insets": [ { "left": 10, "top": 0, "right": 0, "bottom": 0 } ] } ``` ### Response #### Success Response (200) No content. ## POST /window-insets/root ### Description Sets the root window insets. ### Method POST ### Endpoint /window-insets/root ### Parameters #### Request Body - **insets** (androidx.view.WindowInsetsCompat) - Required - The root window insets. ### Request Example ```json { "insets": { "left": 0, "top": 0, "right": 0, "bottom": 0 } } ``` ### Response #### Success Response (200) No content. ## POST /window-insets/stable ### Description Sets the stable insets. ### Method POST ### Endpoint /window-insets/stable ### Parameters #### Request Body - **insets** (androidx.core.graphics.Insets) - Required - The stable insets. ### Request Example ```json { "insets": { "left": 0, "top": 0, "right": 0, "bottom": 0 } } ``` ### Response #### Success Response (200) No content. ``` -------------------------------- ### Profile Installer Diagnostics Callback Source: https://github.com/measure-sh/measure/blob/main/self-host/session-data/sh.measure.android.flutter/0.0.1/2/mapping.txt The DiagnosticsCallback interface is used to report results from the profile installation process. It takes an integer status code and an object payload. ```java void result(int,java.lang.Object) ``` -------------------------------- ### Run All Tests Source: https://github.com/measure-sh/measure/blob/main/frontend/dashboard/CLAUDE.md Execute both unit and integration tests sequentially using npm. ```sh npm test ``` -------------------------------- ### Request Body Example Source: https://github.com/measure-sh/measure/blob/main/docs/api/sdk/README.md This is an example payload for the Measure API request. It must include app version and build information, and can optionally include mapping file details. ```json { "version_name": "1.0", "version_code": "10", "build_size": 10241024, "build_type": "ipa", "mappings": [ { "type": "dsym", "filename": "DemoApp.app.dSYM.tgz" }, { "type": "elf_debug", "filename": "app.symbols" } ] } ``` -------------------------------- ### Run Data Backfills Source: https://github.com/measure-sh/measure/blob/main/docs/CONTRIBUTING.md Execute this script after starting services to complete data backfills for version 0.9.x. ```sh ./migrations/v0.9.x-data-backfills.sh ``` -------------------------------- ### Android Crash Grouping Example Source: https://github.com/measure-sh/measure/blob/main/docs/features/feature-crash-reporting.md Example of an Android crash log, illustrating how exception type, method name, and file name from the first frame are used for grouping. ```java java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.app.MainActivity.onCreate(android.os.Bundle)' on a null object reference at com.example.app.MainActivity.onCreate(MainActivity.kt:10) at android.app.Activity.performCreate(Activity.java:8000) ... ``` -------------------------------- ### Backend Google Signin Initialization Source: https://github.com/measure-sh/measure/blob/main/backend/api/authsession/AUTH_FLOW.md Backend receives the Google login initialization request, saves the provided state to the 'auth_states' table, and prepares for redirection to the Google OAuth authorization page. ```go Backend: SigninGoogle() save state to auth_states table provider = google ``` -------------------------------- ### Example JSON Response Body Source: https://github.com/measure-sh/measure/blob/main/docs/api/dashboard/README.md This is an example of a successful response body, showing trends for latency, error rate, and frequency. P95 latency is in milliseconds, and error rate is a percentage. ```json { "trends_latency": [ { "domain": "api.example.com", "path_pattern": "/api/users", "p95_latency": 250.5, "error_rate": 2.3, "frequency": 15000 } ], "trends_error_rate": [ { "domain": "api.example.com", "path_pattern": "/api/auth", "p95_latency": 150.2, "error_rate": 5.8, "frequency": 8500 } ], "trends_frequency": [ { "domain": "api.example.com", "path_pattern": "/api/feed", "p95_latency": 120.0, "error_rate": 1.2, "frequency": 50000 } ] } ``` -------------------------------- ### Initialize Measure SDK in iOS (Swift) Source: https://github.com/measure-sh/measure/blob/main/docs/sdk-integration-guide.md Initialize the SDK in your AppDelegate's application(_:didFinishLaunchingWithOptions:) method. Provide your API key and URL. ```swift import Measure func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let config = BaseMeasureConfig( // Set to true to track all sessions // useful to verify the installation enableFullCollectionMode: true ) let clientInfo = ClientInfo(apiKey: "", apiUrl: "") Measure.initialize(with: clientInfo, config: config) return true } ``` -------------------------------- ### WindowInsetsCompat.BuilderImpl20 Source: https://github.com/measure-sh/measure/blob/main/self-host/session-data/sh.measure.android.flutter/0.0.1/1/mapping.txt Builder implementation for API level 20. ```APIDOC ## WindowInsetsCompat.BuilderImpl20 ### Description Builder implementation for API level 20 to construct WindowInsetsCompat objects. ### Fields - **mPlatformInsets** (android.view.WindowInsets) - The platform insets. - **mStableInsets** (androidx.core.graphics.Insets) - The stable insets. - **sConsumedField** (java.lang.reflect.Field) - Reflection field for consumed status. - **sConsumedFieldFetched** (boolean) - Flag indicating if the consumed field has been fetched. - **sConstructor** (java.lang.reflect.Constructor) - Reflection constructor for WindowInsets. - **sConstructorFetched** (boolean) - Flag indicating if the constructor has been fetched. ### Methods - **()**: Constructor for BuilderImpl20. - **build()**: Builds a WindowInsetsCompat object. - **setStableInsets(Insets)**: Sets the stable insets. - **setSystemWindowInsets(Insets)**: Sets the system window insets. - **createWindowInsetsInstance()**: Creates an instance of android.view.WindowInsets. ``` -------------------------------- ### Example ANR Stack Trace Source: https://github.com/measure-sh/measure/blob/main/docs/features/feature-anr-reporting.md This snippet shows an example of a stack trace from an ANR event, highlighting thread states and lock contention. It's useful for diagnosing deadlocks. ```text "main" prio=5 tid=1 Blocked at sh.measure.sample.ExceptionDemoActivity.deadLock$lambda$10(ExceptionDemoActivity.kt:66) - waiting to lock <0x0a293e9f> (a java.lang.Object) held by thread 22 at sh.measure.sample.ExceptionDemoActivity.$r8$lambda$kc26SdTV_Hqz6i5PLOpVXKS016U(unavailable:0) at sh.measure.sample.ExceptionDemoActivity$$ExternalSyntheticLambda9.run(unavailable:2) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7872) at java.lang.reflect.Method.invoke(Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) "APP: Locker" prio=5 tid=22 Sleeping at java.lang.Thread.sleep(Native method) - sleeping on <0x06290e31> (a java.lang.Object) at java.lang.Thread.sleep(Thread.java:450) - locked <0x06290e31> (a java.lang.Object) at java.lang.Thread.sleep(Thread.java:355) at sh.measure.sample.ExceptionDemoActivity.sleep(ExceptionDemoActivity.kt:86) at sh.measure.sample.ExceptionDemoActivity.access$sleep(ExceptionDemoActivity.kt:12) at sh.measure.sample.ExceptionDemoActivity$LockerThread.run(ExceptionDemoActivity.kt:80) - locked <0x0a293e9f> (a java.lang.Object) ``` -------------------------------- ### iOS Crash Grouping Example Source: https://github.com/measure-sh/measure/blob/main/docs/features/feature-crash-reporting.md Example of an iOS crash log, showing how signal, method name, and file name from the first application binary frame are used for grouping. ```objective-c Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Crashed Thread: 0 Application Specific Information: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MainViewController viewDidLoad]: unrecognized selector sent to instance 0x600000e2c0c0' First Throw Call Stack: ( 0 CoreFoundation 0x000000010a2f3b6c __exceptionPreprocess + 220 1 libobjc.A.dylib 0x0000000109d8e5e1 objc_exception_throw + 48 2 MainViewController.m 0x000000010a2f3b6c -[MainViewController viewDidLoad] + 0 ... ) ```