@@ -8,39 +8,44 @@ import Foundation
88/// Main interface to obtain metric instruments.
99///
1010///
11- @available ( * , deprecated, renamed: " StableMeter " )
11+ // Phase 2
12+ //@available(*, deprecated, renamed: "StableMeter")
1213public protocol Meter {
1314
1415 /// Creates Int counter with given name.
1516 /// - Parameters:
1617 /// - name: The name of the counter.
1718 /// - monotonic: indicates if only positive values are expected.
1819 /// - Returns:The counter instance.
19- @available ( * , deprecated, message: " counter instruments are now monotonic only. Use UpDownCounter for non-monotonic. " )
20+ // Phase 2
21+ //@available(*,deprecated, message: "counter instruments are now monotonic only. Use UpDownCounter for non-monotonic.")
2022 func createIntCounter( name: String , monotonic: Bool ) -> AnyCounterMetric < Int >
2123
2224 /// Creates double counter with given name.
2325 /// - Parameters:
2426 /// - name: indicates if only positive values are expected.
2527 /// - monotonic: The name of the counter.
2628 /// - Returns:The counter instance.
27- @available ( * , deprecated, message: " counter instruments are now monotonic only. Use UpDownCounter for non-monotonic. " )
29+ // Phase 2
30+ //@available(*,deprecated, message: "counter instruments are now monotonic only. Use UpDownCounter for non-monotonic.")
2831 func createDoubleCounter( name: String , monotonic: Bool ) -> AnyCounterMetric < Double >
2932
3033 /// Creates Int Measure with given name.
3134 /// - Parameters:
3235 /// - name: The name of the measure.
3336 /// - absolute: indicates if only positive values are expected.
3437 /// - Returns:The measure instance.
35- @available ( * , deprecated)
38+ // Phase 2
39+ //@available(*,deprecated)
3640 func createIntMeasure( name: String , absolute: Bool ) -> AnyMeasureMetric < Int >
3741
3842 /// Creates double Measure with given name.
3943 /// - Parameters:
4044 /// - name: The name of the measure.
4145 /// - absolute: indicates if only positive values are expected.
4246 /// - Returns:The measure instance.
43- @available ( * , deprecated)
47+ // Phase 2
48+ //@available(*,deprecated)
4449 func createDoubleMeasure( name: String , absolute: Bool ) -> AnyMeasureMetric < Double >
4550
4651 /// Creates Int Histogram with given name and boundaries.
@@ -49,7 +54,8 @@ public protocol Meter {
4954 /// - explicitBoundaries: The boundary for sorting values into buckets
5055 /// - absolute: indicates if only positive values are expected.
5156 /// - Returns:The histogram instance.
52- @available ( * , deprecated)
57+ // Phase 2
58+ //@available(*,deprecated)
5359 func createIntHistogram( name: String , explicitBoundaries: Array < Int > ? , absolute: Bool ) -> AnyHistogramMetric < Int >
5460
5561 /// Creates Double Histogram with given name and boundaries.
@@ -58,7 +64,8 @@ public protocol Meter {
5864 /// - explicitBoundaries: The boundary for sorting values into buckets
5965 /// - absolute: indicates if only positive values are expected.
6066 /// - Returns:The histogram instance.
61- @available ( * , deprecated)
67+ // Phase 2
68+ //@available(*,deprecated)
6269 func createDoubleHistogram( name: String , explicitBoundaries: Array < Double > ? , absolute: Bool ) -> AnyHistogramMetric < Double >
6370
6471 // Creates a double histogram given the name, boundaries, counts, and start and end dates.
@@ -82,7 +89,8 @@ public protocol Meter {
8289 /// - callback: The callback to be called to observe metric value.
8390 /// - absolute: indicates if only positive values are expected.
8491 /// - Returns:The observer instance.
85- @available ( * , deprecated)
92+ // Phase 2
93+ //@available(*,deprecated)
8694 func createIntObserver( name: String , absolute: Bool , callback: @escaping ( IntObserverMetric ) -> Void ) -> IntObserverMetric
8795
8896 /// Creates Double Observer with given name.
@@ -91,60 +99,70 @@ public protocol Meter {
9199 /// - callback: The callback to be called to observe metric value.
92100 /// - absolute: indicates if only positive values are expected.
93101 /// - Returns:The observer instance.
94- @available ( * , deprecated)
102+ // Phase 2
103+ //@available(*,deprecated)
95104 func createDoubleObserver( name: String , absolute: Bool , callback: @escaping ( DoubleObserverMetric ) -> Void ) -> DoubleObserverMetric
96105
97106 /// Creates Double Observable Gauge with given name.
98107 /// - Parameters:
99108 /// - name: The name of the gauge.
100109 /// - callback: The callback to be called to observe metric value.
101110 /// - Returns:The gauge instance.
102- @available ( * , deprecated)
111+ // Phase 2
112+ //@available(*,deprecated)
103113 func createIntObservableGauge( name: String , callback: @escaping ( IntObserverMetric ) -> Void ) -> IntObserverMetric
104114
105115 /// Creates Int Observable Gauge with given name.
106116 /// - Parameters:
107117 /// - name: The name of the gauge.
108118 /// - callback: The callback to be called to observe metric value.
109119 /// - Returns:The gauge instance.
110- @available ( * , deprecated)
120+ // Phase 2
121+ //@available(*,deprecated)
111122 func createDoubleObservableGauge( name: String , callback: @escaping ( DoubleObserverMetric ) -> Void ) -> DoubleObserverMetric
112123
113124 /// Constructs or retrieves the LabelSet from the given dictionary.
114125 /// - Parameters:
115126 /// - labels: dictionary with key-value pairs.
116127 /// - Returns:The LabelSet with given label key value pairs.
117- @available ( * , deprecated, message: " removed from metrics spec in OTEP-90 " )
128+ // Phase 2
129+ //@available(*,deprecated, message: "removed from metrics spec in OTEP-90")
118130 func getLabelSet( labels: [ String : String ] ) -> LabelSet
119131}
120132
121133public extension Meter {
122- @available ( * , deprecated)
134+ // Phase 2
135+ //@available(*,deprecated)
123136 func createIntCounter( name: String ) -> AnyCounterMetric < Int > {
124137 return createIntCounter ( name: name, monotonic: true )
125138 }
126139
127- @available ( * , deprecated)
140+ // Phase 2
141+ //@available(*,deprecated)
128142 func createDoubleCounter( name: String ) -> AnyCounterMetric < Double > {
129143 return createDoubleCounter ( name: name, monotonic: true )
130144 }
131145
132- @available ( * , deprecated)
146+ // Phase 2
147+ //@available(*,deprecated)
133148 func createIntMeasure( name: String ) -> AnyMeasureMetric < Int > {
134149 return createIntMeasure ( name: name, absolute: true )
135150 }
136151
137- @available ( * , deprecated)
152+ // Phase 2
153+ //@available(*,deprecated)
138154 func createDoubleMeasure( name: String ) -> AnyMeasureMetric < Double > {
139155 return createDoubleMeasure ( name: name, absolute: true )
140156 }
141157
142- @available ( * , deprecated)
158+ // Phase 2
159+ //@available(*,deprecated)
143160 func createIntObserver( name: String , callback: @escaping ( IntObserverMetric ) -> Void ) -> IntObserverMetric {
144161 return createIntObserver ( name: name, absolute: true , callback: callback)
145162 }
146163
147- @available ( * , deprecated)
164+ // Phase 2
165+ //@available(*,deprecated)
148166 func createDoubleObserver( name: String , callback: @escaping ( DoubleObserverMetric ) -> Void ) -> DoubleObserverMetric {
149167 return createDoubleObserver ( name: name, absolute: true , callback: callback)
150168 }
0 commit comments