vmbolt

package module
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 18 Imported by: 0

README

vmbolt

vmbolt is a pure-memory key/value store — a fork of bbolt rebuilt around an in-memory node graph instead of an mmap'd file.

  • Module: github.com/13eholder/vmbolt · package: vmbolt
  • Top-level buckets stay flat and keep their own B+tree structure, but the database publishes one globally consistent view per transaction commit.
  • No on-disk persistence by default: the whole database lives in process memory. A snapshot can be written/read back on demand (BMSP format), but there is no per-commit fsync, no WAL, and no file lock.
  • The bbolt transaction/bucket/cursor API shape is preserved (Update, View, Batch, Bucket, Cursor, …), so existing call sites port with minimal changes.

vmbolt is for workloads that want bbolt-style atomic/isolation transaction semantics and ordered B+tree access without a disk — caches, transient indexes, session stores, test doubles, or a non-durable etcd-like store. If you need durability across restarts, use upstream bbolt.


Table of contents


Install

go get github.com/13eholder/vmbolt@latest
import "github.com/13eholder/vmbolt"

db, err := vmbolt.Open("", 0600, nil) // path is ignored for storage
if err != nil {
	return err
}
defer db.Close()

Open(path, …) does not create or read a regular bbolt file. The path is kept only so that, if it happens to hold a BMSP snapshot, the database rehydrates from it on open; otherwise the DB starts empty.


Quick start

db, err := vmbolt.Open("", 0600, nil)
if err != nil { log.Fatal(err) }
defer db.Close()

// Write
err = db.Update(func(tx *vmbolt.Tx) error {
	bucket, err := tx.CreateBucketIfNotExists([]byte("MyBucket"))
	if err != nil { return err }
	return bucket.Put([]byte("answer"), []byte("42"))
})

// Read
_ = db.View(func(tx *vmbolt.Tx) error {
	v := tx.Bucket([]byte("MyBucket")).Get([]byte("answer"))
	fmt.Printf("The answer is: %s\n", v) // 42
	return nil
})

// Range scan
_ = db.View(func(tx *vmbolt.Tx) error {
	c := tx.Bucket([]byte("MyBucket")).Cursor()
	for k, v := c.Seek([]byte("a")); k != nil; k, v = c.Next() {
		fmt.Printf("%s = %s\n", k, v)
	}
	return nil
})

The model

Flat top-level buckets

The database is a directory of named top-level buckets held inside one published database state:

DB.state -> dbState{ buckets map[string]*bucketState }
  • Each top-level bucket is a B+tree whose branch entries hold direct *node child pointers — the tree itself is the index; there is no flat node-id map.
  • Readers observe all buckets through one globally published dbState, so a transaction sees one consistent database view across all buckets.
  • Writes use path-copy COW: a write transaction copies only the root-to-leaf path it touches; unchanged subtrees are shared by pointer. Commit publishes one new root pointer per touched bucket — O(log N), not a rebuilt index — so per-commit cost stays nearly flat as a bucket grows.
Read snapshot isolation

A read transaction pins the current dbState at Begin time and holds that global view for the transaction's lifetime. Reads are therefore consistent both within a bucket and across buckets.

Single writer

There is one global write lock (db.Update/Begin(true)). Commit is path-copy-then-publish: each touched bucket gets a new root (built by copying only the modified path), then one new dbState is atomically published, so a failed commit publishes nothing.


Snapshots & restore (BMSP)

vmbolt is non-durable, but it can serialize the whole database to a BMSP stream on demand and read it back:

// Save
_ = db.View(func(tx *vmbolt.Tx) error {
	return tx.CopyFile("/tmp/snap.bmsp", 0600) // or tx.WriteTo(w)
})

// Restore into a fresh DB
db2, _ := vmbolt.Open("/tmp/snap.bmsp", 0600, nil) // Open auto-restores a BMSP file
// or explicitly: db2.Restore(file)

BMSP is a compact, fully-ordered, streaming format (buckets in sorted name order via Tx.Cursor, keys sorted within each bucket), so the emitted snapshot stream is deterministic for the same logical bucket/key/value contents. Restore preserves data and ordering, but it may rebuild a different in-memory tree shape because restore uses bulk insert settings. Snapshots are written only when you ask (WriteTo/CopyFile); there is no background persistence. Between snapshots, data is volatile.


Testing

The test suite is split by visibility boundary:

  • Black-box tests live in tests/ as package vmbolt_test and exercise the public API from a caller's perspective.
  • White-box tests stay at the repository root as package vmbolt when they need unexported state, node structure, or BMSP format constants.

Run the full suite with:

go test ./...

Use focused commands for heavier paths:

ENABLE_RACE=true make test
go test -bench . ./...

API reference

Database:

Method Notes
Open(path, mode, opts) Open (empty) or rehydrate from a BMSP file at path
Close() Release resources
Update(fn) / View(fn) / Batch(fn) Managed read-write / read-only / batched tx
Begin(writable) Manual transaction (remember to Commit/Rollback)
Restore(r) Rehydrate from a BMSP reader
Stats(), Logger(), IsReadOnly() Diagnostics and state

Options:

Field Notes
ReadOnly Reject Update and writable Begin calls
Logger Optional logger implementation
NoStatistics Disable DB stats collection

Transaction:

Method Notes
Bucket(name) Open a top-level bucket (nil if absent)
CreateBucket / CreateBucketIfNotExists / DeleteBucket Bucket lifecycle
ForEach(fn) Iterate top-level buckets in sorted name order
Cursor() Sorted cursor over top-level bucket names (deterministic)
Size() Whole-DB logical size estimate
Check(options...) Validate the committed snapshot pinned by the transaction
WriteTo(w) / Copy(w) / CopyFile(path, mode) Emit a BMSP snapshot
OnCommit(fn) Post-commit hook

Bucket:

Method Notes
Put / Get / Delete Key/value ops
ForEach(fn) / Cursor() Sorted iteration / point lookup
Stats() Per-bucket statistics

Differences from bbolt

Removed (disk-era machinery the pure-memory engine does not need):

  • mmap'd file, fdatasync/msync, WAL, file lock, Mlock, grow.
  • The on-disk freelist package and the node-id allocator — nodes are linked by direct *node child pointers, so there are no node ids to allocate or recycle.
  • The cmd/bbolt CLI and disk/page-oriented internal tooling and test helpers.
  • Nested buckets — only flat top-level buckets are supported.
  • Disk-oriented Options fields (NoSync, MmapFlags, InitialMmapSize, FreelistType, Mlock, Timeout, …) and DB.Sync/grow/loadFreelist.
  • Disk/page diagnostic compatibility shims such as DB.Info/Info.Data and WithPageId.
  • Tx.Page (removed); Tx.Check now validates the in-memory committed snapshot rather than checking disk pages.

Added:

  • Global in-memory publication via dbState; structurally-shared persistent B+tree (branch inodes hold *node child pointers, path-copy COW on write).
  • BMSP snapshot format + Open auto-restore.
  • Tx.Cursor() over sorted top-level bucket names.
  • Tx.Check() over the published in-memory node graph.

Caveats & limitations

  • Volatile by design. A process crash/exit loses everything not captured in a snapshot. vmbolt is not a replacement for a durable store.
  • Single writer. One write transaction at a time (global lock). Reads are concurrent with the writer.
  • Flat top-level buckets only. Nested bucket APIs were removed.
  • Byte slices from Get/Cursor are valid only for the transaction's lifetime (they reference shared immutable storage). Copy them if you need them beyond the tx.
  • Tx.Check is structural, not durable-storage validation. It checks the committed in-memory snapshot pinned by the transaction; it does not validate a disk file or crash-recovery state.

etcd backend notes

vmbolt's API was shaped with etcd's backend package in mind (etcd uses only flat top-level buckets, never nested). The pieces etcd depends on are present:

  • sorted Tx.Cursor() (deterministic Hash/snapshot),
  • Tx.WriteTo/snapshot streaming (BMSP),
  • Tx.Size(),
  • one globally consistent transaction view, so meta + key advance together.

The fundamental gap is durability: etcd requires a durable, recoverable backend, while vmbolt is memory-only (snapshot-on-demand, volatile between snapshots). vmbolt can serve as a non-durable / in-memory etcd (testing, caching, ephemeral sidecars), not as a drop-in for production etcd storage.

Documentation

Index

Constants

View Source
const (
	// MaxKeySize is the maximum length of a key, in bytes.
	MaxKeySize = 32768

	// MaxValueSize is the maximum length of a value, in bytes.
	MaxValueSize = (1 << 31) - 2
)
View Source
const (
	DefaultMaxBatchSize  int = 1000
	DefaultMaxBatchDelay     = 10 * time.Millisecond
)

Default values if not set in a DB instance.

View Source
const DefaultFillPercent = 0.5

DefaultFillPercent is the percentage that split nodes are filled.

Variables

View Source
var DefaultOptions = &Options{}

DefaultOptions represent the options used if nil options are passed into Open().

Functions

func Assert added in v0.3.2

func Assert(condition bool, msg string, v ...any)

Assert will panic with a given formatted message if the given condition is false.

Types

type Bucket

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

Bucket is a tx-local handle to one top-level B+tree. A Bucket is never shared across transactions.

func (*Bucket) Cursor

func (b *Bucket) Cursor() *Cursor

Cursor creates a cursor associated with the bucket.

func (*Bucket) Delete

func (b *Bucket) Delete(key []byte) (err error)

Delete removes a key from the bucket.

func (*Bucket) FillPercent

func (b *Bucket) FillPercent() float64

FillPercent returns the target fill percentage used when splitting BTree nodes.

func (*Bucket) ForEach

func (b *Bucket) ForEach(fn func(k, v []byte) error) error

ForEach executes a function for each key/value pair in a bucket.

func (*Bucket) Get

func (b *Bucket) Get(key []byte) []byte

Get retrieves the value for a key in the bucket.

func (*Bucket) Inspect

func (b *Bucket) Inspect() BucketStructure

Inspect returns the structure of the bucket.

func (*Bucket) Name

func (b *Bucket) Name() string

Name returns the bucket's name.

func (*Bucket) Put

func (b *Bucket) Put(key []byte, value []byte) (err error)

Put sets the value for a key in the bucket.

func (*Bucket) SetBranchNodeSize added in v0.4.0

func (b *Bucket) SetBranchNodeSize(maxBytes int)

SetBranchNodeSize sets the branch-node split threshold for this bucket. Non-positive values keep the existing threshold. On writable transactions the setting is committed as bucket metadata and reused by later transactions.

func (*Bucket) SetFillPercent added in v0.4.0

func (b *Bucket) SetFillPercent(fillPercent float64)

SetFillPercent sets the target fill percentage used when splitting BTree nodes. Values outside the supported range are clamped.

func (*Bucket) SetLeafNodeSize added in v0.4.0

func (b *Bucket) SetLeafNodeSize(maxBytes int)

SetLeafNodeSize sets the leaf-node split threshold for this bucket. Non-positive values keep the existing threshold. On writable transactions the setting is committed as bucket metadata and reused by later transactions.

func (*Bucket) Stats

func (b *Bucket) Stats() BucketStats

Stats returns stats on a bucket.

func (*Bucket) Tx

func (b *Bucket) Tx() *Tx

Tx returns the tx of the bucket.

func (*Bucket) Writable

func (b *Bucket) Writable() bool

Writable returns whether the bucket is writable.

type BucketStats

type BucketStats struct {
	// Tree statistics.
	KeyN  int // number of keys/value pairs
	Depth int // number of levels in B+tree

	// Page size utilization.
	BranchInuse int // bytes actually used for branch data
	LeafInuse   int // bytes actually used for leaf data
}

BucketStats records statistics about resources used by a bucket.

func (*BucketStats) Add

func (s *BucketStats) Add(other BucketStats)

type BucketStructure

type BucketStructure struct {
	Name     string            `json:"name"`
	KeyN     int               `json:"keyN"`
	Children []BucketStructure `json:"buckets,omitempty"`
}

BucketStructure records the structure of a bucket.

type CheckOption

type CheckOption func(options *checkConfig)

CheckOption configures Tx.Check.

func WithKVStringer

func WithKVStringer(kvStringer KVStringer) CheckOption

WithKVStringer sets a human-readable renderer for keys/values in error messages.

type Cursor

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

Cursor represents an iterator that can traverse over all key/value pairs in a bucket in lexicographical order.

It has two modes:

  • tree mode (bucket != nil): walks a single bucket's B+tree (via Bucket.Cursor());
  • directory mode (bucket == nil, dir set): enumerates the top-level bucket NAMES in sorted order. Produced by Tx.Cursor(); used by snapshot/Hash/defrag-style callers that iterate all top-level buckets deterministically.

func (*Cursor) Bucket

func (c *Cursor) Bucket() *Bucket

Bucket returns the bucket that this cursor was created from. Returns nil for a directory cursor (Tx.Cursor()).

func (*Cursor) Delete

func (c *Cursor) Delete() error

Delete removes the current key/value under the cursor from the bucket.

func (*Cursor) First

func (c *Cursor) First() (key []byte, value []byte)

First moves the cursor to the first item in the bucket and returns its key and value.

func (*Cursor) Last

func (c *Cursor) Last() (key []byte, value []byte)

Last moves the cursor to the last item in the bucket and returns its key and value.

func (*Cursor) Next

func (c *Cursor) Next() (key []byte, value []byte)

Next moves the cursor to the next item in the bucket and returns its key and value.

func (*Cursor) Prev

func (c *Cursor) Prev() (key []byte, value []byte)

Prev moves the cursor to the previous item in the bucket and returns its key and value.

func (*Cursor) Seek

func (c *Cursor) Seek(seek []byte) (key []byte, value []byte)

Seek moves the cursor to a given key using a b-tree search and returns it.

type DB

type DB struct {
	// MaxBatchSize is the maximum size of a batch. Default value is
	// copied from DefaultMaxBatchSize in Open.
	//
	// If <=0, disables batching.
	//
	// Do not change concurrently with calls to Batch.
	MaxBatchSize int

	// MaxBatchDelay is the maximum delay before a batch starts.
	// Default value is copied from DefaultMaxBatchDelay in Open.
	//
	// If <=0, effectively disables batching.
	//
	// Do not change concurrently with calls to Batch.
	MaxBatchDelay time.Duration
	// contains filtered or unexported fields
}

DB represents a collection of top-level buckets held in memory. All data access is performed through transactions which can be obtained through the DB. All the functions on DB will return a ErrDatabaseNotOpen if accessed before Open() is called.

func Open

func Open(path string, mode os.FileMode, options *Options) (db *DB, err error)

Open creates an in-memory database. If path points to a BMSP snapshot, the database is restored from it; missing and non-BMSP paths start empty. The mode argument is accepted for API compatibility. Passing in nil options uses the default vmbolt options.

func (*DB) Batch

func (db *DB) Batch(fn func(*Tx) error) error

Batch calls fn as part of a batch. It behaves similar to Update, except concurrent Batch calls can be combined into a single Bolt transaction.

func (*DB) Begin

func (db *DB) Begin(writable bool) (t *Tx, err error)

Begin starts a new transaction.

func (*DB) Close

func (db *DB) Close() error

Close releases all database resources.

func (*DB) GoString

func (db *DB) GoString() string

GoString returns the Go string representation of the database.

func (*DB) IsReadOnly

func (db *DB) IsReadOnly() bool

func (*DB) Logger

func (db *DB) Logger() Logger

func (*DB) Restore

func (db *DB) Restore(r io.Reader) error

