1
+ namespace NServiceBus . Metrics
2
+ {
3
+ using System ;
4
+
5
+ abstract class MetricBuilder
6
+ {
7
+ }
8
+
9
+ [ AttributeUsage ( AttributeTargets . Field ) ]
10
+ class TimerAttribute : Attribute
11
+ {
12
+ public TimerAttribute ( string name , string description )
13
+ {
14
+ Name = name ;
15
+ Description = description ;
16
+ }
17
+
18
+ public string Name { get ; }
19
+
20
+ public string Description { get ; }
21
+ }
22
+
23
+ [ AttributeUsage ( AttributeTargets . Field ) ]
24
+ class MeterAttribute : Attribute
25
+ {
26
+ public MeterAttribute ( string name , string description )
27
+ {
28
+
29
+ }
30
+ public string Name { get ; }
31
+
32
+ public string Description { get ; }
33
+ }
34
+
35
+ class LegacyMetricsBuilder : MetricBuilder
36
+ {
37
+ #pragma warning disable 169
38
+ [ Timer ( "Processing Time" , "The time it took to successfully process a message." ) ]
39
+ public object ProcessingTimeTimer ;
40
+
41
+ [ Timer ( "Critical Time" , "The time it took from sending to processing the message." ) ]
42
+ public object CriticalTimeTimer ;
43
+
44
+ [ Meter ( "# of messages pulled from the input queue / sec" , "The current number of messages pulled from the input queue by the transport per second." ) ]
45
+ public object MessagesPulledFromQueueMeter ;
46
+
47
+ [ Meter ( "# of message failures / sec" , "The current number of failed processed messages by the transport per second." ) ]
48
+ public object FailureRateMeter ;
49
+
50
+ [ Meter ( "# of messages successfully processed / sec" , "The current number of messages processed successfully by the transport per second." ) ]
51
+ public object SuccessRateMeter ;
52
+ #pragma warning restore 169
53
+ }
54
+ }
0 commit comments