# Stats

# Get stats for a test

GET /teams/:team/tests/:test/stats

curl --request GET \
  --url http://api.synthetigo.dev/teams/{team}/tests/{test}/stats \
  --header 'Authorization: Bearer {token}'

# Parameters

Name Kind Type Description Required
team string url The ID of the team Yes
test string url The ID of the test Yes

Format: json

{
  "total_executions": 1148,
  "total_errors": 4,
  "total_duration": 58661942160,
  "history": {
    "2024-12-29T22:00:00Z": {
      "executions": 14,
      "errors": 0,
      "duration": 551723724
    },
    "2024-12-29T23:00:00Z": {
      "executions": 17,
      "errors": 1,
      "duration": 481102611
    },
    "2024-12-30T12:00:00Z": {
      "executions": 37,
      "errors": 0,
      "duration": 1162943768
    },
    "2024-12-30T13:00:00Z": {
      "executions": 19,
      "errors": 0,
      "duration": 541587477
    },
    "2024-12-30T14:00:00Z": {
      "executions": 8,
      "errors": 1,
      "duration": 8266010778
    },
    "2024-12-30T15:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 2447682802
    },
    "2024-12-30T16:00:00Z": {
      "executions": 43,
      "errors": 0,
      "duration": 6522541616
    },
    "2024-12-30T18:00:00Z": {
      "executions": 44,
      "errors": 0,
      "duration": 1337513167
    },
    "2024-12-30T19:00:00Z": {
      "executions": 54,
      "errors": 0,
      "duration": 2698386014
    },
    "2024-12-30T20:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 2067873287
    },
    "2024-12-30T21:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 2160956690
    },
    "2024-12-30T22:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 2020829644
    },
    "2024-12-30T23:00:00Z": {
      "executions": 31,
      "errors": 0,
      "duration": 1006491172
    },
    "2024-12-31T00:00:00Z": {
      "executions": 9,
      "errors": 0,
      "duration": 528954879
    },
    "2024-12-31T01:00:00Z": {
      "executions": 34,
      "errors": 1,
      "duration": 886831681
    },
    "2024-12-31T10:00:00Z": {
      "executions": 9,
      "errors": 0,
      "duration": 311905842
    },
    "2024-12-31T11:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 2251301983
    },
    "2024-12-31T12:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 2167162788
    },
    "2024-12-31T13:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 2030311101
    },
    "2024-12-31T14:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 2055871541
    },
    "2024-12-31T15:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 1779875602
    },
    "2024-12-31T16:00:00Z": {
      "executions": 23,
      "errors": 0,
      "duration": 654916900
    },
    "2024-12-31T17:00:00Z": {
      "executions": 56,
      "errors": 0,
      "duration": 7020607114
    },
    "2024-12-31T18:00:00Z": {
      "executions": 59,
      "errors": 0,
      "duration": 1855781489
    },
    "2024-12-31T19:00:00Z": {
      "executions": 60,
      "errors": 0,
      "duration": 1954539281
    },
    "2024-12-31T20:00:00Z": {
      "executions": 56,
      "errors": 1,
      "duration": 2005098182
    },
    "2024-12-31T21:00:00Z": {
      "executions": 35,
      "errors": 0,
      "duration": 1893141027
    }
  }
}

# Get test metrics

GET /teams/:team/tests/:test/metrics

curl --request GET \
  --url http://api.synthetigo.dev/teams/{team}/tests/{test}/metrics \
  --header 'Authorization: Bearer {token}'

# Parameters

Name Kind Type Description Required
team string url The ID of the team Yes
test string url The ID of the test Yes

Format: text

# HELP synthetigo_test_duration_seconds_total The number of seconds the latest execution took
# TYPE synthetigo_test_duration_seconds_total gauge
synthetigo_test_duration_seconds_total{id="0193e9a4-9db6-76d7-b43e-09a1a11af58c"} 0.260521954
# HELP synthetigo_test_execution_duration_seconds_total The total duration of test executions in seconds
# TYPE synthetigo_test_execution_duration_seconds_total counter
synthetigo_test_execution_duration_seconds_total{id="0193e9a4-9db6-76d7-b43e-09a1a11af58c"} 169
# HELP synthetigo_test_executions_total The total number of test executions
# TYPE synthetigo_test_executions_total counter
synthetigo_test_executions_total{id="0193e9a4-9db6-76d7-b43e-09a1a11af58c"} 1621
# HELP synthetigo_test_failures_total The total number of test errors
# TYPE synthetigo_test_failures_total counter
synthetigo_test_failures_total{id="0193e9a4-9db6-76d7-b43e-09a1a11af58c"} 5
# HELP synthetigo_test_seconds_since_last_execution The number of seconds since the last test execution
# TYPE synthetigo_test_seconds_since_last_execution gauge
synthetigo_test_seconds_since_last_execution{id="0193e9a4-9db6-76d7-b43e-09a1a11af58c"} 19.367117077
# HELP synthetigo_test_status The status of the latest result (1=OK, 0=ERROR)
# TYPE synthetigo_test_status gauge
synthetigo_test_status{id="0193e9a4-9db6-76d7-b43e-09a1a11af58c"} 1