tiny.trace.TraceReaderCapacity
Defined in tiny.trace.
API (17)
Actions
Public operations.
Fields and members
Public fields and members.
block_byteschunk_bytesdatabaseevent_bytesinput_bytesinput_offsetjson_nestingjson_stack_bytesjson_stack_offsetpath_bytespath_offsetroot_path_bytesroot_path_offsetsql_bytessql_offsetstorage_bytes
Source
Source: lib/trace/src/store/reader/capacity.zig:35
zig
pub const Capacity = struct { root_path_bytes: usize, root_path_offset: usize, event_bytes: usize, chunk_bytes: usize, block_bytes: usize, input_bytes: usize, input_offset: usize, path_bytes: usize, path_offset: usize, json_nesting: usize, json_stack_bytes: usize, json_stack_offset: usize, database: database.Capacity, sql_bytes: usize, sql_offset: usize, storage_bytes: usize, pub fn derive(limits: Limits) DeriveError!Capacity { if (limits.root_path_bytes == 0) return error.RootPathStorageTooSmall; if (limits.event_bytes == 0) return error.EventStorageTooSmall; if (limits.event_bytes > format.Limits.maximum_event_bytes) return error.EventStorageTooLarge; if (limits.chunk_bytes < limits.event_bytes) return error.ChunkAdmissionTooSmall; if (limits.chunk_bytes > format.Limits.maximum_chunk_bytes) return error.ChunkAdmissionTooLarge; if (limits.json_nesting < 2) return error.JsonNestingTooSmall; if (limits.json_nesting > maximum_json_nesting) return error.JsonNestingTooLarge; const block_bytes = block.capacity(limits.event_bytes) catch return error.CapacityOverflow; const database_capacity = database.readerCapacity() catch return error.CapacityOverflow; var offset: usize = 0; const root_path_offset = offset; offset = try add(offset, limits.root_path_bytes); const input_offset = offset; const input_bytes = @max(block_bytes, format.max_manifest_bytes); offset = try add(offset, input_bytes); const path_offset = offset; const path_bytes = try add( try add(limits.root_path_bytes, 1), format.max_relative_path_bytes, ); offset = try add(offset, path_bytes); const json_stack_offset = offset; const json_stack_bytes = (try add(limits.json_nesting, 7)) / 8; offset = try add(offset, json_stack_bytes); const sql_offset = offset; offset = try add(offset, database_capacity.heap_bytes); return .{ .root_path_bytes = limits.root_path_bytes, .root_path_offset = root_path_offset, .event_bytes = limits.event_bytes, .chunk_bytes = limits.chunk_bytes, .block_bytes = block_bytes, .input_bytes = input_bytes, .input_offset = input_offset, .path_bytes = path_bytes, .path_offset = path_offset, .json_nesting = limits.json_nesting, .json_stack_bytes = json_stack_bytes, .json_stack_offset = json_stack_offset, .database = database_capacity, .sql_bytes = database_capacity.heap_bytes, .sql_offset = sql_offset, .storage_bytes = offset, }; }};Source: lib/trace/src/root.zig:59
zig
pub const TraceReaderCapacity = store.ReaderCapacity;Also reachable as
Audit
| Definitions | 2 |
|---|---|
| Public names | 4 |
| Members | 16 |
| Version | 26.7.0 |
| Revision | daab053ee433 |