taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

get-private-statistics-counter-SLUG.rst (2287B)


      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:`401 Unauthorized`:
     20     The request is unauthorized.
     21   :http:statuscode:`404 Not found`:
     22     The instance is unknown to the backend.
     23 
     24   **Details:**
     25 
     26   .. ts:def:: MerchantStatisticsCounterResponse
     27 
     28     interface MerchantStatisticsCounterResponse {
     29 
     30       // Statistics kept for a particular fixed time window.
     31       buckets: MerchantStatisticCounterByBucket[];
     32 
     33       // Human-readable bucket statistic description.
     34       // Unset if no buckets returned
     35       buckets_description?: string;
     36 
     37       // Statistics kept for a particular sliding interval.
     38       intervals: MerchantStatisticCounterByInterval[];
     39 
     40       // Human-readable interval statistic description.
     41       // Unset if no intervals returned
     42       intervals_description?: string;
     43 
     44     }
     45 
     46   .. ts:def:: MerchantStatisticCounterByBucket
     47 
     48     interface MerchantStatisticCounterByBucket {
     49 
     50       // Start time of the bucket (inclusive)
     51       start_time: Timestamp;
     52 
     53       // End time of the bucket (exclusive)
     54       end_time: Timestamp;
     55 
     56       // Range of the bucket
     57       range: StatisticBucketRange;
     58 
     59       // Sum of all counters falling under the given
     60       // SLUG within this timeframe.
     61       cumulative_counter: Integer;
     62 
     63     }
     64 
     65   .. ts:def:: MerchantStatisticCounterByInterval
     66 
     67     interface MerchantStatisticCounterByInterval {
     68 
     69       // Start time of the interval.
     70       // The interval always ends at the response
     71       // generation time.
     72       start_time: Timestamp;
     73 
     74       // Sum of all counters falling under the given
     75       // SLUG within this timeframe.
     76       cumulative_counter: Integer;
     77 
     78     }