Skip to content

Commit 4f63ee9

Browse files
committed
Rename TracerInstantProtocol to TracerInstant
**Motivation:** We're aggresively removing the Protocol suffixes **Result:** cleaner API
1 parent 3bc22fe commit 4f63ee9

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

Sources/Tracing/TracingTime.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ import Darwin
2121
@_exported import Instrumentation
2222
@_exported import InstrumentationBaggage
2323

24-
public protocol TracerInstantProtocol: Comparable, Hashable, Sendable {
24+
public protocol TracerInstant: Comparable, Hashable, Sendable {
2525
/// Representation of this instant as the number of nanoseconds since UNIX Epoch (January 1st 1970)
2626
var nanosecondsSinceEpoch: UInt64 { get }
2727
}
2828

29-
extension TracerInstantProtocol {
29+
extension TracerInstant {
3030
/// Representation of this instant as the number of milliseconds since UNIX Epoch (January 1st 1970)
3131
@inlinable
3232
public var millisecondsSinceEpoch: UInt64 {
@@ -46,7 +46,7 @@ extension TracerInstantProtocol {
4646
/// especially when the system is already using some notion of simulated or mocked time, such that traces are
4747
/// expressed using the same notion of time.
4848
public protocol TracerClock {
49-
associatedtype Instant: TracerInstantProtocol
49+
associatedtype Instant: TracerInstant
5050

5151
var now: Self.Instant { get }
5252
}
@@ -59,7 +59,7 @@ public struct DefaultTracerClock: TracerClock {
5959
// empty
6060
}
6161

62-
public struct Timestamp: TracerInstantProtocol {
62+
public struct Timestamp: TracerInstant {
6363
public let nanosecondsSinceEpoch: UInt64
6464

6565
public init(nanosecondsSinceEpoch: UInt64) {

Tests/TracingTests/DynamicTracepointTracerTests.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ extension DynamicTracepointTestTracer {
281281
return span
282282
}
283283

284-
init<Instant: TracerInstantProtocol>(operationName: String,
285-
startTime: Instant,
286-
baggage: Baggage,
287-
kind: SpanKind,
288-
file fileID: String,
289-
line: UInt,
290-
onEnd: @escaping (TracepointSpan) -> Void)
284+
init<Instant: TracerInstant>(operationName: String,
285+
startTime: Instant,
286+
baggage: Baggage,
287+
kind: SpanKind,
288+
file fileID: String,
289+
line: UInt,
290+
onEnd: @escaping (TracepointSpan) -> Void)
291291
{
292292
self.operationName = operationName
293293
self.startTimestampNanosSinceEpoch = startTime.nanosecondsSinceEpoch

Tests/TracingTests/TestTracer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ final class TestSpan: Span {
150150

151151
let onEnd: (TestSpan) -> Void
152152

153-
init<Instant: TracerInstantProtocol>(
153+
init<Instant: TracerInstant>(
154154
operationName: String,
155155
startTime: Instant,
156156
baggage: Baggage,

Tests/TracingTests/TracedLockTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private final class TracedLockPrintlnTracer: LegacyTracerProtocol {
124124

125125
private(set) var isRecording = false
126126

127-
init<Instant: TracerInstantProtocol>(
127+
init<Instant: TracerInstant>(
128128
operationName: String,
129129
startTime: Instant,
130130
kind: SpanKind,

Tests/TracingTests/TracerTimeTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ final class MockClock: TracerClock {
6161
self._now = time
6262
}
6363

64-
struct Instant: TracerInstantProtocol {
64+
struct Instant: TracerInstant {
6565
var nanosecondsSinceEpoch: UInt64
6666
static func < (lhs: MockClock.Instant, rhs: MockClock.Instant) -> Bool {
6767
lhs.nanosecondsSinceEpoch < rhs.nanosecondsSinceEpoch

0 commit comments

Comments
 (0)