github.com/go-graphite/carbonapi@v0.17.0/cmd/mockbackend/testcases/sortBy/sortBy.yaml (about)

     1  version: "v1"
     2  test:
     3      apps:
     4          - name: "carbonapi"
     5            binary: "./carbonapi"
     6            args:
     7                - "-config"
     8                - "./cmd/mockbackend/carbonapi_singlebackend.yaml"
     9      queries:
    10              - endpoint: "http://127.0.0.1:8081"
    11                delay: 1
    12                type: "GET"
    13                URL: "/render?format=json&target=limit(sortByMaxima(metric*),2)"
    14                expectedResponse:
    15                    httpCode: 200
    16                    contentType: "application/json"
    17                    expectedResults:
    18                            - metrics:
    19                                    - target: "metricZ2"
    20                                      datapoints: [[8.0, 1],[1.0, 2],[1.0, 3],[7.0, 4],[4.0, 5]]
    21                                    - target: "metricZ1"
    22                                      datapoints: [[4.0, 1],[6.0, 2],[2.0, 3],[2.0, 4],[3.0, 5]]
    23              - endpoint: "http://127.0.0.1:8081"
    24                delay: 1
    25                type: "GET"
    26                URL: "/render?format=json&target=limit(sortByMaxima(metric*),3)"
    27                expectedResponse:
    28                    httpCode: 200
    29                    contentType: "application/json"
    30                    expectedResults:
    31                            - metrics:
    32                                    - target: "metricZ2"
    33                                      datapoints: [[8.0, 1],[1.0, 2],[1.0, 3],[7.0, 4],[4.0, 5]]
    34                                    - target: "metricZ1"
    35                                      datapoints: [[4.0, 1],[6.0, 2],[2.0, 3],[2.0, 4],[3.0, 5]]
    36                                    - target: "metricNaN"
    37                                      datapoints: [["null", 1],["null", 2],["null", 3],["null", 4],["null", 5]]    
    38  
    39  listeners:
    40          - address: ":9070"
    41            expressions:
    42              "metric*":
    43                  pathExpression: "metric*"
    44                  data:
    45                      - metricName: "metricNaN"
    46                        values: [.NaN, .NaN, .NaN, .NaN, .NaN]
    47                        step: 1
    48                        startTime: 1
    49                      - metricName: "metricZ1"
    50                        values: [4.0, 6.0, 2.0, 2.0, 3.0]
    51                        step: 1
    52                        startTime: 1
    53                      - metricName: "metricZ2"
    54                        values: [8.0, 1.0, 1.0, 7.0, 4.0]
    55                        step: 1
    56                        startTime: 1