get-private-statistics-counter-SLUG.rst (2576B)
1 .. http:get:: /management/instances/$INSTANCE/statistics-counter/$SLUG 2 .. http:get:: [/instances/$INSTANCE]/private/statistics-counter/$SLUG 3 4 This request will return be used to statistics where the 5 values are counters. All available values for the given 6 SLUG will be returned. 7 Since protocol **v25**. 8 9 **Required permission:** ``statistics-read`` 10 11 **Request:** 12 13 :query by: *Optional*. If set to "BUCKET", only statistics by bucket will be returned. If set to "INTERVAL", only statistics kept by interval will be returned. If not set or set to "ANY", both will be returned. 14 15 **Response:** 16 17 :http:statuscode:`200 Ok`: 18 The body will be a `MerchantStatisticsCounterResponse` 19 :http:statuscode:`400 Bad Request`: 20 The ``by`` parameter is malformed. 21 Returned with ``TALER_EC_GENERIC_PARAMETER_MALFORMED``. 22 :http:statuscode:`401 Unauthorized`: 23 The request is unauthorized. 24 :http:statuscode:`404 Not found`: 25 The instance is unknown to the backend. 26 :http:statuscode:`500 Internal Server Error`: 27 The server experienced an internal failure. 28 Returned with ``TALER_EC_GENERIC_DB_FETCH_FAILED``. 29 30 **Details:** 31 32 .. ts:def:: MerchantStatisticsCounterResponse 33 34 interface MerchantStatisticsCounterResponse { 35 36 // Statistics kept for a particular fixed time window. 37 buckets: MerchantStatisticCounterByBucket[]; 38 39 // Human-readable bucket statistic description. 40 // Unset if no buckets returned 41 buckets_description?: string; 42 43 // Statistics kept for a particular sliding interval. 44 intervals: MerchantStatisticCounterByInterval[]; 45 46 // Human-readable interval statistic description. 47 // Unset if no intervals returned 48 intervals_description?: string; 49 50 } 51 52 .. ts:def:: MerchantStatisticCounterByBucket 53 54 interface MerchantStatisticCounterByBucket { 55 56 // Start time of the bucket (inclusive) 57 start_time: Timestamp; 58 59 // End time of the bucket (exclusive) 60 end_time: Timestamp; 61 62 // Range of the bucket 63 range: StatisticBucketRange; 64 65 // Sum of all counters falling under the given 66 // SLUG within this timeframe. 67 cumulative_counter: Integer; 68 69 } 70 71 .. ts:def:: MerchantStatisticCounterByInterval 72 73 interface MerchantStatisticCounterByInterval { 74 75 // Start time of the interval. 76 // The interval always ends at the response 77 // generation time. 78 start_time: Timestamp; 79 80 // Sum of all counters falling under the given 81 // SLUG within this timeframe. 82 cumulative_counter: Integer; 83 84 }