Statistics

Statistics are information generated by the Atlas system to describe it’s working conditions.

Requesting statistics

Requesting statistics from the system can be done in a variety of ways. You can simply ask for a list of statistics, or get the most recent, or ask the system to perform averaging of statistics over given time periods

List Statistics

Call to /statistic/list to get a listing of matching statistics

Request Object

+ URL
  /api/v2/statistic/list

+ Method
  POST

+ Parameters
  probe_name (string, required, BODY) - the name of the probe that created the statistics
  nth (number, optional, BODY) - if there are too many statistics, you may select only the nth statistic, for example selecting nth=3 of [1, 2, 3, 4, 5, 6] will yield [3, 6]
  startMoment (date, optional, BODY) - when we should start listing statistics from, if sent. as ISO String
  endMoment (date, optional, BODY) - when we should stop listing statistics from, if sent, as ISO String

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "probe_name": "pool_usage",
    "startMoment": "2020-09-22T18:00:09.931Z"
  }

Response Object

Sending this should get you back a valid response, an object with rows of info, as well as the row count

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
  "rows": [
    {
      "updatedAt": "2020-09-22T18:01:50.623Z",
      "createdAt": "2020-09-22T18:01:50.623Z",
      "hostid": "09e3b2bd",
      "pool_name": "C01",
      "size": "3985729650688",
      "alloc": "33061035008",
      "free": "3952668615680",
      "dedup": "1.00",
      "raw": {
        "cap": "0",
        "free": "3952668615680",
        "name": "C01",
        "size": "3985729650688",
        "alloc": "33061035008",
        "dedup": "1.00",
        "health": "ONLINE",
        "altroot": "",
        "expandsz": "",
        "multihost": "off",
        "autoexpand": "off"
      }
    },
    {
      "updatedAt": "2020-09-22T18:01:50.623Z",
      "createdAt": "2020-09-22T18:01:50.623Z",
      "hostid": "09e3b2bd",
      "pool_name": "rpool",
      "size": "119185342464",
      "alloc": "32175554560",
      "free": "87009787904",
      "dedup": "1.00",
      "raw": {
        "cap": "26",
        "free": "87009787904",
        "name": "rpool",
        "size": "119185342464",
        "alloc": "32175554560",
        "dedup": "1.00",
        "health": "ONLINE",
        "altroot": "",
        "expandsz": "",
        "multihost": "off",
        "autoexpand": "off"
      }
    },
    {
      "updatedAt": "2020-09-22T18:16:50.627Z",
      "createdAt": "2020-09-22T18:16:50.627Z",
      "hostid": "09e3b2bd",
      "pool_name": "D01",
      "size": "11991548690432",
      "alloc": "17686528",
      "free": "11991531003904",
      "dedup": "1.00",
      "raw": {
        "cap": "0",
        "free": "11991531003904",
        "name": "D01",
        "size": "11991548690432",
        "alloc": "17686528",
        "dedup": "1.00",
        "health": "ONLINE",
        "altroot": "",
        "expandsz": "",
        "multihost": "on",
        "autoexpand": "off"
      }
    },
    {
      "updatedAt": "2020-09-22T18:21:50.615Z",
      "createdAt": "2020-09-22T18:21:50.615Z",
      "hostid": "09e3b2bd",
      "pool_name": "D01",
      "size": "11991548690432",
      "alloc": "17462272",
      "free": "11991531228160",
      "dedup": "1.00",
      "raw": {
        "cap": "0",
        "free": "11991531228160",
        "name": "D01",
        "size": "11991548690432",
        "alloc": "17462272",
        "dedup": "1.00",
        "health": "ONLINE",
        "altroot": "",
        "expandsz": "",
        "multihost": "on",
        "autoexpand": "off"
      }
    }
  ],
  "availableRowCount": 3
  }

Get Recent Statistics

Call to /statistic/recent to get recent statistics

Request Object

+ URL
  /api/v2/statistic/recent

+ Method
  POST

+ Parameters
  probe_name (string, required, BODY) - the name of the probe that created the statistics
  minutes (number, optional, BODY) - the integer number of minutes we should look back to get recency, defaults to 10, is overridden by startMoment
  startMoment (date, optional, BODY) - when we should start retrieving recent statistics from, if sent. as ISO String

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "probe_name": "pool_usage"
  }

Response Object

