NOTE(Xe): This func init is used to detect TS_DEBUG_FILTER_RATE_LIMIT_LOGS=all, and if it matches, to effectively disable the limits on the log rate by setting the limit to 1 millisecond. This should capture everything.
()
| 331 | // effectively disable the limits on the log rate by setting the limit |
| 332 | // to 1 millisecond. This should capture everything. |
| 333 | func init() { |
| 334 | if envknob.String("TS_DEBUG_FILTER_RATE_LIMIT_LOGS") != "all" { |
| 335 | return |
| 336 | } |
| 337 | |
| 338 | acceptBucket = rate.NewLimiter(rate.Every(time.Millisecond), 10) |
| 339 | dropBucket = rate.NewLimiter(rate.Every(time.Millisecond), 10) |
| 340 | } |
| 341 | |
| 342 | func (f *Filter) logRateLimit(runflags RunFlags, q *packet.Parsed, dir direction, r Response, why string) { |
| 343 | if runflags == 0 || !f.loggingAllowed(q) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…