Skip to content
Start here

Get percentiles for an http test

zero_trust.dex.http_tests.percentiles.get(strtest_id, PercentileGetParams**kwargs) -> HTTPDetailsPercentiles
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
account_id: str
maxLength32
test_id: str

API Resource UUID tag.

maxLength36
from_: str

Start time for the query in ISO (RFC3339 - ISO 8601) format

to: str

End time for the query in ISO (RFC3339 - ISO 8601) format

colo: Optional[str]

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

device_id: Optional[SequenceNotStr[str]]

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

ReturnsExpand Collapse
class HTTPDetailsPercentiles:
dns_response_time_ms: Optional[Percentiles]
p50: Optional[float]

p50 observed in the time period

p90: Optional[float]

p90 observed in the time period

p95: Optional[float]

p95 observed in the time period

p99: Optional[float]

p99 observed in the time period

resource_fetch_time_ms: Optional[Percentiles]
p50: Optional[float]

p50 observed in the time period

p90: Optional[float]

p90 observed in the time period

p95: Optional[float]

p95 observed in the time period

p99: Optional[float]

p99 observed in the time period

server_response_time_ms: Optional[Percentiles]
p50: Optional[float]

p50 observed in the time period

p90: Optional[float]

p90 observed in the time period

p95: Optional[float]

p95 observed in the time period

p99: Optional[float]

p99 observed in the time period

Get percentiles for an http test

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
http_details_percentiles = client.zero_trust.dex.http_tests.percentiles.get(
    test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    account_id="01a7362d577a6c3019a474fd6f485823",
    from_="2023-09-20T17:00:00Z",
    to="2023-09-20T17:00:00Z",
)
print(http_details_percentiles.dns_response_time_ms)
{
  "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
    }
  }
}