Sending this should get you back a valid response, an array of matching statistics

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
        "updatedAt": "2020-09-22T18:34:51.474Z",
        "createdAt": "2020-09-22T18:34:51.474Z",
        "hostid": "09e3b2bd",
        "pool_name": "rpool",
        "size": "119185342464",
        "alloc": "41765679104",
        "free": "77419663360",
        "dedup": "1.00",
        "raw": {
            "cap": "35",
            "free": "77419663360",
            "name": "rpool",
            "size": "119185342464",
            "alloc": "41765679104",
            "dedup": "1.00",
            "health": "ONLINE",
            "altroot": "",
            "expandsz": "",
            "multihost": "off",
            "autoexpand": "off"
        }
    },
    {
        "updatedAt": "2020-09-22T18:34:51.474Z",
        "createdAt": "2020-09-22T18:34:51.474Z",
        "hostid": "09e3b2bd",
        "pool_name": "D01",
        "size": "11991548690432",
        "alloc": "17661952",
        "free": "11991531028480",
        "dedup": "1.00",
        "raw": {
            "cap": "0",
            "free": "11991531028480",
            "name": "D01",
            "size": "11991548690432",
            "alloc": "17661952",
            "dedup": "1.00",
            "health": "ONLINE",
            "altroot": "",
            "expandsz": "",
            "multihost": "on",
            "autoexpand": "off"
        }
    },
    {
        "updatedAt": "2020-09-22T18:34:51.474Z",
        "createdAt": "2020-09-22T18:34:51.474Z",
        "hostid": "09e3b2bd",
        "pool_name": "C01",
        "size": "3985729650688",
        "alloc": "33061035008",
        "free": "3952668615680",
        "dedup": "1.00",
        "raw": {
            "cap": "0",
            "free": "3952668615680",
            "name": "C01",
            "size": "3985729650688",
            "alloc": "33061035008",
            "dedup": "1.00",
            "health": "ONLINE",
            "altroot": "",
            "expandsz": "",
            "multihost": "off",
            "autoexpand": "off"
        }
    }
  ]

let probe_name = req.body.probe_name; let range = req.body.range || 1; let rangeUnit = req.body.rangeUnit || hour; let average = req.body.average || 10; let averageUnit = req.body.averageUnit || minute; const startMoment = req.body.startMoment; const endMoment = req.body.endMoment;

Average Statistics

Call to /statistic/average to get a average of matching statistics

Request Object

+ URL
  /api/v2/statistic/average

+ Method
  POST

+ Parameters
  probe_name (string, required, BODY) - the name of the probe that created the statistics
  range (number, optional, BODY) - the range over which to average statistics, defaults to 1
  rangeUnit (string, optional, BODY) - the unit of range over which to average statistics, defaults to 'hour', range and range unit combine: '1 hour'
  average (number, optional, BODY) - the time interval used to average statistics, defaults to 10
  averageUnit (string, optional, BODY) - the unit of interval to average statistics, defaults to 'minute', average and average unit combine: '10 minute'
  startMoment (date, optional, BODY) - when we should start averaging statistics from, if sent. as ISO String
  endMoment (date, optional, BODY) - when we should stop averaging statistics from, if sent, as ISO String

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "probe_name": "pool_usage",
    "startMoment": "2020-09-22T18:00:09.931Z"
  }

Response Object

Sending this should get you back a valid response, an array containing averaged data, with date of the interval it started pulling from.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
        "hostid": "09e3b2bd",
        "pool_name": "C01",
        "dedup": "1.00",
        "size": "3985729650688.0000",
        "alloc": "33061035008.00000000",
        "free": "3952668615680.0000",
        "date": "2020-09-22T18:00:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "D01",
        "dedup": "1.00",
        "size": "11991548690432.0000",
        "alloc": "17523712.000000000000",
        "free": "11991531166720.0000",
        "date": "2020-09-22T18:00:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "rpool",
        "dedup": "1.00",
        "size": "119185342464.00000000",
        "alloc": "32173649920.00000000",
        "free": "87011692544.00000000",
        "date": "2020-09-22T18:00:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "C01",
        "dedup": "1.00",
        "size": "3985729650688.0000",
        "alloc": "33061035008.00000000",
        "free": "3952668615680.0000",
        "date": "2020-09-22T18:10:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "D01",
        "dedup": "1.00",
        "size": "11991548690432.0000",
        "alloc": "17672704.000000000000",
        "free": "11991531017728.0000",
        "date": "2020-09-22T18:10:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "rpool",
        "dedup": "1.00",
        "size": "119185342464.00000000",
        "alloc": "32172161024.00000000",
        "free": "87013181440.00000000",
        "date": "2020-09-22T18:10:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "C01",
        "dedup": "1.00",
        "size": "3985729650688.0000",
        "alloc": "33061035008.00000000",
        "free": "3952668615680.0000",
        "date": "2020-09-22T18:20:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "D01",
        "dedup": "1.00",
        "size": "11991548690432.0000",
        "alloc": "17543680.000000000000",
        "free": "11991531146752.0000",
        "date": "2020-09-22T18:20:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "rpool",
        "dedup": "1.00",
        "size": "119185342464.00000000",
        "alloc": "39180740608.00000000",
        "free": "80004601856.00000000",
        "date": "2020-09-22T18:20:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "C01",
        "dedup": "1.00",
        "size": "3985729650688.0000",
        "alloc": "33061035008.00000000",
        "free": "3952668615680.0000",
        "date": "2020-09-22T18:30:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "D01",
        "dedup": "1.00",
        "size": "11991548690432.0000",
        "alloc": "17652736.000000000000",
        "free": "11991531037696.0000",
        "date": "2020-09-22T18:30:00.000Z"
    },
    {
        "hostid": "09e3b2bd",
        "pool_name": "rpool",
        "dedup": "1.00",
        "size": "119185342464.00000000",
        "alloc": "41765232640.00000000",
        "free": "77420109824.00000000",
        "date": "2020-09-22T18:30:00.000Z"
    }
  ]