Просмотр исходного кода

Merge pull request #37084 from nwneisen/update-ring-buffer-documents

Update documentation for RingLogger's ring buffer
Anusha Ragunathan 7 лет назад
Родитель
Сommit
59698778fe
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      daemon/logger/ring.go
  2. 1 1
      daemon/logger/ring_test.go

+ 1 - 1
daemon/logger/ring.go

@@ -150,7 +150,7 @@ func newRing(maxBytes int64) *messageRing {
 }
 }
 
 
 // Enqueue adds a message to the buffer queue
 // 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.
 // 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 {
 func (r *messageRing) Enqueue(m *Message) error {
 	mSize := int64(len(m.Line))
 	mSize := int64(len(m.Line))

+ 1 - 1
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++ {
 	for i := 0; i < 5; i++ {
 		m, err := r.Dequeue()
 		m, err := r.Dequeue()
 		if err != nil {
 		if err != nil {