Repository navigation
8.10 Time Series changes #528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d8f4c46
TS.[REV]RANGE - EXCLUDEEMPTY
mgravell 60eca66
TS.QUERYLABELS
mgravell a5bd49f
N[REV]RANGE
mgravell e078396
TS.READ
mgravell 12d36fe
TS.N[REV]RANGE - support multi-aggregates (single-aggregates use `TsA…
mgravell 75dc05b
TS.* - enable tests on cluster 8+; this also means fixing some tests …
mgravell 8b4adc4
Merge remote-tracking branch 'origin/master' into marc/8_10
mgravell 7480433
prefer double on TS filter-values
mgravell ed2a147
gate tests
mgravell 6396d05
PR feedback
mgravell 462370d
fix maxvalue overflow PR feedback
mgravell 88cb7df
reinstate legacy API
mgravell 8ae9f1d
remove experimental flag
mgravell 2828c99
Merge branch 'master' into marc/8_10
mgravell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| Redis 8.10 is a relatively new release (at time of writing); the features and API may be subject to change. | ||
|
|
||
| This diagnostic covers the library surface for Redis 8.10 time-series features, including: | ||
|
|
||
| - *Series-level empty exclusion* (`TS.MRANGE` / `TS.MREVRANGE` `EXCLUDEEMPTY`): omit an entire matching | ||
| series from the reply when the queried range and options produce no reported samples for that series. | ||
| - *Label metadata queries* (`TS.QUERYLABELS`): return the distinct label names, or the distinct values of a | ||
| chosen label, across the series matching a filter. | ||
|
|
||
| The corresponding library features must be considered subject to change: | ||
|
|
||
| 1. Existing bindings may cease working correctly if the underlying server API changes. | ||
| 2. Changes to the server API may require changes to the library API, manifesting in either/both of build-time | ||
| or run-time breaks. | ||
|
|
||
| While this seems *unlikely*, it must be considered a possibility. If you acknowledge this, you can suppress | ||
| this warning by adding the following to your `csproj` file: | ||
|
|
||
| ```xml | ||
| <NoWarn>$(NoWarn);NRS003</NoWarn> | ||
| ``` | ||
|
|
||
| or more granularly / locally in C#: | ||
|
|
||
| ```c# | ||
| #pragma warning disable NRS003 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/NRedisStack/TimeSeries/DataTypes/TimeSeriesPivotRow.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| using System.Text; | ||
|
|
||
| namespace NRedisStack.DataTypes; | ||
|
|
||
| /// <summary> | ||
| /// A single row of a pivot (outer-join-by-timestamp) reply from <c>TS.NRANGE</c> / <c>TS.NREVRANGE</c>: | ||
| /// a timestamp plus one cell per input key, in input-key order. | ||
| /// </summary> | ||
| public readonly struct TimeSeriesPivotRow | ||
| { | ||
| private readonly IReadOnlyList<double>? _values; | ||
|
|
||
| /// <summary> | ||
| /// Create a <see cref="TimeSeriesPivotRow"/>. | ||
| /// </summary> | ||
| /// <param name="timestamp">The row timestamp.</param> | ||
| /// <param name="values">One cell per input key, in input-key order.</param> | ||
| public TimeSeriesPivotRow(TimeStamp timestamp, IReadOnlyList<double> values) | ||
| { | ||
| Timestamp = timestamp; | ||
| _values = values; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// The row timestamp. | ||
| /// </summary> | ||
| public TimeStamp Timestamp { get; } | ||
|
|
||
| /// <summary> | ||
| /// One value per input key, in input-key order (<c>Values.Count == numkeys</c>). A cell is | ||
| /// <see cref="double.NaN"/> when the corresponding key has no raw sample at the row timestamp, or no data | ||
| /// for the row's aggregation bucket (indistinguishable from a stored NaN) - matching how <c>TS.RANGE</c> | ||
| /// surfaces missing values. | ||
| /// </summary> | ||
| /// <remarks>Never <see langword="null"/>; a <c>default(TimeSeriesPivotRow)</c> reports an empty list.</remarks> | ||
| public IReadOnlyList<double> Values => _values ?? Array.Empty<double>(); | ||
|
|
||
| /// <inheritdoc/> | ||
| public override string ToString() | ||
| { | ||
| var values = Values; // coalesced, never null (guards default(TimeSeriesPivotRow)) | ||
| var sb = new StringBuilder(); | ||
| sb.Append("Time: ").Append(Timestamp.ToString()).Append(", Values:"); | ||
| for (int i = 0; i < values.Count; i++) | ||
| { | ||
| if (i != 0) sb.Append(','); | ||
| sb.Append(values[i]); | ||
| } | ||
| return sb.ToString(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.