Begin copies an event's initial facts and returns a handle for adding facts until Finish. Events begun after Finish are not recorded.
(event ghtelemetry.Event)
| 289 | // Begin copies an event's initial facts and returns a handle for adding |
| 290 | // facts until Finish. Events begun after Finish are not recorded. |
| 291 | func (s *service) Begin(event ghtelemetry.Event) ghtelemetry.PendingEvent { |
| 292 | s.mu.Lock() |
| 293 | defer s.mu.Unlock() |
| 294 | |
| 295 | if s.finished { |
| 296 | return noOpPendingEvent{} |
| 297 | } |
| 298 | recorded := &recordedEvent{ |
| 299 | event: cloneEvent(event), |
| 300 | recordedAt: time.Now(), |
| 301 | } |
| 302 | s.events = append(s.events, recorded) |
| 303 | return &pendingEvent{service: s, recorded: recorded} |
| 304 | } |
| 305 | |
| 306 | // SetSampleRate selects the sampling policy for the whole invocation. |
| 307 | // Changes after Finish have no effect. |
nothing calls this directly
no test coverage detected