Test Metrics Resources

Retrieve the metrics shown on the Runscope dashboard of a given test by ID.

Test Metrics

A list of metrics for a given test, including average response time, success ratio, and overall changes in performance compared to the previous time period.

Request

GET/buckets/<bucket_key>/tests/<test_id>/metrics

Filter Parameters
region string optional The region code for the test service region you wish to get results from. E.g.: us1 for US Virginia location. Default value is all.
timeframe string optional The timeframe you want to filter your results. Default value is day. Accepted values are hour, day, week, and month.
environment_uuid string optional Filter the metrics results by a given environment ID. Default value is all.

Response

Returns an array of test response times with an interval of minutes/hours/days, depending on the timeframe filter you use when making the request. Each response time object contains the success_ratio (between 0.0, all fails, to 1.0, all passes), timestamp in Unix format, and avg_response_time_ms properties.

The response also includes two objects: this_time_period, which includes the average response time in milliseconds of all the data points that fall within the 50th, 95th, and 99th percentile, and change_from_last_period, which includes the difference in response time for the same percentiles. For example, if you have the property response_time_99th_percentile: 43.91291 in this_time_period, that means that the average response time of 99% of your tests fall at or under 43.9ms, and 1% fall above.

You can use those values to have a better idea if your tests have been getting slower, consistent, or faster, as time progresses.

Sample Response Data
{
    "response_times":[
        {
            "success_ratio":0.3333333333333333,
            "timestamp":1494964800,
            "avg_response_time_ms":44
        },
        {
            "success_ratio":1.0,
            "timestamp":1494968400,
            "avg_response_time_ms":35
        },
        {
            "success_ratio":0.4,
            "timestamp":1494972000,
            "avg_response_time_ms":40
        },
        {
            "success_ratio":0.5517241379310345,
            "timestamp":1494975600,
            "avg_response_time_ms":39
        },
        {
            "success_ratio":1.0,
            "timestamp":1494979200,
            "avg_response_time_ms":41
        },
        {
            "success_ratio":0.956081081081081,
            "timestamp":1494982800,
            "avg_response_time_ms":68
        },
        {
            "success_ratio":1.0,
            "timestamp":1494986400,
            "avg_response_time_ms":105
        },
        {
            "success_ratio":1.0,
            "timestamp":1494990000,
            "avg_response_time_ms":38
        },
        {
            "success_ratio":1.0,
            "timestamp":1494993600,
            "avg_response_time_ms":37
        },
        {
            "success_ratio":1.0,
            "timestamp":1494997200,
            "avg_response_time_ms":44
        },
        {
            "success_ratio":1.0,
            "timestamp":1495000800,
            "avg_response_time_ms":36
        },
        {
            "success_ratio":1.0,
            "timestamp":1495004400,
            "avg_response_time_ms":36
        },
        {
            "success_ratio":1.0,
            "timestamp":1495008000,
            "avg_response_time_ms":48
        },
        {
            "success_ratio":0.9965397923875432,
            "timestamp":1495011600,
            "avg_response_time_ms":46
        },
        {
            "success_ratio":1.0,
            "timestamp":1495015200,
            "avg_response_time_ms":45
        },
        {
            "success_ratio":1.0,
            "timestamp":1495018800,
            "avg_response_time_ms":52
        },
        {
            "success_ratio":1.0,
            "timestamp":1495022400,
            "avg_response_time_ms":90
        },
        {
            "success_ratio":1.0,
            "timestamp":1495026000,
            "avg_response_time_ms":83
        },
        {
            "success_ratio":1.0,
            "timestamp":1495029600,
            "avg_response_time_ms":47
        },
        {
            "success_ratio":1.0,
            "timestamp":1495033200,
            "avg_response_time_ms":44
        },
        {
            "success_ratio":1.0,
            "timestamp":1495036800,
            "avg_response_time_ms":43
        },
        {
            "success_ratio":1.0,
            "timestamp":1495040400,
            "avg_response_time_ms":44
        },
        {
            "success_ratio":1.0,
            "timestamp":1495044000,
            "avg_response_time_ms":37
        },
        {
            "success_ratio":0.5714285714285714,
            "timestamp":1495047600,
            "avg_response_time_ms":29
        }
    ],
    "change_from_last_period":{
        "response_time_50th_percentile":0.05284147557328004,
        "response_time_99th_percentile":-0.03965577026132455,
        "total_test_runs":0.0313588850174216,
        "response_time_95th_percentile":0.2567257314416911
    },
    "environment_uuid":"all",
    "region":"all",
    "timeframe":"day",
    "this_time_period":{
        "response_time_50th_percentile":44.0,
        "response_time_99th_percentile":101.54999999999998,
        "total_test_runs":296,
        "response_time_95th_percentile":88.94999999999997
    }
}