Coder Social home page Coder Social logo

lgtm-migrator / nredistimeseries Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redistimeseries/nredistimeseries

0.0 0.0 0.0 220 KB

.Net Client for RedisTimeSeries

Home Page: https://redistimeseries.io

License: BSD 3-Clause "New" or "Revised" License

C# 100.00%

nredistimeseries's Introduction

license CircleCI GitHub issues Codecov Known Vulnerabilities StackExchange.Redis

NRedisTimeSeries

Forum Discord

.Net Client for RedisTimeSeries

API

The complete documentation of RedisTimeSeries's commands can be found at RedisTimeSeries's website.

Usage example

ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost");
IDatabase db = redis.GetDatabase();

// Create 
var label = new TimeSeriesLabel("Time", "Series");
db.TimeSeriesCreate("test", retentionTime: 5000, labels: new List<TimeSeriesLabel> { label }, duplicatePolicy: TsDuplicatePolicy.MAX);

// Alter
label = new TimeSeriesLabel("Alter", "label");
db.TimeSeriesAlter("test", retentionTime: 0, labels: new List<TimeSeriesLabel> { label });

// Add
db.TimeSeriesAdd("test", 1, 1.12);
db.TimeSeriesAdd("test", 1, 1.13, duplicatePolicy: TsDuplicatePolicy.LAST);

// MAdd
var sequence = new List<(string, TimeStamp, double)>(3);
sequence.Add(("test", "*", 0.0));
sequence.Add(("test", DateTime.UtcNow, 0.0));
sequence.Add(("test", 1, 1.0));
db.TimeSeriesMAdd(sequence);

// Rule
db.TimeSeriesCreate("sumRule");
TimeSeriesRule rule = new TimeSeriesRule("sumRule", 20, TsAggregation.Sum);
db.TimeSeriesCreateRule("test", rule);
db.TimeSeriesAdd("test", "*", 1);
db.TimeSeriesAdd("test", "*", 2);
db.TimeSeriesDeleteRule("test", "sumRule");
db.KeyDelete("sumRule");

// Range
db.TimeSeriesRange("test", "-", "+");
db.TimeSeriesRange("test", "-", "+", aggregation: TsAggregation.Avg, timeBucket: 10);

// Get
db.TimeSeriesGet("test");

// Info
TimeSeriesInformation info = db.TimeSeriesInfo("test");               

// DEL
db.KeyDelete("test");

Further notes on back-filling time series

Since RedisTimeSeries 1.4 we've added the ability to back-fill time series, with different duplicate policies.

The default behavior is to block updates to the same timestamp, and you can control it via the duplicatePolicy argument. You can check in detail the duplicate policy documentation.

See the Example project for commands reference

nredistimeseries's People

Contributors

aviavni avatar avitalfineredis avatar chayim avatar cjdsellers avatar dvirdukhan avatar filipecosta90 avatar gkorland avatar shaunsales avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.