Skip to content

Commit

Permalink
Addressing pull request comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dnarula-mw committed Oct 31, 2023
1 parent e245e2e commit caab36b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions sdk/metrics/+opentelemetry/+sdk/+metrics/Cleanup.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
methods (Static)
function success = shutdown(mp)
% SHUTDOWN Shutdown
% SUCCESS = SHUTDOWN(MP) shuts down all span processors associated with
% SUCCESS = SHUTDOWN(MP) shuts down all metric readers associated with
% API meter provider MP and return a logical that indicates
% whether shutdown was successful.
%
Expand All @@ -30,7 +30,7 @@

function success = forceFlush(mp, timeout)
% FORCEFLUSH Force flush
% SUCCESS = FORCEFLUSH(MP) immediately exports all spans
% SUCCESS = FORCEFLUSH(MP) immediately exports all metrics
% that have not yet been exported. Returns a logical that
% indicates whether force flush was successful.
%
Expand Down
6 changes: 3 additions & 3 deletions sdk/metrics/+opentelemetry/+sdk/+metrics/MeterProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
% MeterProvider to SDK equivalent, needed internally by
% opentelemetry.sdk.metrics.Cleanup
mpproxy = reader; % rename the variable
% assert(mpproxy.Name == "libmexclass.opentelemetry.MeterProviderProxy");
assert(mpproxy.Name == "libmexclass.opentelemetry.MeterProviderProxy");
obj.Proxy = libmexclass.proxy.Proxy("Name", ...
"libmexclass.opentelemetry.sdk.MeterProviderProxy", ...
"ConstructorArguments", {mpproxy.ID, true});
Expand All @@ -70,7 +70,7 @@ function addMetricReader(obj, reader)

function success = shutdown(obj)
% SHUTDOWN Shutdown
% SUCCESS = SHUTDOWN(MP) shuts down all span processors associated with meter provider MP
% SUCCESS = SHUTDOWN(MP) shuts down all metric readers associated with meter provider MP
% and return a logical that indicates whether shutdown was successful.
%
% See also FORCEFLUSH
Expand All @@ -84,7 +84,7 @@ function addMetricReader(obj, reader)

function success = forceFlush(obj, timeout)
% FORCEFLUSH Force flush
% SUCCESS = FORCEFLUSH(MP) immediately exports all spans
% SUCCESS = FORCEFLUSH(MP) immediately exports all metrics
% that have not yet been exported. Returns a logical that
% indicates whether force flush was successful.
%
Expand Down
22 changes: 11 additions & 11 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, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
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, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
results = readJsonResults(testCase);
results = results{end};

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

% fetch results
pause(2.5);
verifyTrue(testCase, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
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, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
results = readJsonResults(testCase);
results = results{end};

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

% fetch results
verifyTrue(testCase, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
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, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
results = readJsonResults(testCase);
results = results{end};

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

% fetch result
verifyTrue(testCase, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
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, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
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, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
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, opentelemetry.sdk.metrics.Cleanup.shutdown(p));
verifyTrue(testCase, p.shutdown());
results = readJsonResults(testCase);
rsize = size(results);
for i = 1:rsize(2)
Expand Down Expand Up @@ -560,7 +560,7 @@ function testGetSetMeterProvider(testCase)
pause(2.5);

%Shutdown the Meter Provider
verifyTrue(testCase, opentelemetry.sdk.metrics.Cleanup.shutdown(mp));
verifyTrue(testCase, mp.shutdown());

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

0 comments on commit caab36b

Please sign in to comment.