averias / redis-time-series Goto Github PK
View Code? Open in Web Editor NEWJavascript RedisTimeSeries client
License: MIT License
Javascript RedisTimeSeries client
License: MIT License
As of RedisTimeseries >= 1.4 You can now add samples to a time series where the time of the sample is older than the newest sample in the series. Bundled with that, we now have a policy that will define handling of duplicate samples, and that needs to be supported on the client via the arguments [DUPLICATE_POLICY policy]
on TS.CREATE
and via [ON_DUPLICATE policy]
on TS.ADD
. The following are the possible policies:
BLOCK
- an error will occur for any out of order sampleFIRST
- ignore the new valueLAST
- override with latest valueMIN
- only override if the value is lower than the existing valueMAX
- only override if the value is higher than the existing valueFurther reference: documentation link
Thanks for making this library, its been very helpful! However there are some big issues.
TimestampRange
and Count
are not exported correctly. They are missing in the below export:
redis-time-series/src/index.ts
Line 22 in fdc522e
I've made a PR I will reference soon that tries to fix many of the issues (update to the latest spec with TS.MREVRANGE, TS.REVRANGE, CHUNK_SIZE, DUPLICATE_POLICY
on TS.CREATE/TS.ALTER
, ON_DUPLICATE
on TS.ADD
). I've tried to follow the spec as much as possible so I may have missed some things. Hope you can look it over and provide input. Thanks.
Add CI build automation including nightly
The following PR RedisTimeSeries/RedisTimeSeries#617 added support for multi-series aggregations to RedisTimeSeries.
It adds GROUPBY <label> REDUCE <reducer>
to TS.MRANGE/TS.MREVRANGE
. It accepts SUM
, MIN
, MAX
reducers and works with unaligned series.
TS.MRANGE 1451679382646 1451682982646 WITHLABELS
AGGREGATION MAX 60000
FILTER measurement=cpu
fieldname=usage_user
hostname=(host_9,host_3,host_5,host_1,host_7,host_2,host_8,host_4)
GROUPBY hostname REDUCE MAX
Labels:
<label>=<groupbyvalue>
__reducer__=<reducer>
__source__=key1,key2,key3
127.0.0.1:6379> ts.add ts1 1 90 labels metric cpu name system
(integer) 1
127.0.0.1:6379> ts.add ts1 2 45 labels metric cpu name system
(integer) 2
127.0.0.1:6379> ts.add ts2 2 99 labels metric cpu name user
(integer) 2
127.0.0.1:6379> ts.add ts3 2 02 labels metric cpu name system
(integer) 2
MAX reducer sample output
127.0.0.1:6379> ts.mrange - + withlabels filter metric=cpu groupby name reduce max
1) 1) "name=system"
2) 1) 1) "name"
2) "system"
2) 1) "__reducer__"
2) "max"
3) 1) "__source__"
2) "ts1,ts3"
3) 1) 1) (integer) 1
2) 90
2) 1) (integer) 2
2) 45
2) 1) "name=user"
2) 1) 1) "name"
2) "user"
2) 1) "__reducer__"
2) "max"
3) 1) "__source__"
2) "ts2"
3) 1) 1) (integer) 2
2) 99
MIN reducer sample output
127.0.0.1:6379> ts.mrange - + withlabels filter metric=cpu groupby name reduce min
1) 1) "name=system"
2) 1) 1) "name"
2) "system"
2) 1) "__reducer__"
2) "min"
3) 1) "__source__"
2) "ts1,ts3"
3) 1) 1) (integer) 1
2) 90
2) 1) (integer) 2
2) 2
2) 1) "name=user"
2) 1) 1) "name"
2) "user"
2) 1) "__reducer__"
2) "min"
3) 1) "__source__"
2) "ts2"
3) 1) 1) (integer) 2
2) 99
I would like to pipeline multiple creates, how do I accomplish it with this library?
@averias
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.