Skip to content
Start here

Get percentiles for an http test

client.zeroTrust.dex.httpTests.percentiles.get(stringtestId, PercentileGetParams { account_id, from, to, 2 more } params, RequestOptionsoptions?): HTTPDetailsPercentiles { dnsResponseTimeMs, resourceFetchTimeMs, serverResponseTimeMs }
GET/accounts/{account_id}/dex/http-tests/{test_id}/percentiles

Get percentiles for an http test for a given time period between 1 hour and 7 days.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Cloudflare DEX WriteCloudflare DEX ReadZero Trust ReportZero Trust Read
ParametersExpand Collapse
testId: string

API Resource UUID tag.

maxLength36
params: PercentileGetParams { account_id, from, to, 2 more }
account_id: string

Path param: Unique identifier linked to an account.

maxLength32
from: string

Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format.

to: string

Query param: End time for the query in ISO (RFC3339 - ISO 8601) format.

colo?: string

Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.

deviceId?: Array<string>

Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.

ReturnsExpand Collapse
HTTPDetailsPercentiles { dnsResponseTimeMs, resourceFetchTimeMs, serverResponseTimeMs }
dnsResponseTimeMs?: Percentiles { p50, p90, p95, p99 }
p50?: number | null

p50 observed in the time period.

p90?: number | null

p90 observed in the time period.

p95?: number | null

p95 observed in the time period.

p99?: number | null

p99 observed in the time period.

resourceFetchTimeMs?: Percentiles { p50, p90, p95, p99 }
p50?: number | null

p50 observed in the time period.

p90?: number | null

p90 observed in the time period.

p95?: number | null

p95 observed in the time period.

p99?: number | null

p99 observed in the time period.

serverResponseTimeMs?: Percentiles { p50, p90, p95, p99 }
p50?: number | null

p50 observed in the time period.

p90?: number | null

p90 observed in the time period.

p95?: number | null

p95 observed in the time period.

p99?: number | null

p99 observed in the time period.

Get percentiles for an http test

import Cloudflare from 'cloudflare';

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

const httpDetailsPercentiles = await client.zeroTrust.dex.httpTests.percentiles.get(
  'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
  {
    account_id: '01a7362d577a6c3019a474fd6f485823',
    from: '2023-09-20T17:00:00Z',
    to: '2023-09-20T17:00:00Z',
  },
);

console.log(httpDetailsPercentiles.dnsResponseTimeMs);
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "dnsResponseTimeMs": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    },
    "resourceFetchTimeMs": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    },
    "serverResponseTimeMs": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    }
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "dnsResponseTimeMs": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    },
    "resourceFetchTimeMs": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    },
    "serverResponseTimeMs": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    }
  }
}