@@ -114,7 +114,7 @@ extension InMemoryTracer {
114
114
115
115
extension InMemoryTracer {
116
116
117
- /// Array of active spans, i.e. spans which have been started by have not yet finished (by calling `Span/end()`).
117
+ /// Array of active spans, i.e. spans which have been started but have not yet finished (by calling `Span/end()`).
118
118
public var activeSpans : [ InMemorySpan ] {
119
119
_activeSpans. withValue { active in Array ( active. values) }
120
120
}
@@ -152,10 +152,13 @@ extension InMemoryTracer {
152
152
}
153
153
154
154
/// Clears all registered finished spans, as well as injections/extractions performed by this tracer.
155
- public func clearAll( ) {
155
+ public func clearAll( includingActive : Bool = false ) {
156
156
_finishedSpans. withValue { $0 = [ ] }
157
157
_injections. withValue { $0 = [ ] }
158
158
_extractions. withValue { $0 = [ ] }
159
+ if includingActive {
160
+ _activeSpans. withValue { $0 = [ : ] }
161
+ }
159
162
}
160
163
}
161
164
@@ -240,7 +243,7 @@ extension InMemoryTracer {
240
243
/// The carrier object from which the context values were extracted from,
241
244
/// e.g. this frequently is an HTTP request or similar.
242
245
public let carrier : any Sendable
243
- /// The constructed service context, containing the extracted ``ServiceContext/inMemoryTraceContext ``.
246
+ /// The constructed service context, containing the extracted ``ServiceContext/inMemorySpanContext ``.
244
247
public let context : ServiceContext
245
248
}
246
249
}
0 commit comments