Difference between revisions of "Measurement"

From Senfi Docs
Jump to: navigation, search
Line 1: Line 1:
 
A '''measurement''' is used to represent time-series data that can originate from a device or a complex system.
 
A '''measurement''' is used to represent time-series data that can originate from a device or a complex system.
  
A measurement has a ''name'' and ''measurement code'', and is made up of
+
A measurement has a ''name'' (for display) and ''code'' (for integration), and is made up of
 
* Timestamp
 
* Timestamp
 
* Tags
 
* Tags
Line 24: Line 24:
 
These can be raw values from the sensing device (eg. <tt>rain_level</tt>), or derived values (eg. <tt>is_flooding</tt>). You can decide to compute the derived values by yourself and send it, or to make use of [[Computed_measurement|computed measurement]] to do it.
 
These can be raw values from the sensing device (eg. <tt>rain_level</tt>), or derived values (eg. <tt>is_flooding</tt>). You can decide to compute the derived values by yourself and send it, or to make use of [[Computed_measurement|computed measurement]] to do it.
  
Similar to measurement, each metric has a name (for display), and a code (for integration). You should also specify a valid type for the metric.
+
Similar to measurement, each metric has a ''name'' (for display), and a ''code'' (for integration). You should also specify a valid type for the metric.
 
; Name: Any valid text (eg. ''Rain level'')
 
; Name: Any valid text (eg. ''Rain level'')
 
; Code: Combination of lowercase alphanumeric characters and underscore (eg. <tt>rain_level</tt>)
 
; Code: Combination of lowercase alphanumeric characters and underscore (eg. <tt>rain_level</tt>)

Revision as of 14:51, 16 September 2019

A measurement is used to represent time-series data that can originate from a device or a complex system.

A measurement has a name (for display) and code (for integration), and is made up of

  • Timestamp
  • Tags
  • Metrics

Measurement Code

A measurement code is a unique identifier of this measurement. You can use a combination of lowercase alphanumeric characters and underscore.

  • The naming convention of a measurement code is as follows: <vendor>_<system>_<version>
  • For example: nest_thermostat_v1. If you make changes to the measurement (eg. adding or removing metrics), you should increment the version, eg. nest_thermostat_v2.
A measurement code cannot be changed after creation

Timestamp

When sending a measurement to Senfi, timestamp is represented as tm_source, milliseconds since epoch.

Take note that timestamp refers to when the reading or measurement is taken, not when it is sent. There can be cases where readings are taken first, and sent in a batch later. In this case, the timestamp of the measurement will be older than the time of sending.

Tags

Metrics

These can be raw values from the sensing device (eg. rain_level), or derived values (eg. is_flooding). You can decide to compute the derived values by yourself and send it, or to make use of computed measurement to do it.

Similar to measurement, each metric has a name (for display), and a code (for integration). You should also specify a valid type for the metric.

Name
Any valid text (eg. Rain level)
Code
Combination of lowercase alphanumeric characters and underscore (eg. rain_level)
Type
One of the following: boolean, float, number, string
Metric type cannot be changed after creation