From 0cd2b8dfd4c9554b05656ea335f8e386eb5bd76a Mon Sep 17 00:00:00 2001 From: Mayur Kale Date: Mon, 7 Jan 2019 21:58:11 -0800 Subject: [PATCH] export Metrics classes and types --- packages/opencensus-core/src/index.ts | 32 +++++++++++++++++++ .../test/test-metric-component.ts | 7 +++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/packages/opencensus-core/src/index.ts b/packages/opencensus-core/src/index.ts index 63a8ec0f9..fd94b9b05 100644 --- a/packages/opencensus-core/src/index.ts +++ b/packages/opencensus-core/src/index.ts @@ -24,6 +24,29 @@ export * from './trace/instrumentation/types'; export * from './trace/propagation/types'; export * from './exporters/types'; export * from './common/types'; +export * from './metrics/gauges/types'; +import {Metric, MetricDescriptor, TimeSeries, MetricDescriptorType, LabelKey, LabelValue, Point as TimeSeriesPoint, DistributionValue, BucketOptions, Bucket as DistributionBucket, SummaryValue, Explicit, Exemplar, Timestamp, Snapshot, ValueAtPercentile, MetricProducerManager, MetricProducer} from './metrics/export/types'; + +export { + Metric, + MetricDescriptor, + TimeSeries, + MetricDescriptorType, + LabelKey, + LabelValue, + TimeSeriesPoint, + DistributionValue, + BucketOptions, + DistributionBucket, + SummaryValue, + Explicit, + Exemplar, + Timestamp, + Snapshot, + ValueAtPercentile, + MetricProducerManager, + MetricProducer +}; // classes @@ -58,3 +81,12 @@ export {logger}; // version export * from './common/version'; + +// METRICS CLASSES + +export * from './metrics/metrics'; +export * from './metrics/metric-registry'; + +// GAUGES CLASSES +export * from './metrics/gauges/derived-gauge'; +export * from './metrics/gauges/gauge'; diff --git a/packages/opencensus-core/test/test-metric-component.ts b/packages/opencensus-core/test/test-metric-component.ts index 4e47f5138..9f1792b21 100644 --- a/packages/opencensus-core/test/test-metric-component.ts +++ b/packages/opencensus-core/test/test-metric-component.ts @@ -20,7 +20,12 @@ import {MetricsComponent} from '../src/metrics/metric-component'; import {MetricRegistry} from '../src/metrics/metric-registry'; describe('MetricsComponent()', () => { - const metricsComponent: MetricsComponent = new MetricsComponent(); + let metricsComponent: MetricsComponent; + + beforeEach(() => { + metricProducerManagerInstance.removeAll(); + metricsComponent = new MetricsComponent(); + }); it('should return a MetricRegistry instance', () => { assert.ok(metricsComponent.getMetricRegistry() instanceof MetricRegistry);