-
Notifications
You must be signed in to change notification settings - Fork 2
/
SemanticConventions.cs
105 lines (81 loc) · 3.02 KB
/
SemanticConventions.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#region (c) 2021 Joseph Shook. All rights reserved.
// /*
// Authors:
// Joseph Shook [email protected]
//
// See LICENSE in the project root for license information.
// */
#endregion
namespace ZiggyCreatures.Caching.Fusion.Plugins.Metrics.Core
{
/// <summary>
/// Default implementation of <see cref="ISemanticConventions"/>
/// </summary>
public class SemanticConventions : ISemanticConventions
{
/// <summary>
/// Create a new SemanticConventions instance
/// </summary>
public SemanticConventions(string measurementName, string gaugeName)
{
_measurementName = measurementName;
_gaugeName = gaugeName;
}
/// <summary>
/// Create a new SemanticConventions instance
/// </summary>
public SemanticConventions()
{
}
/// <summary>
/// Static accessor to creating a new instance of <see cref="SemanticConventions"/>
/// </summary>
/// <returns></returns>
public static SemanticConventions Instance()
{
return new SemanticConventions();
}
private readonly string _measurementName = "Cache.Events";
private readonly string _gaugeName = "Cache.Gauges";
/// <inheritdoc />
public string MeasurementName => _measurementName;
/// <inheritdoc />
public string GaugeName => _gaugeName;
/// <inheritdoc />
public string ValueFieldName => "value";
/// <inheritdoc />
public string ApplicationTagName => "application";
/// <inheritdoc />
public string ApplicationVersionTagName => "applicationVersion";
/// <inheritdoc />
public string CacheNameTagName => "cacheName";
/// <inheritdoc />
public string CacheEventTagName => "cacheEvent";
/// <inheritdoc />
public string CacheHitTagValue => "HIT";
/// <inheritdoc />
public string CacheMissTagValue => "MISS";
/// <inheritdoc />
public string CacheSetTagValue => "SET";
/// <inheritdoc />
public string CacheStaleHitTagValue => "STALE_HIT";
/// <inheritdoc />
public string CacheBackgroundRefreshedTagValue => "STALE_REFRESH";
/// <inheritdoc />
public string CacheBackgroundFailedRefreshedTagValue => "STALE_REFRESH_ERROR";
/// <inheritdoc />
public string CacheExpiredEvictTagValue => "EXPIRE";
/// <inheritdoc />
public string CacheCapacityEvictTagValue => "CAPACITY";
/// <inheritdoc />
public string CacheRemovedTagValue => "REMOVE";
/// <inheritdoc />
public string CacheItemCountTagValue => "ITEM_COUNT";
/// <inheritdoc />
public string CacheCacheFactoryErrorTagValue => "FACTORY_ERROR";
/// <inheritdoc />
public string CacheFactorySyntheticTimeoutTagValue => "TIMEOUT";
/// <inheritdoc />
public string CacheFailSafeActivateTagValue => "FAIL_SAFE";
}
}