Difference between revisions of "V2/Concepts/Intro to Measurement"
(Created page with "<h1 class="main-heading">Measurement</h1> Senfi deals with data in a [https://en.wikipedia.org/wiki/Time_series time series]. Each record in this time series consists of: * a...") |
|||
Line 1: | Line 1: | ||
<h1 class="main-heading">Measurement</h1> | <h1 class="main-heading">Measurement</h1> | ||
− | Senfi deals with | + | Senfi deals with [https://en.wikipedia.org/wiki/Time_series time series]data that can originate from a device or a complex system. Each record in this time series consists of: |
* a timestamp indicating when the data was sampled (in milliseconds) | * a timestamp indicating when the data was sampled (in milliseconds) | ||
* a fixed set of tags | * a fixed set of tags | ||
* a fixed set of metrics | * a fixed set of metrics | ||
− | All these records are kept in a dataset called a ''measurement''. | + | All these records are kept in a dataset called a ''measurement''. A measurement has a ''name'' (for display) and ''code'' (for integration). |
+ | |||
+ | === 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: <tt><vendor>_<system>_<version></tt> | ||
+ | * For example: <tt>nest_thermostat_v1</tt>. If you need to make changes to the measurement (eg. adding or removing metrics), you should create a new measurement with an incremented version, eg. <tt>nest_thermostat_v2</tt>. | ||
+ | |||
+ | <div class="important">A measurement code cannot be changed after creation</div> | ||
+ | |||
+ | === Timestamp === | ||
+ | When sending a measurement to Senfi, timestamp is represented as <tt>tm_source</tt>, 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. |
Revision as of 17:03, 24 June 2021
Measurement
Senfi deals with time seriesdata that can originate from a device or a complex system. Each record in this time series consists of:
- a timestamp indicating when the data was sampled (in milliseconds)
- a fixed set of tags
- a fixed set of metrics
All these records are kept in a dataset called a measurement. A measurement has a name (for display) and code (for integration).
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 need to make changes to the measurement (eg. adding or removing metrics), you should create a new measurement with an incremented version, eg. nest_thermostat_v2.
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.