Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
export Metrics classes and types (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 committed Jan 9, 2019
1 parent 845c1c0 commit ebbc3e3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
32 changes: 32 additions & 0 deletions packages/opencensus-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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';
7 changes: 6 additions & 1 deletion packages/opencensus-core/test/test-metric-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ebbc3e3

Please sign in to comment.