redis-time-series 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a81f643a8aab78bd7e05a2a49fad6b6ed11ce2ff726407c160c9f4e0aa7ded86
4
- data.tar.gz: a95158195524300ab4891cfd9f5b5ecabb41c20b288f661b902a776c69e3deb4
3
+ metadata.gz: e2c45958f94f534cf0041b70ce6505c70fb6ae69c285f36c50582857edaebfee
4
+ data.tar.gz: 67a0009a25108781eb10810ca6b8e326957f4e5ad4ac63f8e9ee241372d10a68
5
5
  SHA512:
6
- metadata.gz: ceac0848dae65288f972a6f93dc06f4837915e8b689b0e6d7b318ddcd9bde8ae9ecf58a3853fd9741f191414801b1b262ecfed01ed50bca7abcbfc8f76e279c4
7
- data.tar.gz: 3e89f3984f39344cb4b6d390f0883b3c70cf370bd8a9aa680679d4badab3212b1dac50cb893e4678f150395c25e5e66adc75cbf2d2095de0d6e67aab112c5840
6
+ metadata.gz: dbfc27f5e79443424f864e143d4af9221622fa6abc60dfe2cb7601ec73c5ed930b0ead283228b938e46fed2058a17b7c00cae2b5bfefb162e6c3bf71a6102d32
7
+ data.tar.gz: d7308ff3214fbb43fa3415a9d3af01aaf677a915cacc17229fa93760cb216bafbd5716abe82bd4734454aa14000318db2e7f555fc796e13b68b0cfd070b8299b
data/Appraisals CHANGED
@@ -5,3 +5,7 @@ end
5
5
  appraise 'redis 4' do
6
6
  gem 'redis', '~> 4.0'
7
7
  end
8
+
9
+ appraise 'redis 5' do
10
+ gem 'redis', '~> 5.0'
11
+ end
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.8.0
6
+ * Remove usage of `Redis.current` (#78)
7
+ * Fix flaky aggregation spec (#80)
8
+ * Compatibility updates and spec fixes (#81)
9
+ * Add redis-rb 5.x to appraisals (#83)
10
+
5
11
  ## 0.7.2
6
12
  * Fix sample building for TS.MADD with multiple series (#77)
7
13
 
data/README.md CHANGED
@@ -50,6 +50,12 @@ Or install it yourself as:
50
50
 
51
51
  Check out the Redis Time Series [command documentation](https://oss.redislabs.com/redistimeseries/master/commands/) first. Should be able to do most of that.
52
52
 
53
+ ### Configuring
54
+ You can set the default Redis client for class-level calls operating on multiple series, as well as series created without specifying a client.
55
+ ```ruby
56
+ Redis::TimeSeries.redis = Redis.new(url: ENV['REDIS_URL'], timeout: 1)
57
+ ```
58
+
53
59
  ### Creating a Series
54
60
  Create a series (issues `TS.CREATE` command) and return a Redis::TimeSeries object for further use. Key param is required, all other arguments are optional.
55
61
  ```ruby
@@ -58,7 +64,7 @@ ts = Redis::TimeSeries.create(
58
64
  labels: { foo: 'bar' },
59
65
  retention: 600,
60
66
  uncompressed: false,
61
- redis: Redis.new(url: ENV['REDIS_URL']) # defaults to Redis.current
67
+ redis: Redis.new(url: ENV['REDIS_URL']) # defaults to Redis::TimeSeries.redis
62
68
  )
63
69
  ```
64
70
  You can also call `.new` instead of `.create` to skip the `TS.CREATE` command.
data/bin/setup CHANGED
@@ -10,7 +10,7 @@ require 'active_support/core_ext/numeric/time'
10
10
  require 'redis'
11
11
  require 'redis-time-series'
12
12
 
13
- Redis.current.flushall
13
+ Redis.new.flushall
14
14
  ts1 = Redis::TimeSeries.create('ts1')
15
15
  ts2 = Redis::TimeSeries.create('ts2')
16
16
  ts3 = Redis::TimeSeries.create('ts3')
@@ -42,9 +42,9 @@ class Redis
42
42
  @debug = !!bool
43
43
  end
44
44
 
45
- # @return [Redis] the current Redis client. Defaults to +Redis.current+
45
+ # @return [Redis] the current Redis client. Defaults to +Redis.new+
46
46
  def redis
47
- @redis ||= Redis.current
47
+ @redis ||= Redis.new
48
48
  end
49
49
 
50
50
  # Set the default Redis client for time series objects.
@@ -68,7 +68,7 @@ class Redis
68
68
  end
69
69
 
70
70
  def cmd_with_redis(redis, name, *args)
71
- args = args.flatten.compact.map { |arg| arg.is_a?(Time) ? arg.ts_msec : arg }
71
+ args = args.flatten.compact.map { |arg| arg.is_a?(Time) ? arg.ts_msec : arg.to_s }
72
72
  puts "DEBUG: #{name} #{args.join(' ')}" if debug
73
73
  redis.call name, args
74
74
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  class Redis
3
3
  class TimeSeries
4
- VERSION = '0.7.2'
4
+ VERSION = '0.8.0'
5
5
  end
6
6
  end
@@ -214,7 +214,7 @@ class Redis
214
214
  end
215
215
  else
216
216
  # single value, no timestamp
217
- [key, '*', raw]
217
+ [[key, '*', raw]]
218
218
  end
219
219
  end
220
220
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-time-series
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Duszynski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2023-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis