@tinyshed/tinystore 0.1.1 → 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/dist/index.d.ts +1 -1
- package/dist/jobs.d.ts +2 -0
- package/dist/jobs.js +1 -0
- package/dist/metrics.d.ts +5 -1
- package/dist/metrics.js +56 -6
- package/dist/records.d.ts +18 -5
- package/dist/records.js +14 -3
- package/dist/time.d.ts +2 -0
- package/dist/wire/protocol.d.ts +58 -0
- package/dist/wire/protocol.js +224 -1
- package/package.json +8 -8
- package/src/index.ts +1 -1
- package/src/jobs.ts +3 -0
- package/src/metrics.ts +80 -8
- package/src/records.ts +33 -8
- package/src/time.ts +3 -0
- package/src/wire/protocol.ts +239 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type { StandardSchemaV1 } from './schema.ts';
|
|
|
21
21
|
export { type Found as SearchFound, type Hit as SearchHit, type IndexDocument, type IndexInfo, type IndexOptions, type IndexStatus, type Query as SearchQuery, SearchIndex, search, TableIndex, type TableIndexOptions, type Vector, type Where, type WhereValue, } from './search.ts';
|
|
22
22
|
export { type Columns, type Database, type DatabaseOptions, type Done, type Migrations, type Row, Sql, type SqlArg, type SqlTag, type SqlTx, type SqlValue, type Statement, sql, } from './sql.ts';
|
|
23
23
|
export { type ConnectOptions, connect, type NodeOptions, type OpenOptions, open, type Status, Store, } from './store.ts';
|
|
24
|
-
export type { Duration, DurationText, Time } from './time.ts';
|
|
24
|
+
export type { Calendar, Duration, DurationText, Time } from './time.ts';
|
|
25
25
|
export { type Trace, withTrace } from './trace.ts';
|
|
26
26
|
export type { Tx, TxBucket, TxCounters } from './tx.ts';
|
|
27
27
|
export type { Key } from './wire/codec.ts';
|
package/dist/jobs.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export interface QueueOptions {
|
|
|
28
28
|
concurrency?: number | Concurrency | undefined;
|
|
29
29
|
/** jobs started in any span: '30/s' */
|
|
30
30
|
rate?: Rate | undefined;
|
|
31
|
+
/** jobs of each group started in any span, beside rate: '2/s', each account's own limit; it lives in memory */
|
|
32
|
+
groupRate?: Rate | undefined;
|
|
31
33
|
/** how long a done job's id stays taken, so that an add of it adds nothing */
|
|
32
34
|
dedupe?: Duration | undefined;
|
|
33
35
|
/** how long a failed job stays, to be found and started again: a week */
|
package/dist/jobs.js
CHANGED
|
@@ -644,6 +644,7 @@ export function openQueue(link, workers, name, options, home) {
|
|
|
644
644
|
group: whole(concurrency.group, describe, "a group's concurrency"),
|
|
645
645
|
},
|
|
646
646
|
rate: options.rate === undefined ? undefined : rateOf(options.rate),
|
|
647
|
+
groupRate: options.groupRate === undefined ? undefined : rateOf(options.groupRate),
|
|
647
648
|
dedupe: msOf(options.dedupe),
|
|
648
649
|
keep: msOf(options.keep),
|
|
649
650
|
maxWaiting: whole(options.maxWaiting, describe, 'a maxWaiting'),
|
package/dist/metrics.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Link } from './connection.ts';
|
|
2
2
|
import { Counter, Gauge, type GaugeFuncOptions, Histogram, type HistogramOptions, type InstrumentOptions, type Instruments, type LabelValue, Timer, type TimerOptions } from './instruments.ts';
|
|
3
|
-
import { type Duration, type DurationText, type Time } from './time.ts';
|
|
3
|
+
import { type Calendar, type Duration, type DurationText, type Time } from './time.ts';
|
|
4
4
|
export { type Buckets, Counter, exponentialBuckets, Gauge, type GaugeFuncOptions, Histogram, type HistogramOptions, type InstrumentLabels, type InstrumentOptions, type LabelValue, Timer, type TimerOptions, Timing, } from './instruments.ts';
|
|
5
5
|
/** What a series' samples are. */
|
|
6
6
|
export type SeriesKind = 'gauge' | 'counter' | 'histogram';
|
|
@@ -69,6 +69,10 @@ export type Op = 'count' | 'sum' | 'avg' | 'min' | 'max' | 'increase' | 'rate' |
|
|
|
69
69
|
export interface AggregateQuery<O extends Op = Op> extends Query {
|
|
70
70
|
/** the buckets' span, counted from 1970 in UTC; the range is one bucket without it */
|
|
71
71
|
every?: Duration | undefined;
|
|
72
|
+
/** buckets of a calendar in timeZone, in place of every: 'day' begins each at a local midnight */
|
|
73
|
+
calendar?: Calendar | undefined;
|
|
74
|
+
/** the IANA zone a calendar's buckets are in: 'Europe/Moscow', 'UTC' */
|
|
75
|
+
timeZone?: string | undefined;
|
|
72
76
|
op: O;
|
|
73
77
|
/** the labels a group keeps; without by and without, every series of a name is one group */
|
|
74
78
|
by?: readonly string[] | undefined;
|
package/dist/metrics.js
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
// holds of them; and a program's instruments, whose totals the store keeps.
|
|
5
5
|
// A series' samples travel as two columns, an int64 time and a float64 value
|
|
6
6
|
// a sample, so that every value's bits come back as they were written.
|
|
7
|
-
import { download } from './connection.js';
|
|
8
|
-
import { InvalidError } from './errors.js';
|
|
7
|
+
import { download, pieceOf } from './connection.js';
|
|
8
|
+
import { InvalidError, OutcomeUnknownError } from './errors.js';
|
|
9
9
|
import { Counter, Gauge, Histogram, labelsOf, Timer, } from './instruments.js';
|
|
10
|
+
import { ConnectionLostError } from './session.js';
|
|
10
11
|
import { ms, unixMs } from './time.js';
|
|
11
|
-
import { Empty, MetricsAggregateAsked, MetricsAggregates, MetricsDamages, MetricsDeleted, MetricsDescription, MetricsExposition, MetricsIngest, MetricsLatest, MetricsNameAsked, MetricsNamePage, MetricsPageAsked, MetricsPlan, MetricsQuery, MetricsRead, MetricsSeriesNamed, MetricsTextPage, methods, } from './wire/protocol.js';
|
|
12
|
+
import { Empty, MetricsAggregateAsked, MetricsAggregates, MetricsDamages, MetricsDeleted, MetricsDescription, MetricsExposition, MetricsIngest, MetricsLatest, MetricsNameAsked, MetricsNamePage, MetricsPageAsked, MetricsPiece, MetricsPlan, MetricsQuery, MetricsRead, MetricsSeriesNamed, MetricsTextPage, MetricsUpload, methods, } from './wire/protocol.js';
|
|
12
13
|
export { Counter, exponentialBuckets, Gauge, Histogram, Timer, Timing, } from './instruments.js';
|
|
13
14
|
/**
|
|
14
15
|
* A store's metrics: series by name and labels, their reads and aggregates,
|
|
@@ -43,13 +44,22 @@ export class Metrics {
|
|
|
43
44
|
for (const [label, value] of Object.entries(options.labels ?? {})) {
|
|
44
45
|
labels[label] = String(value);
|
|
45
46
|
}
|
|
46
|
-
const
|
|
47
|
-
text: typeof text === 'string' ? new TextEncoder().encode(text) : text,
|
|
47
|
+
const given = {
|
|
48
48
|
labels,
|
|
49
49
|
at: options.at === undefined ? undefined : unixMs(options.at),
|
|
50
50
|
keep: options.keep === undefined ? undefined : ms(options.keep),
|
|
51
|
+
};
|
|
52
|
+
const bytes = typeof text === 'string' ? new TextEncoder().encode(text) : text;
|
|
53
|
+
await this.#link.run('write', async (connection) => {
|
|
54
|
+
const body = oneMessage(connection, bytes, given);
|
|
55
|
+
if (body !== undefined) {
|
|
56
|
+
await connection.session.call(methods['metrics.ingestPrometheus'], body);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const asked = MetricsUpload.encode({ size: bytes.length, ...given });
|
|
60
|
+
const stream = await connection.session.open(methods['metrics.uploadPrometheus'], asked, false);
|
|
61
|
+
await uploaded(stream, bytes, pieceOf(connection));
|
|
51
62
|
});
|
|
52
|
-
await this.#link.run('write', connection => connection.session.call(methods['metrics.ingestPrometheus'], body));
|
|
53
63
|
}
|
|
54
64
|
/** The samples of each series the query finds, in its range: whole, or a limit error naming its bound. */
|
|
55
65
|
async read(query) {
|
|
@@ -287,6 +297,8 @@ function aggregateOf(query) {
|
|
|
287
297
|
return {
|
|
288
298
|
query: queryOf(query),
|
|
289
299
|
every: query.every === undefined ? undefined : ms(query.every),
|
|
300
|
+
calendar: query.calendar,
|
|
301
|
+
timeZone: query.timeZone,
|
|
290
302
|
op: query.op,
|
|
291
303
|
by: query.by === undefined ? undefined : [...query.by],
|
|
292
304
|
without: query.without === undefined ? undefined : [...query.without],
|
|
@@ -340,6 +352,44 @@ function newSeries(given) {
|
|
|
340
352
|
keep: given.keep === undefined ? undefined : ms(given.keep),
|
|
341
353
|
};
|
|
342
354
|
}
|
|
355
|
+
/** A text's one message, when it fits the body the connection agreed; a longer text goes in pieces. */
|
|
356
|
+
function oneMessage(connection, text, given) {
|
|
357
|
+
const most = connection.session.agreed?.maxBody ?? 0;
|
|
358
|
+
if (text.length > most) {
|
|
359
|
+
return undefined;
|
|
360
|
+
}
|
|
361
|
+
const body = MetricsExposition.encode({ text, ...given });
|
|
362
|
+
return body.length <= most ? body : undefined;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Sends a text's pieces as DATA within the stream's credit, the last ending
|
|
366
|
+
* them, and waits for the store to write it. A connection lost before that
|
|
367
|
+
* last DATA left nothing written, so the text goes again on the next one;
|
|
368
|
+
* lost after it, whether the text was written is unknown.
|
|
369
|
+
*/
|
|
370
|
+
async function uploaded(stream, text, piece) {
|
|
371
|
+
let ending = false;
|
|
372
|
+
try {
|
|
373
|
+
for (let at = 0; !ending; at += piece) {
|
|
374
|
+
ending = at + piece >= text.length;
|
|
375
|
+
await stream.send(MetricsPiece.encode({ bytes: text.subarray(at, at + piece) }), ending);
|
|
376
|
+
}
|
|
377
|
+
// the RESPONSE that began it, then the answer to its last piece
|
|
378
|
+
await stream.next();
|
|
379
|
+
await stream.next();
|
|
380
|
+
}
|
|
381
|
+
catch (err) {
|
|
382
|
+
if (err instanceof ConnectionLostError && !ending) {
|
|
383
|
+
// the store let go of what came and wrote nothing, so the whole text goes again
|
|
384
|
+
throw new ConnectionLostError(err.message, false);
|
|
385
|
+
}
|
|
386
|
+
stream.cancel();
|
|
387
|
+
if (err instanceof ConnectionLostError) {
|
|
388
|
+
throw new OutcomeUnknownError(`the connection was lost as the text was written: ${err.message}`);
|
|
389
|
+
}
|
|
390
|
+
throw err;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
343
393
|
function columnsOf(given) {
|
|
344
394
|
if (given.samples !== undefined) {
|
|
345
395
|
if (given.times !== undefined || given.values !== undefined) {
|
package/dist/records.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type Link } from './connection.ts';
|
|
|
2
2
|
import { type ConsoleLine } from './console.ts';
|
|
3
3
|
import { type LogConfig, type Logger, type LoggerOptions } from './logger.ts';
|
|
4
4
|
import type { Stream } from './session.ts';
|
|
5
|
-
import { type Duration, type DurationText } from './time.ts';
|
|
5
|
+
import { type Calendar, type Duration, type DurationText } from './time.ts';
|
|
6
6
|
import { methods } from './wire/protocol.ts';
|
|
7
7
|
/** A level a logger logs at: one of its four names, or slog's number between them. */
|
|
8
8
|
export type Level = 'debug' | 'info' | 'warn' | 'error' | number;
|
|
@@ -15,6 +15,8 @@ export interface Event {
|
|
|
15
15
|
/** its time, which the file keeps to the nanosecond */
|
|
16
16
|
at: Date;
|
|
17
17
|
stream: string;
|
|
18
|
+
/** what its append named it by: its stream holds one event of an id */
|
|
19
|
+
id?: string;
|
|
18
20
|
/** what happened; `log` for a logger's line */
|
|
19
21
|
name: string;
|
|
20
22
|
level?: EventLevel;
|
|
@@ -30,6 +32,11 @@ export interface Event {
|
|
|
30
32
|
/** An event to append: its name, what happened, and what it carries beside. */
|
|
31
33
|
export interface NewEvent {
|
|
32
34
|
name: string;
|
|
35
|
+
/**
|
|
36
|
+
* what names it in its stream, a webhook's delivery or a job's key, 1 to 128 bytes:
|
|
37
|
+
* an append of an id the stream holds writes nothing, and the first event of an id stands
|
|
38
|
+
*/
|
|
39
|
+
id?: string;
|
|
33
40
|
fields?: Fields;
|
|
34
41
|
/** its time: now unless given, from what the stream keeps to ten minutes ahead */
|
|
35
42
|
at?: Date;
|
|
@@ -101,6 +108,10 @@ export interface Row {
|
|
|
101
108
|
export interface Aggregate extends Counted {
|
|
102
109
|
/** the span of a row: the range is one without it */
|
|
103
110
|
every?: Duration;
|
|
111
|
+
/** rows of a calendar in timeZone, in place of every: 'day' begins each at a local midnight */
|
|
112
|
+
calendar?: Calendar;
|
|
113
|
+
/** the IANA zone a calendar's rows are in: 'Europe/Moscow', 'UTC' */
|
|
114
|
+
timeZone?: string;
|
|
104
115
|
/** keys whose every value has rows of its own */
|
|
105
116
|
by?: readonly string[];
|
|
106
117
|
/** fields whose numbers a row sums */
|
|
@@ -187,11 +198,13 @@ export declare class Events extends Reads {
|
|
|
187
198
|
constructor(link: Link, stream: string, open: Uint8Array);
|
|
188
199
|
/**
|
|
189
200
|
* Writes an event, or a list of them whole or not at all: it returns once
|
|
190
|
-
* they are written, and a read finds them at once.
|
|
191
|
-
*
|
|
201
|
+
* they are written, and a read finds them at once. An event whose id the
|
|
202
|
+
* stream holds, or an earlier event of the list has, is written as
|
|
203
|
+
* nothing: one event answers whether it was written, a list how many of
|
|
204
|
+
* its events were. A refused event names its place in the list and its name.
|
|
192
205
|
*/
|
|
193
|
-
append(name: string, fields?: Fields, options?: AppendOptions): Promise<
|
|
194
|
-
append(events: readonly NewEvent[]): Promise<
|
|
206
|
+
append(name: string, fields?: Fields, options?: AppendOptions): Promise<boolean>;
|
|
207
|
+
append(events: readonly NewEvent[]): Promise<number>;
|
|
195
208
|
/** A logger's lines, each an event of this stream. */
|
|
196
209
|
appendLines(lines: readonly ConsoleLine[]): Promise<void>;
|
|
197
210
|
/**
|
package/dist/records.js
CHANGED
|
@@ -12,7 +12,7 @@ import { parseJson } from './json.js';
|
|
|
12
12
|
import { encodeFields, newStoreLogger, } from './logger.js';
|
|
13
13
|
import { ms } from './time.js';
|
|
14
14
|
import { currentTrace } from './trace.js';
|
|
15
|
-
import { Empty, Handle, methods, RecordsAggregateAsked, RecordsAppend, RecordsBatch, RecordsCount, RecordsDamage, RecordsDamages, RecordsDropped, RecordsFieldNamesAsked, RecordsNames, RecordsOpen, RecordsPage, RecordsPiece, RecordsPollAsked, RecordsQuery, RecordsRows, RecordsStreams, RecordsTailBatch, RecordsTopAsked, RecordsTops, } from './wire/protocol.js';
|
|
15
|
+
import { Empty, Handle, methods, RecordsAggregateAsked, RecordsAppend, RecordsAppended, RecordsBatch, RecordsCount, RecordsDamage, RecordsDamages, RecordsDropped, RecordsFieldNamesAsked, RecordsNames, RecordsOpen, RecordsPage, RecordsPiece, RecordsPollAsked, RecordsQuery, RecordsRows, RecordsStreams, RecordsTailBatch, RecordsTopAsked, RecordsTops, } from './wire/protocol.js';
|
|
16
16
|
const newline = 0x0a;
|
|
17
17
|
/** What a writer of lines holds for the server at most: past it, lines are dropped and counted. */
|
|
18
18
|
const linesHeld = 1 << 20;
|
|
@@ -71,11 +71,13 @@ class Reads {
|
|
|
71
71
|
}
|
|
72
72
|
/** A row for each span of `every` and each value of the keys of `by`, with its count. */
|
|
73
73
|
async aggregate(query = {}) {
|
|
74
|
-
const { every, by, stats, distinct, ...counted } = query;
|
|
74
|
+
const { every, calendar, timeZone, by, stats, distinct, ...counted } = query;
|
|
75
75
|
const asked = queryOf(counted);
|
|
76
76
|
const answer = await this.ask('records.aggregate', handle => RecordsAggregateAsked.encode({
|
|
77
77
|
query: { ...asked, handle },
|
|
78
78
|
every: every === undefined ? undefined : ms(every),
|
|
79
|
+
calendar,
|
|
80
|
+
timeZone,
|
|
79
81
|
by: by === undefined ? undefined : [...by],
|
|
80
82
|
stats: stats === undefined ? undefined : [...stats],
|
|
81
83
|
distinct: distinct === undefined ? undefined : [...distinct],
|
|
@@ -151,7 +153,9 @@ export class Events extends Reads {
|
|
|
151
153
|
async append(first, fields, options) {
|
|
152
154
|
const events = typeof first === 'string' ? [oneEvent(first, fields, options)] : first;
|
|
153
155
|
const encoded = events.map(newEventOf);
|
|
154
|
-
await this.#call('records.append', handle => RecordsAppend.encode({ handle, events: encoded }), 'write');
|
|
156
|
+
const answer = await this.#call('records.append', handle => RecordsAppend.encode({ handle, events: encoded }), 'write');
|
|
157
|
+
const written = events.length - (RecordsAppended.decode(answer).held ?? 0);
|
|
158
|
+
return typeof first === 'string' ? written === 1 : written;
|
|
155
159
|
}
|
|
156
160
|
/** A logger's lines, each an event of this stream. */
|
|
157
161
|
appendLines(lines) {
|
|
@@ -437,8 +441,12 @@ function newEventOf(event, place) {
|
|
|
437
441
|
const given = event.traceId === undefined
|
|
438
442
|
? traceOf(currentTrace())
|
|
439
443
|
: { traceId: event.traceId, spanId: event.spanId };
|
|
444
|
+
if (event.id !== undefined && (typeof event.id !== 'string' || event.id === '')) {
|
|
445
|
+
throw new InvalidError(`${named}: an id is a string of 1 to 128 bytes`);
|
|
446
|
+
}
|
|
440
447
|
return {
|
|
441
448
|
name: event.name,
|
|
449
|
+
id: event.id,
|
|
442
450
|
at: event.at === undefined ? undefined : nanosOf(event.at),
|
|
443
451
|
level: event.level === undefined ? undefined : levelNumber(event.level, named),
|
|
444
452
|
message: event.message,
|
|
@@ -492,6 +500,9 @@ function eventOf(read) {
|
|
|
492
500
|
if (read.message !== undefined) {
|
|
493
501
|
event.message = read.message;
|
|
494
502
|
}
|
|
503
|
+
if (read.id !== undefined) {
|
|
504
|
+
event.id = read.id;
|
|
505
|
+
}
|
|
495
506
|
if (read.traceId !== undefined) {
|
|
496
507
|
event.traceId = Buffer.from(read.traceId).toString('hex');
|
|
497
508
|
}
|
package/dist/time.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ type Offered = '1s' | '5s' | '10s' | '15s' | '30s' | '1m' | '5m' | '10m' | '15m'
|
|
|
23
23
|
export type DurationText = Offered | (Spelled<Units> & Record<never, never>);
|
|
24
24
|
/** A length of time: milliseconds, or the text of one, such as '1h30m'. */
|
|
25
25
|
export type Duration = number | DurationText;
|
|
26
|
+
/** A span of a calendar an aggregate's bucket covers in its timeZone: a local day, a week from Monday, a month. */
|
|
27
|
+
export type Calendar = 'day' | 'week' | 'month';
|
|
26
28
|
/** A moment: a Date, or unix milliseconds. */
|
|
27
29
|
export type Time = Date | number;
|
|
28
30
|
/**
|
package/dist/wire/protocol.d.ts
CHANGED
|
@@ -97,6 +97,13 @@ export declare const methods: {
|
|
|
97
97
|
readonly 'metrics.flush': 1549;
|
|
98
98
|
readonly 'metrics.instruments': 1550;
|
|
99
99
|
readonly 'metrics.ingestPrometheus': 1551;
|
|
100
|
+
/**
|
|
101
|
+
* Answers its RESPONSE at once; the store's memory for the whole text is
|
|
102
|
+
* taken before a piece is kept, and the last piece is answered once the text
|
|
103
|
+
* is written, every series or none. A cancel or a lost connection leaves
|
|
104
|
+
* nothing written and lets go of what came.
|
|
105
|
+
*/
|
|
106
|
+
readonly 'metrics.uploadPrometheus': 1552;
|
|
100
107
|
readonly 'records.open': 1281;
|
|
101
108
|
readonly 'records.append': 1282;
|
|
102
109
|
readonly 'records.list': 1283;
|
|
@@ -601,6 +608,11 @@ export declare const JobsQueueOpen: import("./codec.ts").Message<{
|
|
|
601
608
|
readonly maxWaiting: readonly [9, import("./codec.ts").Codec<number, number>];
|
|
602
609
|
/** a database's handle: the queue lives in its file; jobs.db when absent */
|
|
603
610
|
readonly database: readonly [10, import("./codec.ts").Codec<number, number>];
|
|
611
|
+
/** each group's starts, beside the queue's rate */
|
|
612
|
+
readonly groupRate: readonly [11, import("./codec.ts").Message<{
|
|
613
|
+
readonly count: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
614
|
+
readonly per: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
615
|
+
}>];
|
|
604
616
|
}>;
|
|
605
617
|
/**
|
|
606
618
|
* Opens a schedule: one repeating job the code owns, under its name, whose
|
|
@@ -1379,6 +1391,10 @@ export declare const MetricsAggregateAsked: import("./codec.ts").Message<{
|
|
|
1379
1391
|
readonly without: readonly [5, import("./codec.ts").Codec<string[], readonly string[]>];
|
|
1380
1392
|
/** a timer's percentile also gives a point between its bounds */
|
|
1381
1393
|
readonly estimate: readonly [6, import("./codec.ts").Codec<boolean, boolean>];
|
|
1394
|
+
/** day, week or month: buckets of a calendar in timeZone, in place of every */
|
|
1395
|
+
readonly calendar: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
1396
|
+
/** an IANA name, UTC among them, which calendar takes */
|
|
1397
|
+
readonly timeZone: readonly [8, import("./codec.ts").Codec<string, string>];
|
|
1382
1398
|
}>;
|
|
1383
1399
|
/**
|
|
1384
1400
|
* A bucket of an aggregate: its value, or a timer's percentile's bounds.
|
|
@@ -1574,6 +1590,23 @@ export declare const MetricsExposition: import("./codec.ts").Message<{
|
|
|
1574
1590
|
/** how long each name of the text keeps its samples */
|
|
1575
1591
|
readonly keep: readonly [4, import("./codec.ts").Codec<number, number>];
|
|
1576
1592
|
}>;
|
|
1593
|
+
/**
|
|
1594
|
+
* A text past what one message holds: what metrics.Exposition carries but
|
|
1595
|
+
* the text, whose bytes follow as the client's DATA, a metrics.Piece each.
|
|
1596
|
+
*/
|
|
1597
|
+
export declare const MetricsUpload: import("./codec.ts").Message<{
|
|
1598
|
+
/** the text's bytes, 32 MiB at most: pieces that come to more or fewer are refused */
|
|
1599
|
+
readonly size: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
1600
|
+
readonly labels: readonly [2, import("./codec.ts").Codec<Record<string, string>, Record<string, string>>];
|
|
1601
|
+
readonly at: readonly [3, import("./codec.ts").Codec<number, number>];
|
|
1602
|
+
readonly keep: readonly [4, import("./codec.ts").Codec<number, number>];
|
|
1603
|
+
}>;
|
|
1604
|
+
/**
|
|
1605
|
+
* A piece of an uploaded text, cut anywhere.
|
|
1606
|
+
*/
|
|
1607
|
+
export declare const MetricsPiece: import("./codec.ts").Message<{
|
|
1608
|
+
readonly bytes: readonly [1, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1609
|
+
}>;
|
|
1577
1610
|
/**
|
|
1578
1611
|
* A page of names, of a name's labels or of a label's values.
|
|
1579
1612
|
*/
|
|
@@ -1842,6 +1875,8 @@ export declare const RecordsNewEvent: import("./codec.ts").Message<{
|
|
|
1842
1875
|
readonly traceId: readonly [7, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1843
1876
|
/** 8 bytes */
|
|
1844
1877
|
readonly spanId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1878
|
+
/** 1 to 128 bytes: an event of an id its stream holds is written as nothing */
|
|
1879
|
+
readonly id: readonly [9, import("./codec.ts").Codec<string, string>];
|
|
1845
1880
|
}>;
|
|
1846
1881
|
/**
|
|
1847
1882
|
* Events to write to a stream, all of them or none.
|
|
@@ -1863,6 +1898,8 @@ export declare const RecordsAppend: import("./codec.ts").Message<{
|
|
|
1863
1898
|
readonly traceId: readonly [7, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1864
1899
|
/** 8 bytes */
|
|
1865
1900
|
readonly spanId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1901
|
+
/** 1 to 128 bytes: an event of an id its stream holds is written as nothing */
|
|
1902
|
+
readonly id: readonly [9, import("./codec.ts").Codec<string, string>];
|
|
1866
1903
|
}>[], readonly import("./codec.ts").Written<{
|
|
1867
1904
|
readonly name: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
1868
1905
|
/** the store's clock's now unless given */
|
|
@@ -1878,8 +1915,18 @@ export declare const RecordsAppend: import("./codec.ts").Message<{
|
|
|
1878
1915
|
readonly traceId: readonly [7, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1879
1916
|
/** 8 bytes */
|
|
1880
1917
|
readonly spanId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1918
|
+
/** 1 to 128 bytes: an event of an id its stream holds is written as nothing */
|
|
1919
|
+
readonly id: readonly [9, import("./codec.ts").Codec<string, string>];
|
|
1881
1920
|
}>[]>];
|
|
1882
1921
|
}>;
|
|
1922
|
+
/**
|
|
1923
|
+
* What an append wrote: none of an event whose id its stream held, or an
|
|
1924
|
+
* earlier event of the append held.
|
|
1925
|
+
*/
|
|
1926
|
+
export declare const RecordsAppended: import("./codec.ts").Message<{
|
|
1927
|
+
/** the events written as nothing */
|
|
1928
|
+
readonly held: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
1929
|
+
}>;
|
|
1883
1930
|
/**
|
|
1884
1931
|
* An event as a read gives it.
|
|
1885
1932
|
*/
|
|
@@ -1894,6 +1941,7 @@ export declare const RecordsEvent: import("./codec.ts").Message<{
|
|
|
1894
1941
|
readonly context: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
1895
1942
|
readonly traceId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1896
1943
|
readonly spanId: readonly [9, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1944
|
+
readonly id: readonly [10, import("./codec.ts").Codec<string, string>];
|
|
1897
1945
|
}>;
|
|
1898
1946
|
/**
|
|
1899
1947
|
* What a read finds: each condition given holds.
|
|
@@ -1930,6 +1978,7 @@ export declare const RecordsPage: import("./codec.ts").Message<{
|
|
|
1930
1978
|
readonly context: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
1931
1979
|
readonly traceId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1932
1980
|
readonly spanId: readonly [9, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1981
|
+
readonly id: readonly [10, import("./codec.ts").Codec<string, string>];
|
|
1933
1982
|
}>[], readonly import("./codec.ts").Written<{
|
|
1934
1983
|
readonly at: readonly [1, import("./codec.ts").Codec<bigint, number | bigint>];
|
|
1935
1984
|
readonly stream: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
@@ -1941,6 +1990,7 @@ export declare const RecordsPage: import("./codec.ts").Message<{
|
|
|
1941
1990
|
readonly context: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
1942
1991
|
readonly traceId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1943
1992
|
readonly spanId: readonly [9, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
1993
|
+
readonly id: readonly [10, import("./codec.ts").Codec<string, string>];
|
|
1944
1994
|
}>[]>];
|
|
1945
1995
|
/** the page after it; the last page has none */
|
|
1946
1996
|
readonly next: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
@@ -2016,6 +2066,10 @@ export declare const RecordsAggregateAsked: import("./codec.ts").Message<{
|
|
|
2016
2066
|
readonly by: readonly [3, import("./codec.ts").Codec<string[], readonly string[]>];
|
|
2017
2067
|
readonly stats: readonly [4, import("./codec.ts").Codec<string[], readonly string[]>];
|
|
2018
2068
|
readonly distinct: readonly [5, import("./codec.ts").Codec<string[], readonly string[]>];
|
|
2069
|
+
/** day, week or month: rows of a calendar in timeZone, in place of every */
|
|
2070
|
+
readonly calendar: readonly [6, import("./codec.ts").Codec<string, string>];
|
|
2071
|
+
/** an IANA name, UTC among them, which calendar takes */
|
|
2072
|
+
readonly timeZone: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
2019
2073
|
}>;
|
|
2020
2074
|
/**
|
|
2021
2075
|
* A field's numbers in a row: a sum, a min and a max are JSON numbers, an
|
|
@@ -2161,6 +2215,7 @@ export declare const RecordsBatch: import("./codec.ts").Message<{
|
|
|
2161
2215
|
readonly context: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
2162
2216
|
readonly traceId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
2163
2217
|
readonly spanId: readonly [9, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
2218
|
+
readonly id: readonly [10, import("./codec.ts").Codec<string, string>];
|
|
2164
2219
|
}>[], readonly import("./codec.ts").Written<{
|
|
2165
2220
|
readonly at: readonly [1, import("./codec.ts").Codec<bigint, number | bigint>];
|
|
2166
2221
|
readonly stream: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
@@ -2172,6 +2227,7 @@ export declare const RecordsBatch: import("./codec.ts").Message<{
|
|
|
2172
2227
|
readonly context: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
2173
2228
|
readonly traceId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
2174
2229
|
readonly spanId: readonly [9, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
2230
|
+
readonly id: readonly [10, import("./codec.ts").Codec<string, string>];
|
|
2175
2231
|
}>[]>];
|
|
2176
2232
|
readonly cursor: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
2177
2233
|
/** the events keep removed before the cursor reached them */
|
|
@@ -2193,6 +2249,7 @@ export declare const RecordsTailBatch: import("./codec.ts").Message<{
|
|
|
2193
2249
|
readonly context: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
2194
2250
|
readonly traceId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
2195
2251
|
readonly spanId: readonly [9, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
2252
|
+
readonly id: readonly [10, import("./codec.ts").Codec<string, string>];
|
|
2196
2253
|
}>[], readonly import("./codec.ts").Written<{
|
|
2197
2254
|
readonly at: readonly [1, import("./codec.ts").Codec<bigint, number | bigint>];
|
|
2198
2255
|
readonly stream: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
@@ -2204,6 +2261,7 @@ export declare const RecordsTailBatch: import("./codec.ts").Message<{
|
|
|
2204
2261
|
readonly context: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
2205
2262
|
readonly traceId: readonly [8, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
2206
2263
|
readonly spanId: readonly [9, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
2264
|
+
readonly id: readonly [10, import("./codec.ts").Codec<string, string>];
|
|
2207
2265
|
}>[]>];
|
|
2208
2266
|
readonly missed: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
2209
2267
|
}>;
|