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

Method Size

agent/immortalstreams/backedpipe/ring_buffer.go:26–35  ·  view source on GitHub ↗

Size returns the current number of bytes in the buffer.

()

Source from the content-addressed store, hash-verified

24
25// Size returns the current number of bytes in the buffer.
26func (rb *ringBuffer) Size() int {
27 if rb.end == -1 {
28 return 0 // Buffer is empty
29 }
30 if rb.start <= rb.end {
31 return rb.end - rb.start + 1
32 }
33 // Buffer wraps around
34 return len(rb.buffer) - rb.start + rb.end + 1
35}
36
37// Write writes data to the ring buffer. If the buffer would overflow,
38// it evicts the oldest data to make room for new data.

Callers 15

WriteMethod · 0.95
evictMethod · 0.95
ReadLastMethod · 0.95
acquireProtoJobMethod · 0.80
serveRefMethod · 0.80
CompleteJobMethod · 0.80
handleInitRequestMethod · 0.80
TestWorkspaceAgentFunction · 0.80
loggingWaitFileFunction · 0.80
runFunction · 0.80
mainFunction · 0.80
estimateModuleSizeFunction · 0.80

Calls

no outgoing calls

Tested by 4

TestWorkspaceAgentFunction · 0.64
loggingWaitFileFunction · 0.64
TestInstallFunction · 0.64
StopRecordingMethod · 0.64