> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobilerun.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Latency check

> Returns the most recent cached network-latency measurement for the proxy, sampled periodically by connecting through the proxy to a fixed target. `latency` is null when no measurement is available yet (e.g. the proxy is not active, or it has not been sampled since coming online).



## OpenAPI

````yaml /api-reference/mobilerun-proxy/proxies.yaml get /connect/proxies/{id}/ping
openapi: 3.1.0
info:
  title: Proxies
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /connect/proxies/{id}/ping:
    get:
      tags:
        - Proxies
      summary: Latency check
      description: >-
        Returns the most recent cached network-latency measurement for the
        proxy, sampled periodically by connecting through the proxy to a fixed
        target. `latency` is null when no measurement is available yet (e.g. the
        proxy is not active, or it has not been sampled since coming online).
      operationId: PingProxy
      parameters:
        - $ref: '#/components/parameters/ProxyID'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProxyLatency'
          description: The proxy's latest latency reading.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.connect.proxies.ping('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(response.latency);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.connect.proxies.ping(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.latency)
components:
  parameters:
    ProxyID:
      in: path
      name: id
      required: true
      schema:
        format: uuid
        type: string
  schemas:
    ProxyLatency:
      description: The latest cached latency reading for a proxy.
      properties:
        latency:
          allOf:
            - $ref: '#/components/schemas/LatencySample'
          description: The latest reading, or null if none has been taken yet.
          nullable: true
        proxyId:
          format: uuid
          type: string
      required:
        - proxyId
        - latency
      type: object
    LatencySample:
      description: An aggregated latency measurement taken through the proxy.
      properties:
        avgMs:
          description: Mean round-trip time over successful probes, in milliseconds.
          type: integer
        jitterMs:
          description: >-
            Round-trip time spread (max - min) over successful probes, in
            milliseconds.
          type: integer
        maxMs:
          description: Maximum round-trip time over successful probes, in milliseconds.
          type: integer
        measuredAt:
          description: When this measurement was taken.
          format: date-time
          type: string
        minMs:
          description: Minimum round-trip time over successful probes, in milliseconds.
          type: integer
        packetLoss:
          description: >-
            Fraction of probes that failed, 0..1 (1 means the proxy was
            unreachable; rtt fields are 0).
          type: number
        samples:
          description: Number of probes taken in this measurement.
          type: integer
        target:
          description: The host:port the latency was measured against, through the proxy.
          type: string
      required:
        - target
        - samples
        - minMs
        - avgMs
        - maxMs
        - jitterMs
        - packetLoss
        - measuredAt
      type: object
    ConnectErrorResponse:
      description: A Problem Details (RFC 7807-style) error response.
      properties:
        detail:
          description: Human-readable explanation of this occurrence.
          type: string
        errors:
          description: Per-input errors, when applicable.
          items:
            $ref: '#/components/schemas/ConnectErrorDetail'
          type: array
        status:
          description: HTTP status code.
          type: integer
        title:
          description: Short, human-readable summary of the error type.
          type: string
      required:
        - title
        - status
        - detail
        - errors
      type: object
    ConnectErrorDetail:
      description: A single error, locating an offending input where applicable.
      properties:
        location:
          description: Path to the offending input, e.g. "body.proxyId".
          type: string
        message:
          description: Human-readable description of this error.
          type: string
        value:
          description: The offending value, when available.
      required:
        - location
        - message
      type: object
  responses:
    Unauthorized:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ConnectErrorResponse'
      description: Missing or invalid credentials.
    NotFound:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ConnectErrorResponse'
      description: The resource was not found.
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.