43
43
44
44
45
45
class Instrument (ABC ):
46
+ """Abstract class that serves as base for all instruments."""
47
+
46
48
@abstractmethod
47
49
def __init__ (self , name , unit = "" , description = "" ):
48
50
pass
@@ -120,6 +122,8 @@ def add(self, amount, attributes=None):
120
122
121
123
122
124
class NoOpCounter (Counter ):
125
+ """No-op implementation of `Counter`."""
126
+
123
127
def __init__ (self , name , unit = "" , description = "" ):
124
128
super ().__init__ (name , unit = unit , description = description )
125
129
@@ -145,6 +149,8 @@ def add(self, amount, attributes=None):
145
149
146
150
147
151
class NoOpUpDownCounter (UpDownCounter ):
152
+ """No-op implementation of `UpDownCounter`."""
153
+
148
154
def __init__ (self , name , unit = "" , description = "" ):
149
155
super ().__init__ (name , unit = unit , description = description )
150
156
@@ -170,6 +176,8 @@ class ObservableCounter(_Monotonic, Asynchronous):
170
176
171
177
172
178
class NoOpObservableCounter (ObservableCounter ):
179
+ """No-op implementation of `ObservableCounter`."""
180
+
173
181
def __init__ (self , name , callbacks = None , unit = "" , description = "" ):
174
182
super ().__init__ (name , callbacks , unit = unit , description = description )
175
183
@@ -193,6 +201,8 @@ class ObservableUpDownCounter(_NonMonotonic, Asynchronous):
193
201
194
202
195
203
class NoOpObservableUpDownCounter (ObservableUpDownCounter ):
204
+ """No-op implementation of `ObservableUpDownCounter`."""
205
+
196
206
def __init__ (self , name , callbacks = None , unit = "" , description = "" ):
197
207
super ().__init__ (name , callbacks , unit = unit , description = description )
198
208
@@ -221,6 +231,8 @@ def record(self, amount, attributes=None):
221
231
222
232
223
233
class NoOpHistogram (Histogram ):
234
+ """No-op implementation of `Histogram`."""
235
+
224
236
def __init__ (self , name , unit = "" , description = "" ):
225
237
super ().__init__ (name , unit = unit , description = description )
226
238
@@ -247,6 +259,8 @@ class ObservableGauge(_Grouping, Asynchronous):
247
259
248
260
249
261
class NoOpObservableGauge (ObservableGauge ):
262
+ """No-op implementation of `ObservableGauge`."""
263
+
250
264
def __init__ (self , name , callbacks = None , unit = "" , description = "" ):
251
265
super ().__init__ (name , callbacks , unit = unit , description = description )
252
266
0 commit comments