[PROPOSAL] Time Series generator
- Dominant language
- Go
- Stars
- 43
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
# Time series generator
This issue is a proposal to generate and simulate time serie from a set of sensors.
## Time series generator configuration
Simple configuration to generate time serie with a period of 5 seconds from 2012-04-23T18:25:00.000Z to 2012-04-23T18:25:15.000Z.
```yaml
masks:
- selector:
jsonpath : 'timestamp'
mask:
timeserie:
period: "5s" # 1s by default
from: "2012-04-23T18:25:00.000Z" # current time by default
to: "2012-04-23T18:25:15.000Z" # empty by default that mean endless time serie generator
```
The following command generate timeserie dataset
```console
$ echo '{"timestamp": "" }' | pimo
{"timestamp": "2012-04-23T18:25:00.000Z" }
{"timestamp": "2012-04-23T18:25:05.000Z" }
{"timestamp": "2012-04-23T18:25:10.000Z" }
```
## Multi-Sensors configuration
Timeserie mask is not streamable. It start to generate data after the close of the input stream. Each input line is a sensor configuration and `timeserie` mask generate data for each sensors.
```console
$ echo '{ "id": 1, "timestamp": "" }\n'{"id": 2, "timestamp": "" }' | pimo
{"id": 1, "timestamp": "2012-04-23T18:25:00.000Z" }
{"id": 2, "timestamp": "2012-04-23T18:25:00.000Z" }
{"id": 1, "timestamp": "2012-04-23T18:25:05.000Z" }
{"id": 2, "timestamp": "2012-04-23T18:25:05.000Z" }
{"id": 1, "timestamp": "2012-04-23T18:25:10.000Z" }
{"id": 2, "timestamp": "2012-04-23T18:25:10.000Z" }
```
## Time Serie simulation
If the `simulate` option is activating `timeserie` wait for the period between each data generation.
```yaml
masks:
- selector:
jsonpath : 'timestamp'
mask:
timeserie:
period: "5s" # 1s by default
from: "2012-04-23T18:25:00.000Z" # current time by default
to: "2012-04-23T18:25:15.000Z" # empty by default that mean endless time serie generator
simulate: true # false by default
```
Contributor guide
Research direction
Start by tracing the pimo command's mask configuration and input-stream handling; the payload does not name specific files or tests. Compare the proposed YAML examples with the single-sensor and multi-sensor outputs, including the optional simulation delay. Done means the documented period, from/to bounds, sensor ordering, and simulate behavior work as specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- data, stream-processing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100