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

     1  version: "v1"
     2  test:
     3      apps:
     4          - name: "carbonapi"
     5            binary: "./carbonapi"
     6            args:
     7                - "-config"
     8                - "./cmd/mockbackend/testcases/consolidateBy/carbonapi.yaml"
     9      queries:
    10              - endpoint: "http://127.0.0.1:8081"
    11                type: "GET"
    12                URL: "/render?format=json&target=consolidateBy(metric*, 'max')&maxDataPoints=2"
    13                expectedResponse:
    14                    httpCode: 200
    15                    contentType: "application/json"
    16              - endpoint: "http://127.0.0.1:8081"
    17                type: "GET"
    18                URL: "/render?format=json&target=consolidateBy(metric*, 'min')&maxDataPoints=2"
    19                expectedResponse:
    20                    httpCode: 200
    21                    contentType: "application/json"
    22              - endpoint: "http://127.0.0.1:8081"
    23                type: "GET"
    24                URL: "/render?format=json&target=consolidateBy(metric*, 'sum')&maxDataPoints=2"
    25                expectedResponse:
    26                    httpCode: 200
    27                    contentType: "application/json"
    28              - endpoint: "http://127.0.0.1:8081"
    29                type: "GET"
    30                URL: "/render?format=json&target=consolidateBy(metric*, 'avg')&maxDataPoints=2"
    31                expectedResponse:
    32                    httpCode: 200
    33                    contentType: "application/json"
    34              - endpoint: "http://127.0.0.1:8081"
    35                type: "GET"
    36                URL: "/render?format=json&target=consolidateBy(metric*, 'average')&maxDataPoints=2"
    37                expectedResponse:
    38                    httpCode: 200
    39                    contentType: "application/json"
    40              - endpoint: "http://127.0.0.1:8081"
    41                type: "GET"
    42                URL: "/render?format=json&target=consolidateBy(metric*, 'last')&maxDataPoints=2"
    43                expectedResponse:
    44                    httpCode: 200
    45                    contentType: "application/json"
    46              - endpoint: "http://127.0.0.1:8081"
    47                type: "GET"
    48                URL: "/render?format=json&target=consolidateBy(metric*, 'first')&maxDataPoints=2"
    49                expectedResponse:
    50                    httpCode: 200
    51                    contentType: "application/json"
    52              - endpoint: "http://127.0.0.1:8081"
    53                type: "GET"
    54                URL: "/render?format=json&target=consolidateBy(metric*, 'maximum')&maxDataPoints=2"
    55                expectedResponse:
    56                    httpCode: 400
    57                    contentType: "text/plain; charset=utf-8"
    58              - endpoint: "http://127.0.0.1:8081"
    59                type: "GET"
    60                URL: "/render?format=json&target=consolidateBy(metric*, 'minimum')&maxDataPoints=2"
    61                expectedResponse:
    62                    httpCode: 400
    63                    contentType: "text/plain; charset=utf-8"   
    64              - endpoint: "http://127.0.0.1:8081"
    65                type: "GET"
    66                URL: "/render?format=json&target=consolidateBy(metric*, 'somefunc')&maxDataPoints=2"
    67                expectedResponse:
    68                    httpCode: 400
    69                    contentType: "text/plain; charset=utf-8"
    70              - endpoint: "http://127.0.0.1:8081"
    71                type: "GET"
    72                URL: "/render?format=json&target=limit(metric*, 2)&maxDataPoints=2"
    73                expectedResponse:
    74                    httpCode: 200
    75                    contentType: "application/json"
    76              - endpoint: "http://127.0.0.1:8081"
    77                type: "GET"
    78                URL: "/render?format=json&target=consolidateBy(seriesByTag('name=rps', 'env=prod'), 'sum')&maxDataPoints=2"
    79                expectedResponse:
    80                    httpCode: 200
    81                    contentType: "application/json"    
    82                 
    83  
    84  listeners:
    85          - address: ":9070"
    86            expressions:
    87              "metric*":
    88                  pathExpression: "metric*"
    89                  data:
    90                      - metricName: "metricNaN"
    91                        values: [.NaN, .NaN, .NaN, .NaN, .NaN]
    92                        step: 1
    93                        startTime: 1
    94                      - metricName: "metricZ1"
    95                        values: [4.0, 6.0, 2.0, 2.0, 3.0]
    96                        step: 1
    97                        startTime: 1
    98                      - metricName: "metricZ2"
    99                        values: [8.0, 1.0, 1.0, 7.0, 4.0]
   100                        step: 1
   101                        startTime: 1