Documentation
¶
Index ¶
- type MemoryBuffer
- func (b *MemoryBuffer[R]) Add(record R)
- func (b *MemoryBuffer[R]) CopyAndReset() []R
- func (b *MemoryBuffer[R]) FlushWithoutReset() []R
- func (b *MemoryBuffer[R]) Len() int
- func (b *MemoryBuffer[R]) PriorityPrepend(records []R)
- func (b *MemoryBuffer[R]) Read() []R
- func (b *MemoryBuffer[R]) Recycle(buf []R)
- func (b *MemoryBuffer[R]) TryAdd(record R) bool
- type MemoryPartitionedBuffer
- func (b *MemoryPartitionedBuffer[K, R]) Add(key K, record R) uint64
- func (b *MemoryPartitionedBuffer[K, R]) Capacity(key K) int
- func (b *MemoryPartitionedBuffer[K, R]) CopyAndReset(key K) []R
- func (b *MemoryPartitionedBuffer[K, R]) FlushWithoutReset() map[K][]R
- func (b *MemoryPartitionedBuffer[K, R]) Has(key K) bool
- func (b *MemoryPartitionedBuffer[K, R]) Len(key K) int
- func (b *MemoryPartitionedBuffer[K, R]) PriorityPrepend(key K, records []R)
- func (b *MemoryPartitionedBuffer[K, R]) Read(key K) []R
- func (b *MemoryPartitionedBuffer[K, R]) Recycle(partitionKey K, records []R)
- func (b *MemoryPartitionedBuffer[K, R]) Remove(key K)
- type PartitionKey
- type PartitionedBuffer
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryBuffer ¶
type MemoryBuffer[R Record] struct { // contains filtered or unexported fields }
PartitionBuffer provides a thread-safe buffer for storing internet latency samples. It supports concurrent appends and atomic flushing, as well as a maximum capacity with backpressure to avoid having too many records in the buffer at once.
func NewMemoryBuffer ¶
func NewMemoryBuffer[R Record](capacity int) *MemoryBuffer[R]
func (*MemoryBuffer[R]) Add ¶
func (b *MemoryBuffer[R]) Add(record R)
func (*MemoryBuffer[R]) CopyAndReset ¶
func (b *MemoryBuffer[R]) CopyAndReset() []R
func (*MemoryBuffer[R]) FlushWithoutReset ¶
func (b *MemoryBuffer[R]) FlushWithoutReset() []R
func (*MemoryBuffer[R]) Len ¶
func (b *MemoryBuffer[R]) Len() int
func (*MemoryBuffer[R]) PriorityPrepend ¶
func (b *MemoryBuffer[R]) PriorityPrepend(records []R)
func (*MemoryBuffer[R]) Read ¶
func (b *MemoryBuffer[R]) Read() []R
func (*MemoryBuffer[R]) Recycle ¶
func (b *MemoryBuffer[R]) Recycle(buf []R)
func (*MemoryBuffer[R]) TryAdd ¶
func (b *MemoryBuffer[R]) TryAdd(record R) bool
type MemoryPartitionedBuffer ¶
type MemoryPartitionedBuffer[K PartitionKey, R Record] struct { // contains filtered or unexported fields }
func NewMemoryPartitionedBuffer ¶
func NewMemoryPartitionedBuffer[K PartitionKey, R Record](partitionBufferCapacity int) *MemoryPartitionedBuffer[K, R]
func (*MemoryPartitionedBuffer[K, R]) Add ¶
func (b *MemoryPartitionedBuffer[K, R]) Add(key K, record R) uint64
func (*MemoryPartitionedBuffer[K, R]) Capacity ¶ added in v0.6.3
func (b *MemoryPartitionedBuffer[K, R]) Capacity(key K) int
func (*MemoryPartitionedBuffer[K, R]) CopyAndReset ¶
func (b *MemoryPartitionedBuffer[K, R]) CopyAndReset(key K) []R
func (*MemoryPartitionedBuffer[K, R]) FlushWithoutReset ¶
func (b *MemoryPartitionedBuffer[K, R]) FlushWithoutReset() map[K][]R
func (*MemoryPartitionedBuffer[K, R]) Has ¶
func (b *MemoryPartitionedBuffer[K, R]) Has(key K) bool
func (*MemoryPartitionedBuffer[K, R]) Len ¶ added in v0.6.3
func (b *MemoryPartitionedBuffer[K, R]) Len(key K) int
func (*MemoryPartitionedBuffer[K, R]) PriorityPrepend ¶
func (b *MemoryPartitionedBuffer[K, R]) PriorityPrepend(key K, records []R)
func (*MemoryPartitionedBuffer[K, R]) Read ¶
func (b *MemoryPartitionedBuffer[K, R]) Read(key K) []R
func (*MemoryPartitionedBuffer[K, R]) Recycle ¶
func (b *MemoryPartitionedBuffer[K, R]) Recycle(partitionKey K, records []R)
func (*MemoryPartitionedBuffer[K, R]) Remove ¶
func (b *MemoryPartitionedBuffer[K, R]) Remove(key K)
type PartitionKey ¶
type PartitionKey interface {
comparable
}
type PartitionedBuffer ¶
Click to show internal directories.
Click to hide internal directories.