Skip to content

Commit

Permalink
Merge branch 'main' into swiftlog
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-b authored Jul 22, 2024
2 parents e7f66af + 7bad8ae commit 5fb3c3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum PrometheusExporterExtensions {
static let prometheusHistogramBucketPostFix = "_bucket"
static let prometheusHistogramLeLabelName = "le"

static func writeMetricsCollection(exporter: PrometheusExporter) -> String {
public static func writeMetricsCollection(exporter: PrometheusExporter) -> String {
var output = ""
let metrics = exporter.getAndClearMetrics()
let now = String(Int64((Date().timeIntervalSince1970 * 1000.0).rounded()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SynchronousMetricStorage: SynchronousMetricStorageProtocol {
var aggregatorHandles = [[String: AttributeValue]: AggregatorHandle]()
let attributeProcessor: AttributeProcessor
var aggregatorHandlePool = [AggregatorHandle]()
private let aggregatorHandlesQueue = DispatchQueue(label: "org.opentelemetry.SynchronousMetricStorage.aggregatorHandlesQueue", attributes: .concurrent)
private let aggregatorHandlesQueue = DispatchQueue(label: "org.opentelemetry.SynchronousMetricStorage.aggregatorHandlesQueue")


static func empty() -> SynchronousMetricStorageProtocol {
Expand Down Expand Up @@ -76,7 +76,7 @@ public class SynchronousMetricStorage: SynchronousMetricStorageProtocol {

var points = [PointData]()

aggregatorHandlesQueue.sync(flags: .barrier) {
aggregatorHandlesQueue.sync {
aggregatorHandles.forEach { key, value in
let point = value.aggregateThenMaybeReset(startEpochNano: start, endEpochNano: epochNanos, attributes: key, reset: reset)
if reset {
Expand Down

0 comments on commit 5fb3c3f

Please sign in to comment.