@@ -66,41 +66,55 @@ class TestMeter(TestCase):
66
66
def test_repeated_instrument_names (self ):
67
67
class TestMeter (Meter ):
68
68
def create_counter (self , name , unit = "" , description = "" ) -> Counter :
69
+ self ._check_instrument_id (name , Counter , unit , description )
69
70
super ().create_counter (
70
71
name , unit = unit , description = description
71
72
)
72
73
73
74
def create_up_down_counter (
74
75
self , name , unit = "" , description = ""
75
76
) -> UpDownCounter :
77
+ self ._check_instrument_id (
78
+ name , UpDownCounter , unit , description
79
+ )
76
80
super ().create_up_down_counter (
77
81
name , unit = unit , description = description
78
82
)
79
83
80
84
def create_observable_counter (
81
85
self , name , callback , unit = "" , description = ""
82
86
) -> ObservableCounter :
87
+ self ._check_instrument_id (
88
+ name , ObservableCounter , unit , description
89
+ )
83
90
super ().create_observable_up_down_counter (
84
91
name , callback , unit = unit , description = description
85
92
)
86
93
87
94
def create_histogram (
88
95
self , name , unit = "" , description = ""
89
96
) -> Histogram :
97
+ self ._check_instrument_id (name , Histogram , unit , description )
90
98
super ().create_histogram (
91
99
name , unit = unit , description = description
92
100
)
93
101
94
102
def create_observable_gauge (
95
103
self , name , callback , unit = "" , description = ""
96
104
) -> ObservableGauge :
105
+ self ._check_instrument_id (
106
+ name , ObservableGauge , unit , description
107
+ )
97
108
super ().create_observable_gauge (
98
109
name , callback , unit = unit , description = description
99
110
)
100
111
101
112
def create_observable_up_down_counter (
102
113
self , name , callback , unit = "" , description = ""
103
114
) -> ObservableUpDownCounter :
115
+ self ._check_instrument_id (
116
+ name , ObservableUpDownCounter , unit , description
117
+ )
104
118
super ().create_observable_up_down_counter (
105
119
name , callback , unit = unit , description = description
106
120
)
0 commit comments