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

export Metrics classes and types#265

Merged
mayurkale22 merged 1 commit intocensus-instrumentation:masterfrom
mayurkale22:metrics_export
Jan 9, 2019
Merged

export Metrics classes and types#265
mayurkale22 merged 1 commit intocensus-instrumentation:masterfrom
mayurkale22:metrics_export

Conversation

@mayurkale22
Copy link
Copy Markdown
Member

No description provided.

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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be equivalent to use export {Metric, ...} from './metrics/export/types' rather than importing them and then exporting them? If so, that feels a little more compact to me.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason I did this way is to resolve ambiguity. The Bucket and Point are already exported under stats module. Both the members are there for metrics module also, I have added alias for Point -> TimeSeriesPoint and Bucket -> DistributionBucket before exporting it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, makes sense. Would it work to use export .. from ... for the things that aren't renamed and then a separate import and export for the things that get renamed?

Really a nit though so feel free to leave as is.

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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, makes sense. Would it work to use export .. from ... for the things that aren't renamed and then a separate import and export for the things that get renamed?

Really a nit though so feel free to leave as is.

@mayurkale22 mayurkale22 merged commit ebbc3e3 into census-instrumentation:master Jan 9, 2019
@mayurkale22 mayurkale22 deleted the metrics_export branch January 9, 2019 01:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants