ticlo-tsdb 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/README.md +64 -2
- package/dist/backend.d.ts +41 -0
- package/dist/backend.js +207 -0
- package/dist/db.d.ts +56 -0
- package/dist/db.js +490 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4 -0
- package/dist/memoryCache.d.ts +25 -0
- package/dist/memoryCache.js +89 -0
- package/dist/rawFile.d.ts +87 -0
- package/dist/rawFile.js +1031 -0
- package/dist/retention.d.ts +20 -0
- package/dist/retention.js +101 -0
- package/dist/rollupFile.d.ts +62 -0
- package/dist/rollupFile.js +527 -0
- package/dist/series.d.ts +74 -0
- package/dist/series.js +1223 -0
- package/dist/store.d.ts +80 -0
- package/dist/store.js +42 -0
- package/dist/time.d.ts +39 -0
- package/dist/time.js +459 -0
- package/dist/types.d.ts +162 -0
- package/dist/types.js +1 -0
- package/package.json +36 -4
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { StorageBackend } from './backend.ts';
|
|
2
|
+
import type { NumericRawStore, ValueRawStore } from './store.ts';
|
|
3
|
+
import type { EncodedValueRecord, StorageChunkInfo } from './types.ts';
|
|
4
|
+
export declare class NumericRawFile implements NumericRawStore {
|
|
5
|
+
private readonly backend;
|
|
6
|
+
private readonly relPrefix;
|
|
7
|
+
private readonly maxRecordsPerChunk;
|
|
8
|
+
private chunks;
|
|
9
|
+
private nextChunkId;
|
|
10
|
+
private activeHandle;
|
|
11
|
+
private activeChunkId;
|
|
12
|
+
private activeDirtyForManifest;
|
|
13
|
+
private _recordCount;
|
|
14
|
+
private _byteSize;
|
|
15
|
+
private opened;
|
|
16
|
+
private readonly headerBuf;
|
|
17
|
+
private readonly headerU8;
|
|
18
|
+
private readonly headerView;
|
|
19
|
+
constructor(backend: StorageBackend, relPrefix: string, chunkBytes?: number);
|
|
20
|
+
get recordCount(): number;
|
|
21
|
+
get byteSize(): number;
|
|
22
|
+
private get manifestPath();
|
|
23
|
+
private chunkPath;
|
|
24
|
+
open(): Promise<void>;
|
|
25
|
+
private recomputeTotals;
|
|
26
|
+
private writeManifest;
|
|
27
|
+
private writeChunkHeader;
|
|
28
|
+
private writePairs;
|
|
29
|
+
private ensureActiveHandle;
|
|
30
|
+
private readChunkPairs;
|
|
31
|
+
appendBatch(interleaved: Float64Array, count: number): Promise<void>;
|
|
32
|
+
private findFirstChunkAtOrAfter;
|
|
33
|
+
readRange(startMs: number, endMs: number, limit?: number, stripNaN?: boolean): Promise<{
|
|
34
|
+
timestamps: Float64Array;
|
|
35
|
+
values: Float64Array;
|
|
36
|
+
length: number;
|
|
37
|
+
truncated: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
private hasMatchingRecord;
|
|
40
|
+
readLastBefore(tsMs: number, inclusive?: boolean): Promise<{
|
|
41
|
+
ts: number;
|
|
42
|
+
value: number;
|
|
43
|
+
} | null>;
|
|
44
|
+
listChunks(): ReadonlyArray<StorageChunkInfo>;
|
|
45
|
+
dropChunks(chunkIds: ReadonlyArray<number>): Promise<void>;
|
|
46
|
+
compact(minTsKeep?: number, maxRecords?: number): Promise<void>;
|
|
47
|
+
close(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
export declare class ValueRawFile implements ValueRawStore {
|
|
50
|
+
private readonly backend;
|
|
51
|
+
private readonly relPrefix;
|
|
52
|
+
private readonly targetChunkBytes;
|
|
53
|
+
private chunks;
|
|
54
|
+
private nextChunkId;
|
|
55
|
+
private activeHandle;
|
|
56
|
+
private activeChunkId;
|
|
57
|
+
private activeDirtyForManifest;
|
|
58
|
+
private _recordCount;
|
|
59
|
+
private _byteSize;
|
|
60
|
+
private opened;
|
|
61
|
+
private readonly headerBuf;
|
|
62
|
+
private readonly headerU8;
|
|
63
|
+
private readonly headerView;
|
|
64
|
+
constructor(backend: StorageBackend, relPrefix: string, targetChunkBytes?: number);
|
|
65
|
+
get recordCount(): number;
|
|
66
|
+
get byteSize(): number;
|
|
67
|
+
private get manifestPath();
|
|
68
|
+
private chunkPath;
|
|
69
|
+
open(): Promise<void>;
|
|
70
|
+
private recomputeTotals;
|
|
71
|
+
private writeManifest;
|
|
72
|
+
private writeChunkHeader;
|
|
73
|
+
private ensureActiveHandle;
|
|
74
|
+
appendBatch(entries: ReadonlyArray<EncodedValueRecord>): Promise<void>;
|
|
75
|
+
private findFirstChunkAtOrAfter;
|
|
76
|
+
private findLastChunkAtOrBefore;
|
|
77
|
+
private readChunkBody;
|
|
78
|
+
private decodeRecordAt;
|
|
79
|
+
readRange(startMs: number, endMs: number, limit?: number, order?: 'asc' | 'desc'): Promise<{
|
|
80
|
+
records: EncodedValueRecord[];
|
|
81
|
+
truncated: boolean;
|
|
82
|
+
}>;
|
|
83
|
+
listChunks(): ReadonlyArray<StorageChunkInfo>;
|
|
84
|
+
dropChunks(chunkIds: ReadonlyArray<number>): Promise<void>;
|
|
85
|
+
compact(minTsKeep?: number, maxRecords?: number): Promise<void>;
|
|
86
|
+
close(): Promise<void>;
|
|
87
|
+
}
|