From 7321d16dc7b8b9ca5c717836c2460921cb7ba289 Mon Sep 17 00:00:00 2001 From: Nick Neisen Date: Wed, 16 May 2018 18:52:50 -0600 Subject: [PATCH] Update documentation for RingLogger's ring buffer Signed-off-by: Nick Neisen Upstream-commit: 3521d534e5c9338ae5605d1228554862e922a8a9 Component: engine --- components/engine/daemon/logger/ring.go | 2 +- components/engine/daemon/logger/ring_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/engine/daemon/logger/ring.go b/components/engine/daemon/logger/ring.go index 887f2ea18a..c675c1e83c 100644 --- a/components/engine/daemon/logger/ring.go +++ b/components/engine/daemon/logger/ring.go @@ -150,7 +150,7 @@ func newRing(maxBytes int64) *messageRing { } // Enqueue adds a message to the buffer queue -// If the message is too big for the buffer it drops the oldest messages to make room +// If the message is too big for the buffer it drops the new message. // If there are no messages in the queue and the message is still too big, it adds the message anyway. func (r *messageRing) Enqueue(m *Message) error { mSize := int64(len(m.Line)) diff --git a/components/engine/daemon/logger/ring_test.go b/components/engine/daemon/logger/ring_test.go index e774535fee..a2289cc667 100644 --- a/components/engine/daemon/logger/ring_test.go +++ b/components/engine/daemon/logger/ring_test.go @@ -58,7 +58,7 @@ func TestRingCap(t *testing.T) { } } - // should have messages in the queue for "5" to "10" + // should have messages in the queue for "0" to "4" for i := 0; i < 5; i++ { m, err := r.Dequeue() if err != nil {