Skip to content
Start here

Get percentiles for a traceroute test

client.ZeroTrust.DEX.TracerouteTests.Percentiles(ctx, testID, params) (*DEXTracerouteTestPercentilesResponse, error)
GET/accounts/{account_id}/dex/traceroute-tests/{test_id}/percentiles

Get percentiles for a traceroute 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 DEXTracerouteTestPercentilesParams
AccountID param.Field[string]

Path param: unique identifier linked to an account in the API request path.

maxLength32
From param.Field[string]

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

To param.Field[string]

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

Colo param.Field[string]optional

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

DeviceID param.Field[[]string]optional

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

ReturnsExpand Collapse
type DEXTracerouteTestPercentilesResponse struct{…}
HopsCount Percentilesoptional
P50 float64optional

p50 observed in the time period

P90 float64optional

p90 observed in the time period

P95 float64optional

p95 observed in the time period

P99 float64optional

p99 observed in the time period

PacketLossPct Percentilesoptional
P50 float64optional

p50 observed in the time period

P90 float64optional

p90 observed in the time period

P95 float64optional

p95 observed in the time period

P99 float64optional

p99 observed in the time period

RoundTripTimeMs Percentilesoptional
P50 float64optional

p50 observed in the time period

P90 float64optional

p90 observed in the time period

P95 float64optional

p95 observed in the time period

P99 float64optional

p99 observed in the time period

Get percentiles for a traceroute test

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/zero_trust"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.ZeroTrust.DEX.TracerouteTests.Percentiles(
    context.TODO(),
    "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    zero_trust.DEXTracerouteTestPercentilesParams{
      AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"),
      From: cloudflare.F("2023-09-20T17:00:00Z"),
      To: cloudflare.F("2023-09-20T17:00:00Z"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.HopsCount)
}
{
  "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": {
    "hopsCount": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    },
    "packetLossPct": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    },
    "roundTripTimeMs": {
      "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": {
    "hopsCount": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    },
    "packetLossPct": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    },
    "roundTripTimeMs": {
      "p50": 0,
      "p90": 0,
      "p95": 0,
      "p99": 0
    }
  }
}