RADAR-base / RADAR-RestApi

RESTful interface to access near real-time data
Apache License 2.0
2 stars 0 forks source link

Received messages / Volume API #36

Closed afolarin closed 7 years ago

afolarin commented 7 years ago

To support the bottom volume plot (which is there to give an indication of where in a time-series there is data available. image

there are two possible options: 1) supply the sum of data for all sensors for the participant (acceptable) 2) provide the sum of data for the selected sensors on the dashboard (desirable but would be more complex i.e. probably requires caching the combinations of all different data sources)

In any case from the REST-API standpoint:

The received messages data should return a count of data points, so they should be whole numbers not decimals.

{
  "header": {
    "subjectId": "MRC01",
    "sourceId": "00:07:80:1F:52:F3",
    "source": "EMPATICA",
    "sensor": "BATTERY",
    "descriptiveStatistic": "RECEIVED_MESSAGES",
    "unit": "PERCENTAGE",
    "timeFrame": "TEN_SECOND",
    "effectiveTimeFrame": {
      "startDateTime": "2017-06-16T08:59:40Z",
      "endDateTime": "2017-06-16T12:04:20Z"
    }
  },
  "dataset": [
    {
      "sample": {
        "value": 1.4
      },
      "startDateTime": "2017-06-16T08:59:40Z"
    },
    {
      "sample": {
        "value": 1.3
      },
      "startDateTime": "2017-06-16T09:05:10Z"
    }
  ]
}

@blootsvoets this is available from the streams apps presently but not exposed via REST-api?

blootsvoets commented 7 years ago

@herkulano @afolarin I've just checked and this is already implemented. Instead of RECEIVED_MESSAGES, use the COUNT statistic.