Skip to content

Commit ed78da8

Browse files
committed
more classes, less structs
1 parent debba2d commit ed78da8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/OpenTelemetrySdk/Metrics/Stable/State/SynchronousMetricStorage.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enum MetricStoreError : Error {
1212

1313
typealias SynchronousMetricStorageProtocol = MetricStorage & WritableMetricStorage
1414

15-
public struct SynchronousMetricStorage: SynchronousMetricStorageProtocol {
15+
public class SynchronousMetricStorage: SynchronousMetricStorageProtocol {
1616

1717
let registeredReader : RegisteredReader
1818
public private(set) var metricDescriptor: MetricDescriptor
@@ -47,7 +47,7 @@ public struct SynchronousMetricStorage: SynchronousMetricStorageProtocol {
4747
self.attributeProcessor = attributeProcessor
4848
}
4949

50-
private mutating func getAggregatorHandle(attributes: [String: AttributeValue]) throws -> AggregatorHandle {
50+
private func getAggregatorHandle(attributes: [String: AttributeValue]) throws -> AggregatorHandle {
5151
let processedAttributes = attributeProcessor.process(incoming: attributes)
5252
if let handle = aggregatorHandles[processedAttributes] {
5353
return handle
@@ -66,7 +66,7 @@ public struct SynchronousMetricStorage: SynchronousMetricStorageProtocol {
6666
}
6767
}
6868

69-
public mutating func collect(resource: Resource, scope: InstrumentationScopeInfo, startEpochNanos: UInt64, epochNanos: UInt64) -> StableMetricData {
69+
public func collect(resource: Resource, scope: InstrumentationScopeInfo, startEpochNanos: UInt64, epochNanos: UInt64) -> StableMetricData {
7070
let reset = aggregatorTemporality == .delta
7171
let start = reset ? registeredReader.lastCollectedEpochNanos : startEpochNanos
7272

@@ -91,7 +91,7 @@ public struct SynchronousMetricStorage: SynchronousMetricStorageProtocol {
9191
false
9292
}
9393

94-
public mutating func recordLong(value: Int, attributes: [String : OpenTelemetryApi.AttributeValue]) {
94+
public func recordLong(value: Int, attributes: [String : OpenTelemetryApi.AttributeValue]) {
9595
do {
9696
let handle = try getAggregatorHandle(attributes: attributes)
9797
handle.recordLong(value: value, attributes: attributes)
@@ -102,7 +102,7 @@ public struct SynchronousMetricStorage: SynchronousMetricStorageProtocol {
102102
}
103103
}
104104

105-
public mutating func recordDouble(value: Double, attributes: [String : OpenTelemetryApi.AttributeValue]) {
105+
public func recordDouble(value: Double, attributes: [String : OpenTelemetryApi.AttributeValue]) {
106106
do {
107107
let handle = try getAggregatorHandle(attributes: attributes)
108108
handle.recordDouble(value: value, attributes: attributes)

0 commit comments

Comments
 (0)