MCPcopy Index your code
hub / github.com/coder/coder / Len

Method Len

agent/agentproc/headtail.go:182–193  ·  view source on GitHub ↗

Len returns the number of bytes currently stored in the buffer.

()

Source from the content-addressed store, hash-verified

180// Len returns the number of bytes currently stored in the
181// buffer.
182func (b *HeadTailBuffer) Len() int {
183 b.mu.Lock()
184 defer b.mu.Unlock()
185
186 tailLen := 0
187 if b.tailFull {
188 tailLen = b.maxTail
189 } else if b.tail != nil {
190 tailLen = b.tailPos
191 }
192 return len(b.head) + tailLen
193}
194
195// TotalWritten returns the total number of bytes written to
196// the buffer, which may exceed the stored capacity.

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45