Skip to content

Commit f3866da

Browse files
author
Ignacio Bonafonte
authored
Merge pull request #365 from emanuelschmoczer/fix-multiple-warnings
Fix multiple Xcode warnings
2 parents f2b2e4a + 633130e commit f3866da

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

Examples/OTLP Exporter/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var instrumentationScopeInfo = InstrumentationScopeInfo(name: instrumentationSco
2727
var tracer: TracerSdk
2828
tracer = OpenTelemetrySDK.instance.tracerProvider.get(instrumentationName: instrumentationScopeName, instrumentationVersion: instrumentationScopeVersion) as! TracerSdk
2929

30-
let configuration = ClientConnection.Configuration(
30+
let configuration = ClientConnection.Configuration.default(
3131
target: .hostAndPort("localhost", 4317),
3232
eventLoopGroup: MultiThreadedEventLoopGroup(numberOfThreads: 1)
3333
)

Sources/Exporters/Prometheus/PrometheusExporter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import NIOConcurrencyHelpers
88
import OpenTelemetrySdk
99

1010
public class PrometheusExporter: MetricExporter {
11-
fileprivate let metricsLock = Lock()
11+
fileprivate let metricsLock = NIOLock()
1212
let options: PrometheusExporterOptions
1313
private var metrics = [Metric]()
1414

Tests/ExportersTests/Prometheus/PrometheusExporterTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class PrometheusExporterTests: XCTestCase {
3131
}
3232

3333
let retain_me = collectMetrics(simpleProcessor: simpleProcessor, exporter: promExporter)
34+
_ = retain_me // silence warning
3435
usleep(useconds_t(waitDuration * 1000000))
3536
let url = URL(string: "http://localhost:9184/metrics/")!
3637
let task = URLSession.shared.dataTask(with: url) { data, response, error in
@@ -69,7 +70,7 @@ class PrometheusExporterTests: XCTestCase {
6970
let testCounter = meter.createIntCounter(name: "testCounter")
7071
let testMeasure = meter.createIntMeasure(name: "testMeasure")
7172
let boundaries: Array<Int> = [5, 10, 25]
72-
var testHistogram = meter.createIntHistogram(name: "testHistogram", explicitBoundaries: boundaries, absolute: true)
73+
let testHistogram = meter.createIntHistogram(name: "testHistogram", explicitBoundaries: boundaries, absolute: true)
7374
let labels1 = ["dim1": "value1", "dim2": "value1"]
7475
let labels2 = ["dim1": "value2", "dim2": "value2"]
7576
let labels3 = ["dim1": "value1"]

Tests/InstrumentationTests/NetworkStatusTests/NetworkStatusTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122

123123
var (type, subtype, info) = wifi_status.status()
124124
XCTAssertNil(info)
125+
XCTAssertNil(subtype)
125126
XCTAssertEqual("wifi", type)
126127

127128
let cell_status = NetworkStatus(with: MockNetworkMonitor(connection: .cellular), info: MockCTTelephonyNetworkInfo(dataServiceIndentifier: nil, currentRadioAccessTechnology: nil, carrier: nil))

0 commit comments

Comments
 (0)