Skip to main content

Crate timslite

Crate timslite 

Source
Expand description

timslite - Rust time-series data storage library.

A high-performance, mmap-backed time-series data store with:

  • Block-level aggregation (uncompressed payload max 256KB per block)
  • Delayed compression (seal on overflow)
  • Lazy segment lifecycle (on-demand open, idle-close after 30min)
  • Time-indexed queries with binary search
  • Explicit create/open/drop lifecycle for datasets

§Quick Start

ⓘ
use timslite::{Store, StoreConfig};

let config = StoreConfig::default();
let mut store = Store::open("/data/timslite", config).unwrap();

// Create a new dataset (specify segment sizes and compression)
store.create_dataset("my_data", "events",
    64 * 1024 * 1024,   // data_segment_size = 64MB
    16 * 1024 * 1024,   // index_segment_size = 16MB
    6,                  // compress_level
    0,                  // index_continuous
    0,                  // retention in timestamp units (0 = no limit)
).unwrap();

// Open an existing dataset (parameters read from meta file)
store.open_dataset("my_data", "events").unwrap();
// ... write and query

Re-exports§

pub use config::DataSetConfig;
pub use config::DataSetConfigBuilder;
pub use config::StoreConfig;
pub use config::StoreConfigBuilder;
pub use error::Result;
pub use error::TmslError;

Modules§

config
Configuration types for timslite.
error
Error types for timslite.

Structs§

DataSet
DataSetInfo
Immutable dataset configuration info.
DataSetInspectResult
Result of DataSet::inspect().
DataSetState
Mutable dataset state info.
DatasetQueue
Queue handle for a dataset (Clone-safe, singleton per dataset).
DatasetQueueConsumer
Consumer handle for a specific consumer group.
DatasetQueueConsumerInfo
Immutable consumer-group configuration returned by inspect.
DatasetQueueConsumerInspectResult
Consumer-group inspect result.
DatasetQueueConsumerPendingEntry
Public pending-entry snapshot returned by DatasetQueueConsumer::inspect.
DatasetQueueConsumerState
Mutable consumer-group state returned by inspect.
JournalAppendInfo
JournalIndexInfo
JournalQueue
JournalQueueConsumer
JournalRecord
PendingEntry
A single pending entry tracked in the consumer state file.
QueryIterator
Public lazy query iterator backed by a Store-managed dataset.
QueryLengthIterator
Public lazy iterator for data lengths returned by DataSet::query_length_iter.
QueueConsumerConfig
Runtime retry/visibility settings for one consumer group.
Store
The Store: top-level facade for managing datasets.
TickResult
Result returned by a single tick() call.

Enums§

JournalRecordKind

Constants§

BLOCK_HEADER_SIZE
Size of a block header in bytes.
BLOCK_MAX_SIZE
Maximum payload size of a normal aggregated block in bytes.
DATA_HEADER_SIZE
Data segment v1 default header size in bytes.
FILE_TYPE_DATA
File type: data segment.
FILE_TYPE_INDEX
File type: index segment.
INDEX_ENTRY_SIZE
Size of an index entry in bytes.
INDEX_HEADER_SIZE
Index segment default header size in bytes.
INDEX_VERSION
Index segment file format version.
JOURNAL_DATASET_NAME
JOURNAL_DATASET_TYPE
MAGIC
Magic bytes identifying a timslite file.
QUEUE_MAX_PENDING_ENTRIES
Maximum pending entries per consumer group.
QUEUE_STATE_FILE_SIZE
Queue state file size in bytes (4KB).
QUEUE_STATE_MAGIC
Queue state file magic bytes (“QSTF”).
QUEUE_STATE_VERSION
Queue state file version.
VERSION
Data segment and journal segment file format version.

Type Aliases§

QueuePollCallback
Lightweight callback invoked after queue data notifications.