Restore reads a BMSP v2 snapshot with no expected Raft metadata.

func (*DB) RestoreCheckpoint added in v0.5.2

func (db *DB) RestoreCheckpoint(r io.Reader, opts RestoreOptions) (stats SnapshotStats, err error)

RestoreCheckpoint strictly validates and restores a BMSP v2 checkpoint into an open, writable, empty database. No state is published until the complete header, payload, footer, checksum, metadata, counts, and EOF are validated.

func (*DB) Stats

func (db *DB) Stats() Stats

Stats retrieves ongoing performance stats for the database.

func (*DB) String

func (db *DB) String() string

String returns the string representation of the database.

func (*DB) Update

func (db *DB) Update(fn func(*Tx) error) error

Update executes a function within the context of a read-write managed transaction.

func (*DB) View

func (db *DB) View(fn func(*Tx) error) error

View executes a function within the context of a managed read-only transaction.

type DefaultLogger

type DefaultLogger struct {
	*log.Logger
	// contains filtered or unexported fields
}

DefaultLogger is a default implementation of the Logger interface.

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(v ...interface{})

func (*DefaultLogger) Debugf

func (l *DefaultLogger) Debugf(format string, v ...interface{})

func (*DefaultLogger) EnableDebug

func (l *DefaultLogger) EnableDebug()

func (*DefaultLogger) EnableTimestamps

func (l *DefaultLogger) EnableTimestamps()

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(v ...interface{})

func (*DefaultLogger) Errorf

func (l *DefaultLogger) Errorf(format string, v ...interface{})

func (*DefaultLogger) Fatal

func (l *DefaultLogger) Fatal(v ...interface{})

func (*DefaultLogger) Fatalf

func (l *DefaultLogger) Fatalf(format string, v ...interface{})

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(v ...interface{})

func (*DefaultLogger) Infof

func (l *DefaultLogger) Infof(format string, v ...interface{})

func (*DefaultLogger) Panic

func (l *DefaultLogger) Panic(v ...interface{})

func (*DefaultLogger) Panicf

func (l *DefaultLogger) Panicf(format string, v ...interface{})

func (*DefaultLogger) Warning

func (l *DefaultLogger) Warning(v ...interface{})

func (*DefaultLogger) Warningf

func (l *DefaultLogger) Warningf(format string, v ...interface{})

type KVStringer

type KVStringer interface {
	KeyToString([]byte) string
	ValueToString([]byte) string
}

KVStringer renders keys/values for human-readable diagnostic messages.

func HexKVStringer

func HexKVStringer() KVStringer

HexKVStringer serializes both key & value to hex representation.

type Logger

type Logger interface {
	Debug(v ...interface{})
	Debugf(format string, v ...interface{})

	Error(v ...interface{})
	Errorf(format string, v ...interface{})

	Info(v ...interface{})
	Infof(format string, v ...interface{})

	Warning(v ...interface{})
	Warningf(format string, v ...interface{})

	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})

	Panic(v ...interface{})
	Panicf(format string, v ...interface{})
}

type Options

type Options struct {
	// ReadOnly opens the database in read-only mode.
	ReadOnly bool

	// Logger is the logger used for vmbolt.
	Logger Logger

	// NoStatistics turns off statistics collection.
	NoStatistics bool
}

Options represents the options that can be set when opening a database.

func (*Options) String

func (o *Options) String() string

type RestoreOptions added in v0.5.2

type RestoreOptions struct {
	ExpectedMeta SnapshotMeta
	MaxBytes     int64
}

RestoreOptions configures strict checkpoint restoration. A non-zero field in ExpectedMeta must match the corresponding snapshot field. MaxBytes limits total encoded bytes and is checked before length-driven allocations.

type SnapshotMeta added in v0.5.2

type SnapshotMeta struct {
	RaftIndex uint64
	RaftTerm  uint64
	ClusterID uint64
}

SnapshotMeta binds a checkpoint to one Raft state-machine position.

