SetSampleRate selects the sampling policy for the whole invocation. Changes after Finish have no effect.
(rate int)
| 306 | // SetSampleRate selects the sampling policy for the whole invocation. |
| 307 | // Changes after Finish have no effect. |
| 308 | func (s *service) SetSampleRate(rate int) { |
| 309 | s.mu.Lock() |
| 310 | defer s.mu.Unlock() |
| 311 | |
| 312 | if s.finished { |
| 313 | return |
| 314 | } |
| 315 | s.sampleRate = rate |
| 316 | s.commonDimensions["sample_rate"] = strconv.Itoa(rate) |
| 317 | } |
| 318 | |
| 319 | // Finish snapshots the recorded events once and sends their payload after releasing the lock. |
| 320 | // Sampling and telemetry eligibility apply to immediate and pending events alike. |
nothing calls this directly
no outgoing calls
no test coverage detected