Resource URL: /platform/<<version=1>>/statistics/history

    Overview: This resource allows querying of OneFS time-series statistics
              over custom time ranges. Not all statistics will have time-series
              enabled, and for those statistics with time-series enabled, the
              full extent of the requested time range may not be available due
              to configuration or system uptime. For a list of available
              statistics keys with descriptions, see the /1/statistics/keys or
              /1/statistics/keys/<KEY> resources. These resources also describe
              available history policies for each key. Warning: it is possible
              to request intervals and begin/end ranges that will exceed
              available memory.

     Methods: GET

********************************************************************************

Method GET: Retrieve stats.

       URL: GET /platform/<<version=1>>/statistics/history

Query arguments:
      begin=<integer> Earliest time (Unix epoch seconds) of interest. Negative
                      times are interpreted as relative (before) now.
       devid=<string> Node devid to query. Either an <integer> or "all". Can be
                      used more than one time to query multiple nodes. "all"
                      queries all up nodes. 0 means query the local node. For
                      "cluster" scoped keys, in any devid including 0 can be
                      used.
        end=<integer> Latest time (Unix epoch seconds) of interest. Negative
                      times are interpreted as relative (before) now. If not
                      supplied, use now as the end time.
         key=<string> One key name. Can be used more than one time to query
                      multiple keys. Also works with 'keys' arguments.
memory_only=<boolean> Only use statistics sources that reside in memory
                      (faster, but with less retention).
        keys=<string> Multiple key names. May request matching keys or request
                      'all' keys. Can be comma separated list or can be used
                      more than one time to make queries for multiple keys. May
                      be used in conjunction with 'substr'. Also works with
                      'key' arguments.
   interval=<integer> Minimum sampling interval time in seconds. If native
                      statistics are higher resolution, data will be
                      down-sampled.
     substr=<boolean> Used in conjunction with the 'keys' argument, alters the
                      behavior of keys. Makes the 'keys' arg perform a partial
                      match. Defaults to false.
      stale=<boolean> For internal use only, please do not use this.
  type_info=<boolean> The type ID is used by internal services. For internal
                      use only, please do not use this.
        raw=<boolean> Causes the output to be in hex format. For internal use
                      only, please do not use this.
    timeout=<integer> Time in seconds to wait for results from remote nodes.
       nodes=<string> Specify node(s) for which statistics should be reported.
                      One or more comma separated <integer(s)> specifying which
                      node(s) to query, or "all". Specifying more than one node
                      may have unspecified results for keys that begin with
                      "cluster".
 show_nodes=<boolean> Shows the logical node number or LNN in addition to the
                      devid.
 resolution=<integer> Synonymous with 'interval', if supplied supersedes
                      interval.
   degraded=<boolean> If true, try to continue even if some stats are
                      unavailable. In this case, errors will be present in the
                      per-key returned data.

GET response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "additionalProperties": false, 
      "type": "object", 
      "properties": {
        "stats": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "properties": {
              "error_code": {
                "required": true, 
                "type": [
                  "null", 
                  "integer"
                ], 
                "description": "Key specific error number, if applicable."
              }, 
              "devid": {
                "required": true, 
                "type": "integer", 
                "description": "Devid of node of statistic or 0 for cluster scoped statistics."
              }, 
              "values": {
                "items": {
                  "type": "object", 
                  "properties": {
                    "value": {
                      "required": true, 
                      "type": "any", 
                      "description": "Key dependent value."
                    }, 
                    "time": {
                      "required": true, 
                      "type": "integer", 
                      "description": "Unix Epoch time in seconds that statistic was collected."
                    }
                  }
                }, 
                "required": true, 
                "type": [
                  "null", 
                  "array"
                ], 
                "description": "Time-series values."
              }, 
              "key": {
                "required": true, 
                "type": "string", 
                "description": "Key name of statistic."
              }, 
              "error": {
                "required": true, 
                "type": [
                  "null", 
                  "string"
                ], 
                "description": "Key specific error string, if applicable."
              }, 
              "resolution": {
                "required": true, 
                "type": "integer", 
                "description": "The interval for which these results were figured (averaged against.)"
              }
            }
          }, 
          "type": "array", 
          "maxItems": 4294967295
        }
      }
    }
  ]
}
