Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kvalliyurnatt committed Mar 20, 2024
1 parent 96f1b15 commit d4c8bd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packetbeat/docs/packetbeat-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ disabled, flows are still reported once being timed out. The default value is
==== `enable_delta_flow_reports`

Configure network.bytes and network.packets to be a delta
value instead of a cummlative sum for each flow period. The default value is false.
value instead of a cumlative sum for each flow period. The default value is false.

[float]
[[packetbeat-configuration-flows-fields]]
Expand Down
8 changes: 8 additions & 0 deletions packetbeat/flows/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/json"
"flag"
"os"
"reflect"
"testing"
"time"

Expand Down Expand Up @@ -137,6 +138,11 @@ func TestCreateEvent(t *testing.T) {
}
expectbiFlow.stats[0] = &flowStats{uintFlags: []uint8{1, 1}, uints: []uint64{0, 0}}
expectbiFlow.stats[1] = &flowStats{uintFlags: []uint8{1, 1}, uints: []uint64{0, 0}}

// Assert the biflow is not 0 before the test
assert.Assert(t, !reflect.DeepEqual(expectbiFlow.stats[0].uints, bif.stats[0].uints))
assert.Assert(t, !reflect.DeepEqual(expectbiFlow.stats[1].uints, bif.stats[1].uints))

event = createEvent(&procs.ProcessesWatcher{}, time.Now(), bif, true, nil, []string{"bytes", "packets"}, nil, true)
result = validate(event.Fields)
if errs := result.Errors(); len(errs) > 0 {
Expand All @@ -145,6 +151,8 @@ func TestCreateEvent(t *testing.T) {
}
t.FailNow()
}

// Assert the biflow is 0 after the test
assert.DeepEqual(t, expectbiFlow.stats[0].uintFlags, bif.stats[0].uintFlags)
assert.DeepEqual(t, expectbiFlow.stats[0].uints, bif.stats[0].uints)
assert.DeepEqual(t, expectbiFlow.stats[1].uintFlags, bif.stats[1].uintFlags)
Expand Down

0 comments on commit d4c8bd7

Please sign in to comment.