@@ -51,37 +51,34 @@ function teardown(testCase)
5151 end
5252
5353 methods (Test )
54- function testCounter (testCase )
55- % create and increment a counter
54+ function testCreateCounter (testCase )
55+ % create a counter
5656 mt = opentelemetry .metrics .getMeter(" foo" );
5757
5858 testCase .startMeasuring();
5959 c = createCounter(mt , " bar" );
60- add(c , 5 );
6160 testCase .stopMeasuring();
6261 end
6362
64- function testUpDownCounter (testCase )
65- % create and increment an up-down-counter
63+ function testCreateUpDownCounter (testCase )
64+ % create an up-down-counter
6665 mt = opentelemetry .metrics .getMeter(" foo" );
6766
6867 testCase .startMeasuring();
6968 c = createUpDownCounter(mt , " bar" );
70- add(c , - 5 );
7169 testCase .stopMeasuring();
7270 end
7371
74- function testHistogram (testCase )
75- % create a histogram and record a value
72+ function testCreateHistogram (testCase )
73+ % create a histogram
7674 mt = opentelemetry .metrics .getMeter(" foo" );
7775
7876 testCase .startMeasuring();
7977 h = createHistogram(mt , " bar" );
80- record(h , 111 );
8178 testCase .stopMeasuring();
8279 end
8380
84- function testObservableCounter (testCase )
81+ function testCreateObservableCounter (testCase )
8582 % create an observable counter
8683 mt = opentelemetry .metrics .getMeter(" foo" );
8784
@@ -90,7 +87,7 @@ function testObservableCounter(testCase)
9087 testCase .stopMeasuring();
9188 end
9289
93- function testObservableUpDownCounter (testCase )
90+ function testCreateObservableUpDownCounter (testCase )
9491 % create an observable up-down-counter
9592 mt = opentelemetry .metrics .getMeter(" foo" );
9693
@@ -99,7 +96,7 @@ function testObservableUpDownCounter(testCase)
9996 testCase .stopMeasuring();
10097 end
10198
102- function testObservableGauge (testCase )
99+ function testCreateObservableGauge (testCase )
103100 % create an observable gauge
104101 mt = opentelemetry .metrics .getMeter(" foo" );
105102
@@ -108,6 +105,45 @@ function testObservableGauge(testCase)
108105 testCase .stopMeasuring();
109106 end
110107
108+ function testCounterAdd(testCase )
109+ % increment a counter
110+ mt = opentelemetry .metrics .getMeter(" foo" );
111+ c = createCounter(mt , " bar" );
112+
113+ testCase .startMeasuring();
114+ % run through a loop since the time for 1 iteration is too short
115+ for i = 1 : 10
116+ add(c , 5 );
117+ end
118+ testCase .stopMeasuring();
119+ end
120+
121+ function testUpDownCounterAdd(testCase )
122+ % Increment an up-down-counter
123+ mt = opentelemetry .metrics .getMeter(" foo" );
124+ c = createUpDownCounter(mt , " bar" );
125+
126+ testCase .startMeasuring();
127+ % run through a loop since the time for 1 iteration is too short
128+ for i = 1 : 10
129+ add(c , - 5 );
130+ end
131+ testCase .stopMeasuring();
132+ end
133+
134+ function testHistogramRecord(testCase )
135+ % record a histogram value
136+ mt = opentelemetry .metrics .getMeter(" foo" );
137+ h = createHistogram(mt , " bar" );
138+
139+ testCase .startMeasuring();
140+ % run through a loop since the time for 1 iteration is too short
141+ for i = 1 : 10
142+ record(h , 111 );
143+ end
144+ testCase .stopMeasuring();
145+ end
146+
111147 function testCounterAttributes(testCase )
112148 % increment counter with attributes
113149 mt = opentelemetry .metrics .getMeter(" foo" );
0 commit comments