Schedule

Ordered collections of Taus for time-series data management

A Schedule is an ordered collection of related Taus, representing a single, continuous timeline of events. It is the fundamental building block for all time-series data in τ.

Think of a Schedule as a log of changes for a specific variable. It allows you to:

  • Reconstruct the value of that variable at any point in time.
  • Query a range of historical values.
  • Maintain a complete and deterministic audit trail of all changes.

The Structure of a Schedule

A Schedule consists of:

  • name: A unique, human-readable identifier (e.g., "temperature_sensor_1").
  • taus: A chronologically sorted array of Tau structs.

This simple structure is highly efficient for append-only workloads and time-based queries.

libtau/primitives/schedule.zig
1/// An ordered collection of Taus.
2pub const Schedule = struct {
3    name: []const u8,
4    taus: []Tau,
5
6    // ... methods
7};

Core Operations

Creating a Schedule

A Schedule is created with a name and an initial set of Taus. In practice, you often create an empty schedule and then append data to it.

REPL
1τ> create_schedule temperature_sensor_1
2OK

Appending Data

The append command is the primary way to add data to a Schedule. Each append operation adds a new Tau to the timeline.

REPL

The taus array within a Schedule is always kept sorted by valid_ns. The append operation inserts the new Tau in the correct chronological position.

Querying a Schedule

You can query a schedule to retrieve its value at a specific point in time or over a range.

Point-in-Time Query

Use the at command to get the value at an exact nanosecond timestamp.

REPL
1τ> at temperature_sensor_1 1500000000
222.5

Range Query

Use the range command to retrieve all Taus within a specified time interval.

REPL
1τ> range temperature_sensor_1 0 3000000000
2(1000000000, 22.5)

Bitemporality: valid_at

Schedules also support bitemporal queries through the valid_at command. This allows you to ask what the value was "as of" a certain time, which is crucial for auditing and historical analysis.

REPL
1# What was the official temperature reading at t=1.5s?
2τ> valid_at temperature_sensor_1 1500000000
322.5

Last updated: 2/1/2026