From caab36ba90b81fa8df7f382b765b077d97019773 Mon Sep 17 00:00:00 2001 From: Devin Narula Date: Tue, 31 Oct 2023 15:14:50 -0400 Subject: [PATCH] Addressing pull request comments --- .../+opentelemetry/+sdk/+metrics/Cleanup.m | 4 ++-- .../+sdk/+metrics/MeterProvider.m | 6 ++--- test/tmetrics.m | 22 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sdk/metrics/+opentelemetry/+sdk/+metrics/Cleanup.m b/sdk/metrics/+opentelemetry/+sdk/+metrics/Cleanup.m index ea84591..0f31c4b 100644 --- a/sdk/metrics/+opentelemetry/+sdk/+metrics/Cleanup.m +++ b/sdk/metrics/+opentelemetry/+sdk/+metrics/Cleanup.m @@ -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. % @@ -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. % diff --git a/sdk/metrics/+opentelemetry/+sdk/+metrics/MeterProvider.m b/sdk/metrics/+opentelemetry/+sdk/+metrics/MeterProvider.m index 646a078..7c47bd0 100644 --- a/sdk/metrics/+opentelemetry/+sdk/+metrics/MeterProvider.m +++ b/sdk/metrics/+opentelemetry/+sdk/+metrics/MeterProvider.m @@ -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}); @@ -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 @@ -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. % diff --git a/test/tmetrics.m b/test/tmetrics.m index 99587d4..9cecbf9 100644 --- a/test/tmetrics.m +++ b/test/tmetrics.m @@ -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); @@ -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}; @@ -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; @@ -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}; @@ -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; @@ -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}; @@ -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; @@ -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; @@ -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; @@ -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) @@ -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);