type SnapshotStats added in v0.5.2

type SnapshotStats struct {
	Bytes       int64
	BucketCount uint64
	KVCount     uint64
	SHA256      [sha256.Size]byte
}

SnapshotStats describes the exact encoded checkpoint.

type Stats

type Stats struct {
	// Put `TxStats` at the first field to ensure it's 64-bit aligned.
	TxStats TxStats // global, ongoing stats.

	// Transaction stats
	TxN     int // total number of started read transactions
	OpenTxN int // number of currently open read transactions
}

Stats represents statistics about the database.

func (*Stats) Sub

func (s *Stats) Sub(other *Stats) Stats

Sub calculates and returns the difference between two sets of database stats.

type Tx

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

Tx represents a read-only or read/write transaction on the database.

Every transaction pins one globally consistent dbState at Begin time. A write tx mutates tx-local buckets and publishes one new dbState atomically at commit.

func (*Tx) Bucket

func (tx *Tx) Bucket(name []byte) *Bucket

Bucket retrieves a top-level bucket by name, opening a tx-local context for it.

func (*Tx) Check

func (tx *Tx) Check(options ...CheckOption) <-chan error

Check performs structural consistency validation of the committed database snapshot pinned by this transaction (tx.base). It validates the immutable in-memory node graph directly via child pointers (no flat index).

Every detected inconsistency is streamed on the returned channel; the channel is closed when validation completes. A well-formed database yields no errors.

Concurrent calls on the same transaction are safe: the published snapshot is immutable, so each Check call walks it independently without locks.

Options: WithKVStringer customizes key/value rendering in error messages.

Scope: only the committed snapshot the transaction pinned is validated. Uncommitted, in-flight write-transaction mutations are NOT validated.

func (*Tx) Commit

func (tx *Tx) Commit() (err error)

Commit publishes one new globally consistent state.

func (*Tx) Copy

func (tx *Tx) Copy(w io.Writer) error

Copy writes the entire database to a writer as a BMSP snapshot (see snapshot.go).

func (*Tx) CopyFile

func (tx *Tx) CopyFile(path string, mode os.FileMode) error

CopyFile writes the entire database to a file at path as a BMSP snapshot.

func (*Tx) CreateBucket

func (tx *Tx) CreateBucket(name []byte) (*Bucket, error)

CreateBucket creates a new top-level bucket and returns a tx-local handle to it.

func (*Tx) CreateBucketIfNotExists

func (tx *Tx) CreateBucketIfNotExists(name []byte) (*Bucket, error)

CreateBucketIfNotExists creates a new bucket if it doesn't already exist.

func (*Tx) Cursor

func (tx *Tx) Cursor() *Cursor

Cursor returns a directory cursor over the top-level bucket names in sorted order. Tx关闭后调用会返回空Cursor,调用对应方法会Panic,和bbolt语义兼容

func (*Tx) DB

func (tx *Tx) DB() *DB

DB returns a reference to the database that created the transaction.

func (*Tx) DeleteBucket

func (tx *Tx) DeleteBucket(name []byte) error

DeleteBucket deletes a top-level bucket.

func (*Tx) ForEach

func (tx *Tx) ForEach(fn func(name []byte, b *Bucket) error) error

ForEach executes a function for each top-level bucket.

func (*Tx) Inspect

func (tx *Tx) Inspect() BucketStructure

Inspect returns the structure of the database: a synthetic "root" whose children are the top-level buckets.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(fn func())

OnCommit adds a handler function to be executed after the transaction successfully commits.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback closes the transaction and ignores all previous updates.

func (*Tx) Size

func (tx *Tx) Size() int64

Size returns the logical payload size of the whole database view in bytes.

func (*Tx) Stats

func (tx *Tx) Stats() TxStats

Stats retrieves a copy of the current transaction statistics.

func (*Tx) Writable

func (tx *Tx) Writable() bool

Writable returns whether the transaction can perform write operations.

func (*Tx) WriteCheckpoint added in v0.5.2

