Skip to content

Commit

Permalink
Correctly clearing meter providers
Browse files Browse the repository at this point in the history
  • Loading branch information
dnarula-mw committed Nov 3, 2023
1 parent ac97746 commit 2bff102
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/tmetrics.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function testAddMetricReader(testCase)
% adding a single value
ct.add(1);
pause(2.5);
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
result_count = numel(results);
verifyEqual(testCase,result_count, 2);
Expand Down Expand Up @@ -136,7 +136,7 @@ function testCounterBasic(testCase)
pause(2.5);

% fetch result
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
results = results{end};

Expand Down Expand Up @@ -180,7 +180,7 @@ function testCounterDelta(testCase)

% fetch results
pause(2.5);
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
dp1 = results{1}.resourceMetrics.scopeMetrics.metrics.sum.dataPoints;
dp2 = results{2}.resourceMetrics.scopeMetrics.metrics.sum.dataPoints;
Expand Down Expand Up @@ -219,7 +219,7 @@ function testCounterAddAttributes(testCase)
pause(2.5);

% fetch result
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
results = results{end};

Expand Down Expand Up @@ -263,7 +263,7 @@ function testCounterAddNegative(testCase)
pause(2.5);

% fetch results
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
results = results{end};
dp = results.resourceMetrics.scopeMetrics.metrics.sum.dataPoints;
Expand Down Expand Up @@ -303,7 +303,7 @@ function testUpDownCounterBasic(testCase)
pause(5);

% fetch result
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
results = results{end};

Expand Down Expand Up @@ -348,7 +348,7 @@ function testUpDownCounterAddAttributes(testCase)
pause(5);

% fetch result
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
results = results{end};
dp = results.resourceMetrics.scopeMetrics.metrics.sum.dataPoints;
Expand Down Expand Up @@ -397,7 +397,7 @@ function testHistogramBasic(testCase)
pause(10);

% fetch results
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
results = results{end};
dp = results.resourceMetrics.scopeMetrics.metrics.histogram.dataPoints;
Expand Down Expand Up @@ -454,7 +454,7 @@ function testHistogramRecordAttributes(testCase)
pause(10);

% fetch results
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
results = results{end};
dp = results.resourceMetrics.scopeMetrics.metrics.histogram.dataPoints;
Expand Down Expand Up @@ -511,7 +511,7 @@ function testHistogramDelta(testCase)
pause(2.5);

% fetch results
verifyTrue(testCase, p.shutdown());
clear p;
results = readJsonResults(testCase);
rsize = size(results);
for i = 1:rsize(2)
Expand Down
2 changes: 2 additions & 0 deletions test/tmetrics_sdk.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ function testCustomResource(testCase)

pause(2.5);

clear mp;

% perform test comparisons
results = readJsonResults(testCase);
results = results{1};
Expand Down

0 comments on commit 2bff102

Please sign in to comment.