File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,22 @@ if #available(macOS 10.14, *) {
4545}
4646
4747func createSpan( ) {
48- let parentSpan = tracer. spanBuilder ( spanName: " Main " ) . setSpanKind ( spanKind: . client) . startSpan ( )
49- parentSpan . setAttribute ( key: sampleKey, value: sampleValue)
50- for _ in 1 ... 10 {
51- doWork ( parentSpan: parentSpan )
48+ let parentSpan1 = tracer. spanBuilder ( spanName: " Main " ) . setSpanKind ( spanKind: . client) . startSpan ( )
49+ parentSpan1 . setAttribute ( key: sampleKey, value: sampleValue)
50+ for _ in 1 ... 3 {
51+ doWork ( parentSpan: parentSpan1 )
5252 }
5353 Thread . sleep ( forTimeInterval: 0.5 )
54- parentSpan. end ( )
54+ parentSpan1. end ( )
55+
56+ let parentSpan2 = tracer. spanBuilder ( spanName: " Another " ) . setSpanKind ( spanKind: . client) . startSpan ( )
57+ parentSpan2. setAttribute ( key: sampleKey, value: sampleValue)
58+ // do more Work
59+ for _ in 1 ... 3 {
60+ doWork ( parentSpan: parentSpan2)
61+ }
62+ Thread . sleep ( forTimeInterval: 0.5 )
63+ parentSpan2. end ( )
5564}
5665
5766func doWork( parentSpan: Span ) {
You can’t perform that action at this time.
0 commit comments