@@ -19,36 +19,21 @@ namespace metrics
1919class Synchronous
2020{
2121public:
22- Synchronous (nostd::string_view name,
23- const opentelemetry::sdk::instrumentationlibrary::InstrumentationLibrary
24- *instrumentation_library,
25- MeasurementProcessor *measurement_processor,
26- nostd::string_view description = " " ,
27- nostd::string_view unit = " " )
28- : name_(name),
29- instrumentation_library_ (instrumentation_library),
30- measurement_processor_(measurement_processor),
31- description_(description),
32- unit_(unit)
22+ Synchronous (InstrumentDescriptor instrument_descriptor,
23+ std::unique_ptr<WritableMetricStorage> storage)
24+ : instrument_descriptor_(instrument_descriptor), storage_(std::move(storage))
3325 {}
3426
3527protected:
36- std::string name_;
37- const sdk::instrumentationlibrary::InstrumentationLibrary *instrumentation_library_;
38- MeasurementProcessor *measurement_processor_;
39- std::string description_;
40- std::string unit_;
28+ InstrumentDescriptor instrument_descriptor_;
29+ std::unique_ptr<WritableMetricStorage> storage_;
4130};
4231
4332class LongCounter : public Synchronous , public opentelemetry ::metrics::Counter<long >
4433{
4534public:
46- LongCounter (nostd::string_view name,
47- const opentelemetry::sdk::instrumentationlibrary::InstrumentationLibrary
48- *instrumentation_library,
49- MeasurementProcessor *measurement_processor,
50- nostd::string_view description = " " ,
51- nostd::string_view unit = " " );
35+ LongCounter (InstrumentDescriptor instrument_descriptor,
36+ std::unique_ptr<WritableMetricStorage> storage);
5237
5338 void Add (long value, const opentelemetry::common::KeyValueIterable &attributes) noexcept override ;
5439
@@ -59,12 +44,8 @@ class DoubleCounter : public Synchronous, public opentelemetry::metrics::Counter
5944{
6045
6146public:
62- DoubleCounter (nostd::string_view name,
63- const opentelemetry::sdk::instrumentationlibrary::InstrumentationLibrary
64- *instrumentation_library,
65- MeasurementProcessor *measurement_processor,
66- nostd::string_view description = " " ,
67- nostd::string_view unit = " " );
47+ DoubleCounter (InstrumentDescriptor instrument_descriptor,
48+ std::unique_ptr<WritableMetricStorage> storage);
6849
6950 void Add (double value,
7051 const opentelemetry::common::KeyValueIterable &attributes) noexcept override ;
@@ -75,12 +56,8 @@ class DoubleCounter : public Synchronous, public opentelemetry::metrics::Counter
7556class LongUpDownCounter : public Synchronous , public opentelemetry ::metrics::UpDownCounter<long >
7657{
7758public:
78- LongUpDownCounter (nostd::string_view name,
79- const opentelemetry::sdk::instrumentationlibrary::InstrumentationLibrary
80- *instrumentation_library,
81- MeasurementProcessor *measurement_processor,
82- nostd::string_view description = " " ,
83- nostd::string_view unit = " " );
59+ LongUpDownCounter (InstrumentDescriptor instrument_descriptor,
60+ std::unique_ptr<WritableMetricStorage> storage);
8461
8562 void Add (long value, const opentelemetry::common::KeyValueIterable &attributes) noexcept override ;
8663
@@ -90,12 +67,8 @@ class LongUpDownCounter : public Synchronous, public opentelemetry::metrics::UpD
9067class DoubleUpDownCounter : public Synchronous , public opentelemetry ::metrics::UpDownCounter<double >
9168{
9269public:
93- DoubleUpDownCounter (nostd::string_view name,
94- const opentelemetry::sdk::instrumentationlibrary::InstrumentationLibrary
95- *instrumentation_library,
96- MeasurementProcessor *measurement_processor,
97- nostd::string_view description = " " ,
98- nostd::string_view unit = " " );
70+ DoubleUpDownCounter (InstrumentDescriptor instrument_descriptor,
71+ std::unique_ptr<WritableMetricStorage> storage);
9972
10073 void Add (double value,
10174 const opentelemetry::common::KeyValueIterable &attributes) noexcept override ;
@@ -106,12 +79,8 @@ class DoubleUpDownCounter : public Synchronous, public opentelemetry::metrics::U
10679class LongHistogram : public Synchronous , public opentelemetry ::metrics::Histogram<long >
10780{
10881public:
109- LongHistogram (nostd::string_view name,
110- const opentelemetry::sdk::instrumentationlibrary::InstrumentationLibrary
111- *instrumentation_library,
112- MeasurementProcessor *measurement_processor,
113- nostd::string_view description = " " ,
114- nostd::string_view unit = " " );
82+ LongHistogram (InstrumentDescriptor instrument_descriptor,
83+ std::unique_ptr<WritableMetricStorage> storage);
11584
11685 void Record (long value,
11786 const opentelemetry::common::KeyValueIterable &attributes) noexcept override ;
@@ -122,12 +91,8 @@ class LongHistogram : public Synchronous, public opentelemetry::metrics::Histogr
12291class DoubleHistogram : public Synchronous , public opentelemetry ::metrics::Histogram<double >
12392{
12493public:
125- DoubleHistogram (nostd::string_view name,
126- const opentelemetry::sdk::instrumentationlibrary::InstrumentationLibrary
127- *instrumentation_library,
128- MeasurementProcessor *measurement_processor,
129- nostd::string_view description = " " ,
130- nostd::string_view unit = " " );
94+ DoubleHistogram (InstrumentDescriptor instrument_descriptor,
95+ std::unique_ptr<WritableMetricStorage> storage);
13196
13297 void Record (double value,
13398 const opentelemetry::common::KeyValueIterable &attributes) noexcept override ;
0 commit comments