{"id":13423435,"url":"https://github.com/RedisTimeSeries/RedisTimeSeries","last_synced_at":"2025-03-15T17:31:46.715Z","repository":{"id":37396937,"uuid":"116659368","full_name":"RedisTimeSeries/RedisTimeSeries","owner":"RedisTimeSeries","description":"Time Series data structure for Redis","archived":false,"fork":false,"pushed_at":"2024-05-22T17:36:48.000Z","size":13044,"stargazers_count":984,"open_issues_count":155,"forks_count":139,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-05-22T18:46:24.086Z","etag":null,"topics":["redis","redis-module","redistimeseries","timeseries","timeseries-database"],"latest_commit_sha":null,"homepage":"https://redis.io/docs/stack/timeseries/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedisTimeSeries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-08T09:55:32.000Z","updated_at":"2024-06-06T13:54:22.077Z","dependencies_parsed_at":"2023-10-04T23:03:08.020Z","dependency_job_id":"4e5cbc98-66d5-4238-b566-a576b05c1da1","html_url":"https://github.com/RedisTimeSeries/RedisTimeSeries","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisTimeSeries%2FRedisTimeSeries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisTimeSeries%2FRedisTimeSeries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisTimeSeries%2FRedisTimeSeries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisTimeSeries%2FRedisTimeSeries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedisTimeSeries","download_url":"https://codeload.github.com/RedisTimeSeries/RedisTimeSeries/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243766859,"owners_count":20344828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["redis","redis-module","redistimeseries","timeseries","timeseries-database"],"created_at":"2024-07-31T00:00:34.483Z","updated_at":"2025-03-15T17:31:44.758Z","avatar_url":"https://github.com/RedisTimeSeries.png","language":"C","readme":"[![Release](https://img.shields.io/github/release/RedisTimeSeries/RedisTimeSeries.svg?sort=semver\u0026kill_cache=1)](https://github.com/RedisTimeSeries/RedisTimeSeries/releases/latest)\n[![CircleCI](https://circleci.com/gh/RedisTimeSeries/RedisTimeSeries/tree/master.svg?style=svg)](https://circleci.com/gh/RedisTimeSeries/RedisTimeSeries/tree/master)\n[![Dockerhub](https://img.shields.io/docker/pulls/redis/redis-stack-server?label=redis-stack-server)](https://hub.docker.com/r/redis/redis-stack-server/)\n[![codecov](https://codecov.io/gh/RedisTimeSeries/RedisTimeSeries/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisTimeSeries/RedisTimeSeries)\n\n# RedisTimeSeries\n[![Forum](https://img.shields.io/badge/Forum-RedisTimeSeries-blue)](https://forum.redis.com/c/modules/redistimeseries)\n[![Discord](https://img.shields.io/discord/697882427875393627?style=flat-square)](https://discord.gg/KExRgMb)\n\n\u003cimg src=\"docs/docs/images/logo.svg\" alt=\"logo\" width=\"300\"/\u003e\n\nRedisTimeSeries is a time-series database (TSDB) module for Redis, by Redis.\n\nRedisTimeSeries can hold multiple time series. Each time series is accessible via a single Redis key (similar to any other Redis data structure).\n\n\n## What is a Redis time series?\n\nA Redis time series comprises:\n\n- **Raw samples**: each raw sample is a {time tag, value} pair.\n  - Time tags are measured in milliseconds since January 1st, 1970, at 00:00:00.\n\n    Time tags can be specified by the client or filled automatically by the server.\n\n  - 64-bit floating-point values.\n\n  The intervals between time tags can be constant or variable.\n\n  Raw samples can be reported in-order or out-of-order.\n\n  Duplication policy for samples with identical time tags can be set: block/first/last/min/max/sum.\n\n- An optional configurable **retention period**.\n\n  Raw samples older than the retention period (relative to the raw sample with the highest time tag) are discarded.\n\n- **Series Metadata**: a set of name-value pairs (e.g., room = 3; sensorType = ‘xyz’).\n\n  RedisTimeSeries supports cross-time-series commands. One can, for example, aggregate data over all sensors in the same room or all sensors of the same type.\n\n- Zero or more **compactions**.\n\n  Compactions are an economical way to retain historical data.\n\n  Each compaction is defined by:\n  - A timeframe. E.g., 10 minutes\n  - An aggregator: min, max, sum, avg, …\n  - An optional retention period. E.g., 10 year\n\n  For example, the following compaction: {10 minutes; avg; 10 years} will store the average of the raw values measured in each 10-minutes time frame - for 10 years.\n\n### How do I Redis?\n\n[Learn for free at Redis University](https://university.redis.com/)\n\n[Build faster with the Redis Launchpad](https://launchpad.redis.com/)\n\n[Try the Redis Cloud](https://redis.com/try-free/)\n\n[Dive in developer tutorials](https://developer.redis.com/)\n\n[Join the Redis community](https://redis.com/community/)\n\n[Work at Redis](https://redis.com/company/careers/jobs/)\n\n## Examples of time series\n- Sensor data: e.g., temperatures or fan velocity for a server in a server farm\n- Historical prices of a stock\n- Number of vehicles passing through a given road (count per 1-minute timeframes)\n\n## Features\n- High volume inserts, low latency reads\n- Query by start time and end-time\n- Aggregated queries (Min, Max, Avg, Sum, Range, Count, First, Last, STD.P, STD.S, Var.P, Var.S, twa) for any time bucket\n- Configurable maximum retention period\n- Compactions - automatically updated aggregated timeseries\n- Secondary index - each time series has labels (name-value pairs) which will allows to query by labels\n\n## Using with other tools metrics tools\nIn the [RedisTimeSeries](https://github.com/RedisTimeSeries) organization you can\nfind projects that help you integrate RedisTimeSeries with other tools, including:\n\n1. [Prometheus](https://github.com/RedisTimeSeries/prometheus-redistimeseries-adapter) - read/write adapter to use RedisTimeSeries as backend db.\n2. [Grafana](https://github.com/RedisTimeSeries/grafana-redis-datasource) - using the [Redis Data Source](https://redis.com/blog/introducing-the-redis-data-source-plug-in-for-grafana/).\n3. [Telegraf](https://github.com/RedisTimeSeries/telegraf)\n4. StatsD, Graphite exports using graphite protocol.\n\nRedisTimeSeries is part of [Redis Stack](https://github.com/redis-stack).\n\n## Setup\n\nYou can either get RedisTimeSeries setup in a Docker container or on your own machine.\n\n### Docker\nTo quickly try out RedisTimeSeries, launch an instance using docker:\n```sh\ndocker run -p 6379:6379 -it --rm redis/redis-stack-server:latest\n```\n\n### Build it yourself\n\nYou can also build RedisTimeSeries on your own machine. Major Linux distributions as well as macOS are supported.\n\nFirst step is to have Redis installed, of course. The following, for example, builds Redis on a clean Ubuntu docker image (`docker pull ubuntu`) or a clean Debian docker image (`docker pull debian:stable`):\n\n```\nmkdir ~/Redis\ncd ~/Redis\napt-get update -y \u0026\u0026 apt-get upgrade -y\napt-get install -y wget make pkg-config build-essential\nwget https://download.redis.io/redis-stable.tar.gz\ntar -xzvf redis-stable.tar.gz\ncd redis-stable\nmake distclean\nmake\nmake install\n```\n\nNext, you should get the RedisTimeSeries repository from git and build it:\n\n```\napt-get install -y git\ncd ~/Redis\ngit clone --recursive https://github.com/RedisTimeSeries/RedisTimeSeries.git\ncd RedisTimeSeries\n# If you forgot to clone the repo with submodules, you can fix it by running the following command\n# git submodule update --init --recursive\n./sbin/setup\nbash -l\nmake\n```\n\nThen `exit` to exit bash.\n\n**Note:** to get a specific version of RedisTimeSeries, e.g. 1.8.10, add `-b v1.8.10` to the `git clone` command above.\n\nNext, run `make run -n` and copy the full path of the RedisTimeSeries executable (e.g., `/root/Redis/RedisTimeSeries/bin/linux-x64-release/redistimeseries.so`).\n\nNext, add RedisTimeSeries module to `redis.conf`, so Redis will load when started:\n\n```\napt-get install -y vim\ncd ~/Redis/redis-stable\nvim redis.conf\n```\nAdd: `loadmodule /root/Redis/RedisTimeSeries/bin/linux-x64-release/redistimeseries.so` under the MODULES section (use the full path copied above). \n\nSave and exit vim (ESC :wq ENTER)\n\nFor more information about modules, go to the [Redis official documentation](https://redis.io/topics/modules-intro).\n\n### Run\n\nRun redis-server in the background and then redis-cli:\n\n```\ncd ~/Redis/redis-stable\nredis-server redis.conf \u0026\nredis-cli\n```\n\n## Give it a try\n\nAfter you setup RedisTimeSeries, you can interact with it using redis-cli.\n\nHere we'll create a time series representing sensor temperature measurements.\nAfter you create the time series, you can send temperature measurements.\nThen you can query the data for a time range on some aggregation rule.\n\n### With `redis-cli`\n```sh\n$ redis-cli\n127.0.0.1:6379\u003e TS.CREATE temperature:3:11 RETENTION 60 LABELS sensor_id 2 area_id 32\nOK\n127.0.0.1:6379\u003e TS.ADD temperature:3:11 1548149181 30\nOK\n127.0.0.1:6379\u003e TS.ADD temperature:3:11 1548149191 42\nOK\n127.0.0.1:6379\u003e  TS.RANGE temperature:3:11 1548149180 1548149210 AGGREGATION avg 5\n1) 1) (integer) 1548149180\n   2) \"30\"\n2) 1) (integer) 1548149190\n   2) \"42\"\n```\n\n### Client libraries\n\nSome languages have client libraries that provide support for RedisTimeSeries commands:\n\n| Project | Language | License | Author | Stars | Package | Comment |\n| ------- | -------- | ------- | ------ | --- | --- | --- |\n| [jedis][jedis-url] | Java | MIT | [Redis][redis-url] | ![Stars][jedis-stars] | [Maven][jedis-package]||\n| [redis-py][redis-py-url] | Python | MIT | [Redis][redis-url] | ![Stars][redis-py-stars] | [pypi][redis-py-package]||\n| [node-redis][node-redis-url] | Node.js | MIT | [Redis][redis-url] | ![Stars][node-redis-stars] | [npm][node-redis-package]||\n| [nredisstack][nredisstack-url] | .NET | MIT | [Redis][redis-url] | ![Stars][nredisstack-stars] | [nuget][nredisstack-package]||\n| [redistimeseries-go][redistimeseries-go-url] | Go | Apache-2 | [Redis][redistimeseries-go-author] |  [![redistimeseries-go-stars]][redistimeseries-go-url]  | [GitHub][redistimeseries-go-url] |\n| [rueidis][rueidis-url] | Go | Apache-2 | [Rueian][rueidis-author] |  [![rueidis-stars]][rueidis-url]  | [GitHub][rueidis-url] |\n| [phpRedisTimeSeries][phpRedisTimeSeries-url] | PHP | MIT | [Alessandro Balasco][phpRedisTimeSeries-author] |  [![phpRedisTimeSeries-stars]][phpRedisTimeSeries-url] | [GitHub][phpRedisTimeSeries-url] |\n| [redis-time-series][redis-time-series-url] | JavaScript | MIT | [Rafa Campoy][redis-time-series-author] | [![redis-time-series-stars]][redis-time-series-url] | [GitHub][redis-time-series-url] |\n| [redistimeseries-js][redistimeseries-js-url] | JavaScript | MIT | [Milos Nikolovski][redistimeseries-js-author] | [![redistimeseries-js-stars]][redistimeseries-js-url] | [GitHub][redistimeseries-js-url] |\n| [redis_ts][redis_ts-url] | Rust | BSD-3 | [Thomas Profelt][redis_ts-author] | [![redis_ts-stars]][redis_ts-url] | [GitHub][redis_ts-url] | \n| [redistimeseries][redistimeseries-url] | Ruby | MIT | [Eaden McKee][redistimeseries-author] | [![redistimeseries-stars]][redistimeseries-url] | [GitHub][redistimeseries-url] |\n| [redis-time-series][redis-time-series-rb-url] | Ruby | MIT | [Matt Duszynski][redis-time-series-rb-author] | [![redis-time-series-rb-stars]][redis-time-series-rb-url] | [GitHub][redis-time-series-rb-url] |\n\n[redis-url]: https://redis.com\n\n[redis-py-url]: https://github.com/redis/redis-py\n[redis-py-stars]: https://img.shields.io/github/stars/redis/redis-py.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n[redis-py-package]: https://pypi.python.org/pypi/redis\n\n[jedis-url]: https://github.com/redis/jedis\n[jedis-stars]: https://img.shields.io/github/stars/redis/jedis.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n[Jedis-package]: https://search.maven.org/artifact/redis.clients/jedis\n\n[nredisstack-url]: https://github.com/redis/nredisstack\n[nredisstack-stars]: https://img.shields.io/github/stars/redis/nredisstack.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n[nredisstack-package]: https://www.nuget.org/packages/nredisstack/\n\n[node-redis-url]: https://github.com/redis/node-redis\n[node-redis-stars]: https://img.shields.io/github/stars/redis/node-redis.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n[node-redis-package]: https://www.npmjs.com/package/redis\n\n\n[redistimeseries-go-url]: https://github.com/RedisTimeSeries/redistimeseries-go/\n[redistimeseries-go-author]: https://redis.com\n[redistimeseries-go-stars]: https://img.shields.io/github/stars/RedisTimeSeries/redistimeseries-go.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n\n[rueidis-url]: https://github.com/rueian/rueidis\n[rueidis-author]: https://github.com/rueian\n[rueidis-stars]: https://img.shields.io/github/stars/rueian/rueidis.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n\n[phpRedisTimeSeries-url]: https://github.com/palicao/phpRedisTimeSeries\n[phpRedisTimeSeries-author]: https://github.com/palicao\n[phpRedisTimeSeries-stars]: https://img.shields.io/github/stars/palicao/phpRedisTimeSeries.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n\n[redis-time-series-url]: https://github.com/averias/redis-time-series\n[redis-time-series-author]: https://github.com/averias\n[redis-time-series-stars]: https://img.shields.io/github/stars/averias/redis-time-series.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n\n[redistimeseries-js-url]: https://github.com/nikolovskimilos/redistimeseries-js\n[redistimeseries-js-author]: https://github.com/nikolovskimilos\n[redistimeseries-js-stars]: https://img.shields.io/github/stars/nikolovskimilos/redistimeseries-js.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n\n[redis_ts-url]: https://github.com/tompro/redis_ts\n[redis_ts-author]: https://github.com/tompro\n[redis_ts-stars]: https://img.shields.io/github/stars/tompro/redis_ts.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n\n[redistimeseries-url]: https://github.com/eadz/redistimeseries\n[redistimeseries-author]: https://github.com/eadz\n[redistimeseries-stars]: https://img.shields.io/github/stars/eadz/redistimeseries.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n\n[redis-time-series-rb-url]: https://github.com/dzunk/redis-time-series\n[redis-time-series-rb-author]: https://github.com/dzunk\n[redis-time-series-rb-stars]: https://img.shields.io/github/stars/dzunk/redis-time-series.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n\n[rustis-url]: https://github.com/dahomey-technologies/rustis\n[rustis-author]: https://github.com/dahomey-technologies\n[rustis-stars]: https://img.shields.io/github/stars/dahomey-technologies/rustis.svg?style=social\u0026amp;label=Star\u0026amp;maxAge=2592000\n\n## Tests\n\nThe module includes a basic set of unit tests and integration tests.\n\n**Unit tests**\n\nTo run all unit tests, follow these steps:\n\n    $ make unit_tests\n\n\n**Integration tests**\n\n\nIntegration tests are based on [RLTest](https://github.com/RedisLabsModules/RLTest), and specific setup parameters can be provided\nto configure tests. By default the tests will be ran for all common commands, and with variation of persistency and replication.\n\n\nTo run all integration tests in a Python virtualenv, follow these steps:\n\n    $ mkdir -p .env\n    $ virtualenv .env\n    $ source .env/bin/activate\n    $ pip install -r tests/flow/requirements.txt\n    $ make test\n\nTo understand what test options are available simply run:\n\n    $ make help\n\nFor example, to run the tests strictly desigined for TS.ADD command, follow these steps:\n\n    $ make test TEST=test_ts_add.py\n\n\n## Documentation\nRead the docs at http://redistimeseries.io\n\n## Mailing List / Forum\nGot questions? Feel free to ask at the [RedisTimeSeries forum](https://forum.redis.com/c/modules/redistimeseries).\n\n## License\nRedisTimeSeries is licensed under the [Redis Source Available License 2.0 (RSALv2)](https://redis.com/legal/rsalv2-agreement) or the [Server Side Public License v1 (SSPLv1)](https://www.mongodb.com/licensing/server-side-public-license).\n","funding_links":[],"categories":["C","Modules \u0026 Extensions"],"sub_categories":["Java"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRedisTimeSeries%2FRedisTimeSeries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRedisTimeSeries%2FRedisTimeSeries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRedisTimeSeries%2FRedisTimeSeries/lists"}