-
Notifications
You must be signed in to change notification settings - Fork 2k
/
RecoverableStreamOptions.cs
55 lines (50 loc) · 2.23 KB
/
RecoverableStreamOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using Microsoft.Extensions.DependencyInjection;
using Orleans.Internal;
using Orleans.Providers.Streams.Common;
using Orleans.Runtime;
using Orleans.Streams;
using System;
namespace Orleans.Configuration
{
public class StreamCacheEvictionOptions
{
/// <summary>
/// Minimum time message will stay in cache before it is available for time based purge.
/// </summary>
public TimeSpan DataMinTimeInCache { get; set; } = DefaultDataMinTimeInCache;
/// <summary>
/// Default DataMinTimeInCache
/// </summary>
public static readonly TimeSpan DefaultDataMinTimeInCache = TimeSpan.FromMinutes(5);
/// <summary>
/// Difference in time between the newest and oldest messages in the cache. Any messages older than this will be purged from the cache.
/// </summary>
public TimeSpan DataMaxAgeInCache { get; set; } = DefaultDataMaxAgeInCache;
/// <summary>
/// Default DataMaxAgeInCache
/// </summary>
public static readonly TimeSpan DefaultDataMaxAgeInCache = TimeSpan.FromMinutes(30);
/// <summary>
/// Minimum time message metadata (<see cref="StreamSequenceToken"/>) will stay in cache before it is available for time based purge.
/// Used to avoid cache miss if the full message was purged.
/// Set to null to disable this tracking.
/// </summary>
public TimeSpan? MetadataMinTimeInCache { get; set; } = DefaultMetadataMinTimeInCache;
/// <summary>
/// Default MetadataMinTimeInCache
/// </summary>
public static readonly TimeSpan DefaultMetadataMinTimeInCache = DefaultDataMinTimeInCache.Multiply(2);
}
public class StreamStatisticOptions
{
/// <summary>
/// Statistic monitor write interval
/// Statistics generation is triggered by activity. Interval will be ignored when streams are inactive.
/// </summary>
public TimeSpan StatisticMonitorWriteInterval { get; set; } = DefaultStatisticMonitorWriteInterval;
/// <summary>
/// Default statistic monitor write interval
/// </summary>
public static TimeSpan DefaultStatisticMonitorWriteInterval = TimeSpan.FromMinutes(5);
}
}