From a4f7822d75fb3afbfc3926fefbb193626a947628 Mon Sep 17 00:00:00 2001 From: Matt Duszynski Date: Thu, 17 Sep 2020 12:45:25 -0700 Subject: [PATCH] Update Info struct for RTS 1.4 compatibility (#45) --- lib/redis/time_series/info.rb | 2 ++ spec/redis/time_series_spec.rb | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/redis/time_series/info.rb b/lib/redis/time_series/info.rb index 951152e..8692d98 100644 --- a/lib/redis/time_series/info.rb +++ b/lib/redis/time_series/info.rb @@ -37,6 +37,8 @@ class TimeSeries # @see https://oss.redislabs.com/redistimeseries/commands/#tsinfo Info = Struct.new( :chunk_count, + :chunk_size, + :duplicate_policy, :first_timestamp, :labels, :last_timestamp, diff --git a/spec/redis/time_series_spec.rb b/spec/redis/time_series_spec.rb index 0931d19..468e7d7 100644 --- a/spec/redis/time_series_spec.rb +++ b/spec/redis/time_series_spec.rb @@ -312,17 +312,19 @@ def msec(ts) expect(info).to be_a Redis::TimeSeries::Info expect(info.to_h).to eq( { - series: ts, - total_samples: 0, - memory_usage: 4184, + chunk_count: 1, + chunk_size: 4096, + duplicate_policy: nil, first_timestamp: 0, + labels: {}, last_timestamp: 0, + max_samples_per_chunk: nil, + memory_usage: 4184, retention_time: 0, - chunk_count: 1, - max_samples_per_chunk: 256, - labels: {}, + rules: [], + series: ts, source_key: nil, - rules: [] + total_samples: 0 } ) end