func (tx *Tx) WriteCheckpoint(w io.Writer, meta SnapshotMeta) (SnapshotStats, error)

WriteCheckpoint writes the transaction's pinned view as BMSP v2.

func (*Tx) WriteTo

func (tx *Tx) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes the entire database to a writer as a BMSP snapshot.

type TxStats

type TxStats struct {
	CursorCount    int64
	NodeCount      int64
	NodeDeref      int64
	Rebalance      int64
	RebalanceTime  time.Duration
	Split          int64
	Spill          int64
	SpillTime      time.Duration
	Write          int64 // number of mutating operations applied to B+tree nodes
	WriteBytes     int64 // logical key/value bytes passed through Put
	WriteTime      time.Duration
	DirtyNodeCount int64 // dirty nodes observed at commit
	CommitTime     time.Duration
}

TxStats represents statistics about the actions performed by the transaction.

func (*TxStats) GetCommitTime added in v0.3.2

func (s *TxStats) GetCommitTime() time.Duration

func (*TxStats) GetCursorCount

func (s *TxStats) GetCursorCount() int64

func (*TxStats) GetDirtyNodeCount added in v0.3.2

func (s *TxStats) GetDirtyNodeCount() int64

func (*TxStats) GetNodeCount

func (s *TxStats) GetNodeCount() int64

func (*TxStats) GetNodeDeref

func (s *TxStats) GetNodeDeref() int64

func (*TxStats) GetRebalance

func (s *TxStats) GetRebalance() int64

func (*TxStats) GetRebalanceTime

func (s *TxStats) GetRebalanceTime() time.Duration

func (*TxStats) GetSpill

func (s *TxStats) GetSpill() int64

func (*TxStats) GetSpillTime

func (s *TxStats) GetSpillTime() time.Duration

func (*TxStats) GetSplit

func (s *TxStats) GetSplit() int64

func (*TxStats) GetWrite

func (s *TxStats) GetWrite() int64

func (*TxStats) GetWriteBytes added in v0.3.2

func (s *TxStats) GetWriteBytes() int64

func (*TxStats) GetWriteTime

func (s *TxStats) GetWriteTime() time.Duration

func (*TxStats) IncCommitTime added in v0.3.2

func (s *TxStats) IncCommitTime(delta time.Duration) time.Duration

func (*TxStats) IncCursorCount

func (s *TxStats) IncCursorCount(delta int64) int64

func (*TxStats) IncDirtyNodeCount added in v0.3.2

func (s *TxStats) IncDirtyNodeCount(delta int64) int64

func (*TxStats) IncNodeCount

func (s *TxStats) IncNodeCount(delta int64) int64

func (*TxStats) IncNodeDeref

func (s *TxStats) IncNodeDeref(delta int64) int64

func (*TxStats) IncRebalance

func (s *TxStats) IncRebalance(delta int64) int64

func (*TxStats) IncRebalanceTime

func (s *TxStats) IncRebalanceTime(delta time.Duration) time.Duration

func (*TxStats) IncSpill

func (s *TxStats) IncSpill(delta int64) int64

func (*TxStats) IncSpillTime

func (s *TxStats) IncSpillTime(delta time.Duration) time.Duration

func (*TxStats) IncSplit

func (s *TxStats) IncSplit(delta int64) int64

func (*TxStats) IncWrite

func (s *TxStats) IncWrite(delta int64) int64

func (*TxStats) IncWriteBytes added in v0.3.2

func (s *TxStats) IncWriteBytes(delta int64) int64

func (*TxStats) IncWriteTime

func (s *TxStats) IncWriteTime(delta time.Duration) time.Duration

func (*TxStats) Sub

func (s *TxStats) Sub(other *TxStats) TxStats

Sub calculates and returns the difference between two sets of transaction stats.

Directories

Path Synopsis
Package errors defines the error variables that may be returned during vmbolt operations.
Package errors defines the error variables that may be returned during vmbolt operations.

Jump to

Keyboard shortcuts

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