You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears right now, that time series rollups aren't created until the initial time period for the rollup is complete.
The rollup is still valid while not complete. It's today, and this is what you have today for a rollup by day thus far. Obviously, at the end of the day the rollup can't mutate further.
If it doesn't exist, you're forcing a ton of special logic that has to be created (which I'm pretty sure you can't actually do in an index) to get values from the time series because you're going to have to check that the rollup exists. If it doesn't, then you have to look at the entire time series and try and calculate what's in there for the given day and sum it, otherwise use the rollup.
Incidentally, the documentation is very not clear about this even if this is working as you think it should and is weak on the topic of rollups with regard to multiple rollups on multiple time series in the same collection etc. I've guessed at how it's supposed to work, but am not at all sure that I'm doing it right: (the constants are simply string values for consistency)
public static Task CreateTimeSeriesRollUpAsync(IDocumentStore store, CancellationToken cancellationToken)
{
var rawRetention = new RawTimeSeriesPolicy(TimeValue.FromYears(10));
var dailyRollupLike = new TimeSeriesPolicy(LIKE_TIME_SERIES_ROLLUP, TimeValue.FromDays(1), TimeValue.FromYears(5));
var dailyRollupDislike = new TimeSeriesPolicy(DISLIKE_TIME_SERIES_ROLLUP, TimeValue.FromDays(1), TimeValue.FromYears(5));
var timeSeriesLikeCollectionConfiguration = new TimeSeriesCollectionConfiguration
{
Policies = new List<TimeSeriesPolicy>
{
dailyRollupLike
},
RawPolicy = rawRetention
};
var timeSeriesDislikeCollectionConfiguration = new TimeSeriesCollectionConfiguration
{
Policies = new List<TimeSeriesPolicy>
{
dailyRollupDislike
},
RawPolicy = rawRetention
};
var databaseTsConfig = new TimeSeriesConfiguration()
{
Collections = new Dictionary<string, TimeSeriesCollectionConfiguration>(new[]
{
new KeyValuePair<string, TimeSeriesCollectionConfiguration>(LIKE_TIME_SERIES, timeSeriesLikeCollectionConfiguration),
new KeyValuePair<string, TimeSeriesCollectionConfiguration>(DISLIKE_TIME_SERIES, timeSeriesDislikeCollectionConfiguration)
}
)
};
return store.Maintenance.SendAsync(new ConfigureTimeSeriesOperation(databaseTsConfig));
}
I would expect that this would immediately create a rollup for the current day for each of the 2 time series listed, which I could then work against.
The text was updated successfully, but these errors were encountered:
It appears right now, that time series rollups aren't created until the initial time period for the rollup is complete.
The rollup is still valid while not complete. It's today, and this is what you have today for a rollup by day thus far. Obviously, at the end of the day the rollup can't mutate further.
If it doesn't exist, you're forcing a ton of special logic that has to be created (which I'm pretty sure you can't actually do in an index) to get values from the time series because you're going to have to check that the rollup exists. If it doesn't, then you have to look at the entire time series and try and calculate what's in there for the given day and sum it, otherwise use the rollup.
Incidentally, the documentation is very not clear about this even if this is working as you think it should and is weak on the topic of rollups with regard to multiple rollups on multiple time series in the same collection etc. I've guessed at how it's supposed to work, but am not at all sure that I'm doing it right: (the constants are simply string values for consistency)
I would expect that this would immediately create a rollup for the current day for each of the 2 time series listed, which I could then work against.
The text was updated successfully, but these errors were encountered: