mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-11 05:30:30 +08: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:
@@ -67,6 +67,27 @@ func TestSession_Insert(t *testing.T) {
|
||||
},
|
||||
expectLog: false,
|
||||
},
|
||||
{
|
||||
name: "sampling",
|
||||
filters: StreamingFilters{
|
||||
Sampling: 0.9999999,
|
||||
},
|
||||
expectLog: true,
|
||||
},
|
||||
{
|
||||
name: "sampling (invalid negative)",
|
||||
filters: StreamingFilters{
|
||||
Sampling: -1.0,
|
||||
},
|
||||
expectLog: true,
|
||||
},
|
||||
{
|
||||
name: "sampling (invalid too large)",
|
||||
filters: StreamingFilters{
|
||||
Sampling: 2.0,
|
||||
},
|
||||
expectLog: true,
|
||||
},
|
||||
{
|
||||
name: "filter and event",
|
||||
filters: StreamingFilters{
|
||||
|
||||
Reference in New Issue
Block a user