https://github.com/glaslos/etsz
Embedded golang time series database
https://github.com/glaslos/etsz
Last synced: about 2 months ago
JSON representation
Embedded golang time series database
- Host: GitHub
- URL: https://github.com/glaslos/etsz
- Owner: glaslos
- License: mit
- Created: 2016-10-14T08:48:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-07T14:54:42.000Z (about 7 years ago)
- Last Synced: 2025-03-27T12:38:52.585Z (2 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# etsz
Embedded golang time series databaseUse with `import "github.com/glaslos/etsz"`
Create a new embedded db with `edb := etsz.New()`
Create entry: `edb.Insert(1.0, "test")` where "test" is the series name.
Read data: `edb.Read("test")`
Example output:
```JSON
[
{
"name": "test",
"shards": [
{
"range": "20161014T14",
"data": [
{
"date": 1476447064,
"value": 1
}]}]}]
```Series are split in shards with a currently hard-coded resolution of one hour (yolo).
`range` is the shard named by it's timestamp in hour resolution (yolo).
A shard contains data points consisting of unix timestamps (second resolution (yolo)) and values.
Shards are deleted on inserts if the shard is from the previous day (yolo).