# Sampling

The following sampling modes are available to represent continuous quantity as a time series: None, Discrete, and Analog. In fact these modes define whether the insert of extra sample between the current and the new samples is required or not.

Find more information about the presentation modes below. Please note that in all the images presented below the points indicate the samples that were written in a store. Data source was changing as follows:

| **Time**                | **Value** |
| ----------------------- | --------- |
| 2019-09-17 21:41:23.538 | 0.00      |
| 2019-09-17 21:42:12.818 | 80.00     |
| 2019-09-17 21:42:36.163 | 20.00     |
| 2019-09-17 21:42:40.182 | 50.00     |
| 2019-09-17 21:42:56.916 | 0.00      |

**None Mode**. In this mode extra sample is not created, values are sent to a store as they are.&#x20;

![](https://4282443477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3cwznMbQcEQxtnjiRDYX%2Fuploads%2FOt2YMdQJI5VxPoVXsbPf%2FSampling%20\(360034374932\)_image-0.png?alt=media\&token=30747e5e-7d7a-4f10-969f-7192ecd05dc4)

**Discrete Mode**. In this mode before each new sample new extra sample is created. Its value is equal to the current sample, but time differs 1 millisecond from the new one.<br>

![](https://4282443477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3cwznMbQcEQxtnjiRDYX%2Fuploads%2Fyc1q9rwix8Y9jCn1zw5H%2FSampling%20\(360034374932\)_image-1.png?alt=media\&token=8a0f828a-1ee8-44bd-afb1-7af9cf402edc)

**Analog Mode**. In this mode before each new sample extra sample is created depending on a condition: if the time interval between the current and the new samples is more than *SamplingDeltaFactor ✕ DataSource.UpdateRate,* the new sample will appear, otherwise - it will not. For example, data source with update rate 500 ms (*DataSource.UpdateRate*) is specified for the time series, *SamplingDeltaFactor = 10.* Current sample was received in 2019-09-17 21:42:12.818 (*CurrentTime)*, and new sample - in 2019-09-17 21:42:36.163 (*NewTime*), *Interval = SamplingDeltaFactor ✕ DataSource.UpdateRate = 500 ✕ 10 = 5000ms,* *Delta = DeltaMilliseconds(NewTime - CurrentTime) = 24655ms, Delta > Interval*. So the extra sample would appear in a store. The value of the extra sample would be equal to the current sample, and time would differ *1 ✕ DataSource.UpdateRate* from the new sample.<br>

![](https://4282443477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3cwznMbQcEQxtnjiRDYX%2Fuploads%2FACv25BPqA9evYWTljtfs%2FSampling%20\(360034374932\)_image-2.png?alt=media\&token=df7760f9-26a0-4bc8-96c1-16518d1c3115)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monokot.io/time-series-and-stores/time-series/sampling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
