memlog

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Code generated by ring-buffer-gen. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(depth uint) *statLogger

func NewDumped

func NewDumped(filename string, depth uint) (*dumped, error)

Types

type RingBuffer

type RingBuffer struct {
	// contains filtered or unexported fields
}

Ring buffer for type Record

func NewRingBuffer

func NewRingBuffer(size uint) *RingBuffer

New instance of ring buffer

func WrapRingBuffer

func WrapRingBuffer(buffer []stats.Record) *RingBuffer

Wrap pre-allocated buffer to ring buffer

func (*RingBuffer) Add

func (rb *RingBuffer) Add(value stats.Record)

Add new element to the ring buffer. If buffer is full, the oldest element will be overwritten

func (*RingBuffer) Clone

func (rb *RingBuffer) Clone() *RingBuffer

Clone of ring buffer with shallow copy of underlying buffer

func (*RingBuffer) Flatten

func (rb *RingBuffer) Flatten() []stats.Record

Flatten copy of underlying buffer. Data is always ordered in an insertion order

func (*RingBuffer) Get

func (rb *RingBuffer) Get(index int) (ans stats.Record)

Get element by index. Negative index is counting from end

func (*RingBuffer) Len

func (rb *RingBuffer) Len() int

Length of used elements. Always in range between zero and maximum capacity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL