mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 19:09:58 +00:00
TUN-7133: Add sampling support for streaming logs
In addition to supporting sampling support for streaming logs, cloudflared tail also supports this via `--sample 0.5` to sample 50% of your log events.
This commit is contained in:
@@ -57,13 +57,23 @@ func TestIntoClientEvent_StartStreaming(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "sampling filter",
|
||||
expected: EventStartStreaming{
|
||||
ClientEvent: ClientEvent{Type: StartStreaming},
|
||||
Filters: &StreamingFilters{
|
||||
Sampling: 0.5,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "level and events filters",
|
||||
expected: EventStartStreaming{
|
||||
ClientEvent: ClientEvent{Type: StartStreaming},
|
||||
Filters: &StreamingFilters{
|
||||
Level: infoLevel,
|
||||
Events: []LogEventType{Cloudflared},
|
||||
Level: infoLevel,
|
||||
Events: []LogEventType{Cloudflared},
|
||||
Sampling: 0.5,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user