@miradorlabs/web-grpc 1.2.0 → 2.0.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/google/protobuf/timestamp.ts +1 -1
- package/package.json +1 -1
- package/proto/gateway/common/v1/status.ts +1 -1
- package/proto/gateway/common/v1/types.ts +1 -1
- package/proto/gateway/web/v1/account_gateway.ts +1 -1
- package/proto/gateway/web/v1/automation_gateway.ts +1 -1
- package/proto/gateway/web/v1/chain_gateway.ts +1 -1
- package/proto/gateway/web/v1/market_gateway.ts +1 -1
- package/proto/gateway/web/v1/oauth_gateway.ts +1 -1
- package/proto/gateway/web/v1/plan_gateway.ts +1 -1
- package/proto/gateway/web/v1/stream_gateway.ts +1 -1
- package/proto/gateway/web/v1/telemetry_gateway.ts +2098 -0
- package/proto/gateway/web/v1/telemetry_gateway_grpc_pb.js +159 -0
- package/proto/gateway/web/v1/telemetry_gateway_pb.js +3928 -0
- package/proto/gateway/web/v1/trace_gateway.ts +1 -1
|
@@ -0,0 +1,2098 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.10
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: proto/gateway/web/v1/telemetry_gateway.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import type { Metadata } from "@grpc/grpc-js";
|
|
10
|
+
import { Observable } from "rxjs";
|
|
11
|
+
import { map } from "rxjs/operators";
|
|
12
|
+
import { Timestamp } from "../../../../google/protobuf/timestamp";
|
|
13
|
+
import {
|
|
14
|
+
AnalyticsTimeInterval,
|
|
15
|
+
analyticsTimeIntervalFromJSON,
|
|
16
|
+
analyticsTimeIntervalToJSON,
|
|
17
|
+
AnalyticsTimeWindow,
|
|
18
|
+
analyticsTimeWindowFromJSON,
|
|
19
|
+
analyticsTimeWindowToJSON,
|
|
20
|
+
} from "./trace_gateway";
|
|
21
|
+
|
|
22
|
+
export const protobufPackage = "gateway.web.v1";
|
|
23
|
+
|
|
24
|
+
export enum MetricKind {
|
|
25
|
+
METRIC_KIND_UNSPECIFIED = 0,
|
|
26
|
+
METRIC_KIND_GAUGE = 1,
|
|
27
|
+
METRIC_KIND_SUM = 2,
|
|
28
|
+
METRIC_KIND_HISTOGRAM = 3,
|
|
29
|
+
UNRECOGNIZED = -1,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function metricKindFromJSON(object: any): MetricKind {
|
|
33
|
+
switch (object) {
|
|
34
|
+
case 0:
|
|
35
|
+
case "METRIC_KIND_UNSPECIFIED":
|
|
36
|
+
return MetricKind.METRIC_KIND_UNSPECIFIED;
|
|
37
|
+
case 1:
|
|
38
|
+
case "METRIC_KIND_GAUGE":
|
|
39
|
+
return MetricKind.METRIC_KIND_GAUGE;
|
|
40
|
+
case 2:
|
|
41
|
+
case "METRIC_KIND_SUM":
|
|
42
|
+
return MetricKind.METRIC_KIND_SUM;
|
|
43
|
+
case 3:
|
|
44
|
+
case "METRIC_KIND_HISTOGRAM":
|
|
45
|
+
return MetricKind.METRIC_KIND_HISTOGRAM;
|
|
46
|
+
case -1:
|
|
47
|
+
case "UNRECOGNIZED":
|
|
48
|
+
default:
|
|
49
|
+
return MetricKind.UNRECOGNIZED;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function metricKindToJSON(object: MetricKind): string {
|
|
54
|
+
switch (object) {
|
|
55
|
+
case MetricKind.METRIC_KIND_UNSPECIFIED:
|
|
56
|
+
return "METRIC_KIND_UNSPECIFIED";
|
|
57
|
+
case MetricKind.METRIC_KIND_GAUGE:
|
|
58
|
+
return "METRIC_KIND_GAUGE";
|
|
59
|
+
case MetricKind.METRIC_KIND_SUM:
|
|
60
|
+
return "METRIC_KIND_SUM";
|
|
61
|
+
case MetricKind.METRIC_KIND_HISTOGRAM:
|
|
62
|
+
return "METRIC_KIND_HISTOGRAM";
|
|
63
|
+
case MetricKind.UNRECOGNIZED:
|
|
64
|
+
default:
|
|
65
|
+
return "UNRECOGNIZED";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export enum GaugeAggregation {
|
|
70
|
+
GAUGE_AGGREGATION_UNSPECIFIED = 0,
|
|
71
|
+
GAUGE_AGGREGATION_LAST = 1,
|
|
72
|
+
GAUGE_AGGREGATION_AVG = 2,
|
|
73
|
+
GAUGE_AGGREGATION_MIN = 3,
|
|
74
|
+
GAUGE_AGGREGATION_MAX = 4,
|
|
75
|
+
GAUGE_AGGREGATION_SUM = 5,
|
|
76
|
+
GAUGE_AGGREGATION_COUNT = 6,
|
|
77
|
+
UNRECOGNIZED = -1,
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function gaugeAggregationFromJSON(object: any): GaugeAggregation {
|
|
81
|
+
switch (object) {
|
|
82
|
+
case 0:
|
|
83
|
+
case "GAUGE_AGGREGATION_UNSPECIFIED":
|
|
84
|
+
return GaugeAggregation.GAUGE_AGGREGATION_UNSPECIFIED;
|
|
85
|
+
case 1:
|
|
86
|
+
case "GAUGE_AGGREGATION_LAST":
|
|
87
|
+
return GaugeAggregation.GAUGE_AGGREGATION_LAST;
|
|
88
|
+
case 2:
|
|
89
|
+
case "GAUGE_AGGREGATION_AVG":
|
|
90
|
+
return GaugeAggregation.GAUGE_AGGREGATION_AVG;
|
|
91
|
+
case 3:
|
|
92
|
+
case "GAUGE_AGGREGATION_MIN":
|
|
93
|
+
return GaugeAggregation.GAUGE_AGGREGATION_MIN;
|
|
94
|
+
case 4:
|
|
95
|
+
case "GAUGE_AGGREGATION_MAX":
|
|
96
|
+
return GaugeAggregation.GAUGE_AGGREGATION_MAX;
|
|
97
|
+
case 5:
|
|
98
|
+
case "GAUGE_AGGREGATION_SUM":
|
|
99
|
+
return GaugeAggregation.GAUGE_AGGREGATION_SUM;
|
|
100
|
+
case 6:
|
|
101
|
+
case "GAUGE_AGGREGATION_COUNT":
|
|
102
|
+
return GaugeAggregation.GAUGE_AGGREGATION_COUNT;
|
|
103
|
+
case -1:
|
|
104
|
+
case "UNRECOGNIZED":
|
|
105
|
+
default:
|
|
106
|
+
return GaugeAggregation.UNRECOGNIZED;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function gaugeAggregationToJSON(object: GaugeAggregation): string {
|
|
111
|
+
switch (object) {
|
|
112
|
+
case GaugeAggregation.GAUGE_AGGREGATION_UNSPECIFIED:
|
|
113
|
+
return "GAUGE_AGGREGATION_UNSPECIFIED";
|
|
114
|
+
case GaugeAggregation.GAUGE_AGGREGATION_LAST:
|
|
115
|
+
return "GAUGE_AGGREGATION_LAST";
|
|
116
|
+
case GaugeAggregation.GAUGE_AGGREGATION_AVG:
|
|
117
|
+
return "GAUGE_AGGREGATION_AVG";
|
|
118
|
+
case GaugeAggregation.GAUGE_AGGREGATION_MIN:
|
|
119
|
+
return "GAUGE_AGGREGATION_MIN";
|
|
120
|
+
case GaugeAggregation.GAUGE_AGGREGATION_MAX:
|
|
121
|
+
return "GAUGE_AGGREGATION_MAX";
|
|
122
|
+
case GaugeAggregation.GAUGE_AGGREGATION_SUM:
|
|
123
|
+
return "GAUGE_AGGREGATION_SUM";
|
|
124
|
+
case GaugeAggregation.GAUGE_AGGREGATION_COUNT:
|
|
125
|
+
return "GAUGE_AGGREGATION_COUNT";
|
|
126
|
+
case GaugeAggregation.UNRECOGNIZED:
|
|
127
|
+
default:
|
|
128
|
+
return "UNRECOGNIZED";
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export enum SumAggregation {
|
|
133
|
+
SUM_AGGREGATION_UNSPECIFIED = 0,
|
|
134
|
+
SUM_AGGREGATION_RATE = 1,
|
|
135
|
+
SUM_AGGREGATION_INCREASE = 2,
|
|
136
|
+
SUM_AGGREGATION_LAST = 3,
|
|
137
|
+
SUM_AGGREGATION_COUNT = 4,
|
|
138
|
+
UNRECOGNIZED = -1,
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function sumAggregationFromJSON(object: any): SumAggregation {
|
|
142
|
+
switch (object) {
|
|
143
|
+
case 0:
|
|
144
|
+
case "SUM_AGGREGATION_UNSPECIFIED":
|
|
145
|
+
return SumAggregation.SUM_AGGREGATION_UNSPECIFIED;
|
|
146
|
+
case 1:
|
|
147
|
+
case "SUM_AGGREGATION_RATE":
|
|
148
|
+
return SumAggregation.SUM_AGGREGATION_RATE;
|
|
149
|
+
case 2:
|
|
150
|
+
case "SUM_AGGREGATION_INCREASE":
|
|
151
|
+
return SumAggregation.SUM_AGGREGATION_INCREASE;
|
|
152
|
+
case 3:
|
|
153
|
+
case "SUM_AGGREGATION_LAST":
|
|
154
|
+
return SumAggregation.SUM_AGGREGATION_LAST;
|
|
155
|
+
case 4:
|
|
156
|
+
case "SUM_AGGREGATION_COUNT":
|
|
157
|
+
return SumAggregation.SUM_AGGREGATION_COUNT;
|
|
158
|
+
case -1:
|
|
159
|
+
case "UNRECOGNIZED":
|
|
160
|
+
default:
|
|
161
|
+
return SumAggregation.UNRECOGNIZED;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function sumAggregationToJSON(object: SumAggregation): string {
|
|
166
|
+
switch (object) {
|
|
167
|
+
case SumAggregation.SUM_AGGREGATION_UNSPECIFIED:
|
|
168
|
+
return "SUM_AGGREGATION_UNSPECIFIED";
|
|
169
|
+
case SumAggregation.SUM_AGGREGATION_RATE:
|
|
170
|
+
return "SUM_AGGREGATION_RATE";
|
|
171
|
+
case SumAggregation.SUM_AGGREGATION_INCREASE:
|
|
172
|
+
return "SUM_AGGREGATION_INCREASE";
|
|
173
|
+
case SumAggregation.SUM_AGGREGATION_LAST:
|
|
174
|
+
return "SUM_AGGREGATION_LAST";
|
|
175
|
+
case SumAggregation.SUM_AGGREGATION_COUNT:
|
|
176
|
+
return "SUM_AGGREGATION_COUNT";
|
|
177
|
+
case SumAggregation.UNRECOGNIZED:
|
|
178
|
+
default:
|
|
179
|
+
return "UNRECOGNIZED";
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export enum HistogramAggregation {
|
|
184
|
+
HISTOGRAM_AGGREGATION_UNSPECIFIED = 0,
|
|
185
|
+
HISTOGRAM_AGGREGATION_QUANTILE = 1,
|
|
186
|
+
HISTOGRAM_AGGREGATION_AVG = 2,
|
|
187
|
+
HISTOGRAM_AGGREGATION_MIN = 3,
|
|
188
|
+
HISTOGRAM_AGGREGATION_MAX = 4,
|
|
189
|
+
HISTOGRAM_AGGREGATION_COUNT = 5,
|
|
190
|
+
UNRECOGNIZED = -1,
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export function histogramAggregationFromJSON(object: any): HistogramAggregation {
|
|
194
|
+
switch (object) {
|
|
195
|
+
case 0:
|
|
196
|
+
case "HISTOGRAM_AGGREGATION_UNSPECIFIED":
|
|
197
|
+
return HistogramAggregation.HISTOGRAM_AGGREGATION_UNSPECIFIED;
|
|
198
|
+
case 1:
|
|
199
|
+
case "HISTOGRAM_AGGREGATION_QUANTILE":
|
|
200
|
+
return HistogramAggregation.HISTOGRAM_AGGREGATION_QUANTILE;
|
|
201
|
+
case 2:
|
|
202
|
+
case "HISTOGRAM_AGGREGATION_AVG":
|
|
203
|
+
return HistogramAggregation.HISTOGRAM_AGGREGATION_AVG;
|
|
204
|
+
case 3:
|
|
205
|
+
case "HISTOGRAM_AGGREGATION_MIN":
|
|
206
|
+
return HistogramAggregation.HISTOGRAM_AGGREGATION_MIN;
|
|
207
|
+
case 4:
|
|
208
|
+
case "HISTOGRAM_AGGREGATION_MAX":
|
|
209
|
+
return HistogramAggregation.HISTOGRAM_AGGREGATION_MAX;
|
|
210
|
+
case 5:
|
|
211
|
+
case "HISTOGRAM_AGGREGATION_COUNT":
|
|
212
|
+
return HistogramAggregation.HISTOGRAM_AGGREGATION_COUNT;
|
|
213
|
+
case -1:
|
|
214
|
+
case "UNRECOGNIZED":
|
|
215
|
+
default:
|
|
216
|
+
return HistogramAggregation.UNRECOGNIZED;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export function histogramAggregationToJSON(object: HistogramAggregation): string {
|
|
221
|
+
switch (object) {
|
|
222
|
+
case HistogramAggregation.HISTOGRAM_AGGREGATION_UNSPECIFIED:
|
|
223
|
+
return "HISTOGRAM_AGGREGATION_UNSPECIFIED";
|
|
224
|
+
case HistogramAggregation.HISTOGRAM_AGGREGATION_QUANTILE:
|
|
225
|
+
return "HISTOGRAM_AGGREGATION_QUANTILE";
|
|
226
|
+
case HistogramAggregation.HISTOGRAM_AGGREGATION_AVG:
|
|
227
|
+
return "HISTOGRAM_AGGREGATION_AVG";
|
|
228
|
+
case HistogramAggregation.HISTOGRAM_AGGREGATION_MIN:
|
|
229
|
+
return "HISTOGRAM_AGGREGATION_MIN";
|
|
230
|
+
case HistogramAggregation.HISTOGRAM_AGGREGATION_MAX:
|
|
231
|
+
return "HISTOGRAM_AGGREGATION_MAX";
|
|
232
|
+
case HistogramAggregation.HISTOGRAM_AGGREGATION_COUNT:
|
|
233
|
+
return "HISTOGRAM_AGGREGATION_COUNT";
|
|
234
|
+
case HistogramAggregation.UNRECOGNIZED:
|
|
235
|
+
default:
|
|
236
|
+
return "UNRECOGNIZED";
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface StreamMetricsRequest {
|
|
241
|
+
/** Stamped by the gateway from the verified identity — never client-supplied. */
|
|
242
|
+
organizationId: string;
|
|
243
|
+
projectId: string;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface MetricCatalogEnvelope {
|
|
247
|
+
snapshot?: MetricCatalogSnapshot | undefined;
|
|
248
|
+
added?: MetricInfo | undefined;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface MetricCatalogSnapshot {
|
|
252
|
+
metrics: MetricInfo[];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface MetricInfo {
|
|
256
|
+
name: string;
|
|
257
|
+
unit: string;
|
|
258
|
+
kind: MetricKind;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface StreamMetricAttributesRequest {
|
|
262
|
+
/** Stamped by the gateway from the verified identity — never client-supplied. */
|
|
263
|
+
organizationId: string;
|
|
264
|
+
projectId: string;
|
|
265
|
+
metricName: string;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface MetricAttributeEnvelope {
|
|
269
|
+
snapshot?: MetricAttributeSnapshot | undefined;
|
|
270
|
+
added?: MetricAttribute | undefined;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface MetricAttributeSnapshot {
|
|
274
|
+
attributes: MetricAttribute[];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface MetricAttribute {
|
|
278
|
+
key: string;
|
|
279
|
+
values: string[];
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface GaugeQueryRequest {
|
|
283
|
+
/** Stamped by the gateway from the verified identity — never client-supplied. */
|
|
284
|
+
organizationId: string;
|
|
285
|
+
projectId: string;
|
|
286
|
+
metricName: string;
|
|
287
|
+
aggregation: GaugeAggregation;
|
|
288
|
+
timeWindow: AnalyticsTimeWindow;
|
|
289
|
+
timeInterval: AnalyticsTimeInterval;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface SumQueryRequest {
|
|
293
|
+
/** Stamped by the gateway from the verified identity — never client-supplied. */
|
|
294
|
+
organizationId: string;
|
|
295
|
+
projectId: string;
|
|
296
|
+
metricName: string;
|
|
297
|
+
aggregation: SumAggregation;
|
|
298
|
+
timeWindow: AnalyticsTimeWindow;
|
|
299
|
+
timeInterval: AnalyticsTimeInterval;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface HistogramQueryRequest {
|
|
303
|
+
/** Stamped by the gateway from the verified identity — never client-supplied. */
|
|
304
|
+
organizationId: string;
|
|
305
|
+
projectId: string;
|
|
306
|
+
metricName: string;
|
|
307
|
+
aggregation: HistogramAggregation;
|
|
308
|
+
/** Quantile level in (0,1); required iff aggregation == QUANTILE. */
|
|
309
|
+
quantile: number;
|
|
310
|
+
timeWindow: AnalyticsTimeWindow;
|
|
311
|
+
timeInterval: AnalyticsTimeInterval;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export interface MetricAnalyticsEnvelope {
|
|
315
|
+
snapshot?: MetricAnalyticsSnapshot | undefined;
|
|
316
|
+
bucketUpdate?: MetricSeriesBucketUpdate | undefined;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface MetricAnalyticsSnapshot {
|
|
320
|
+
series: MetricSeries[];
|
|
321
|
+
windowStart: Date | undefined;
|
|
322
|
+
windowEnd: Date | undefined;
|
|
323
|
+
bucketSizeMs: number;
|
|
324
|
+
expectedBucketCount: number;
|
|
325
|
+
unit: string;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface MetricSeries {
|
|
329
|
+
buckets: MetricBucket[];
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface MetricBucket {
|
|
333
|
+
bucketStart: Date | undefined;
|
|
334
|
+
value: number;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export interface MetricSeriesBucketUpdate {
|
|
338
|
+
bucket: MetricBucket | undefined;
|
|
339
|
+
generatedAt: Date | undefined;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function createBaseStreamMetricsRequest(): StreamMetricsRequest {
|
|
343
|
+
return { organizationId: "", projectId: "" };
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export const StreamMetricsRequest: MessageFns<StreamMetricsRequest> = {
|
|
347
|
+
encode(message: StreamMetricsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
348
|
+
if (message.organizationId !== "") {
|
|
349
|
+
writer.uint32(10).string(message.organizationId);
|
|
350
|
+
}
|
|
351
|
+
if (message.projectId !== "") {
|
|
352
|
+
writer.uint32(18).string(message.projectId);
|
|
353
|
+
}
|
|
354
|
+
return writer;
|
|
355
|
+
},
|
|
356
|
+
|
|
357
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StreamMetricsRequest {
|
|
358
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
359
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
360
|
+
const message = createBaseStreamMetricsRequest();
|
|
361
|
+
while (reader.pos < end) {
|
|
362
|
+
const tag = reader.uint32();
|
|
363
|
+
switch (tag >>> 3) {
|
|
364
|
+
case 1: {
|
|
365
|
+
if (tag !== 10) {
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
message.organizationId = reader.string();
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
case 2: {
|
|
373
|
+
if (tag !== 18) {
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
message.projectId = reader.string();
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
reader.skip(tag & 7);
|
|
385
|
+
}
|
|
386
|
+
return message;
|
|
387
|
+
},
|
|
388
|
+
|
|
389
|
+
fromJSON(object: any): StreamMetricsRequest {
|
|
390
|
+
return {
|
|
391
|
+
organizationId: isSet(object.organizationId)
|
|
392
|
+
? globalThis.String(object.organizationId)
|
|
393
|
+
: isSet(object.organization_id)
|
|
394
|
+
? globalThis.String(object.organization_id)
|
|
395
|
+
: "",
|
|
396
|
+
projectId: isSet(object.projectId)
|
|
397
|
+
? globalThis.String(object.projectId)
|
|
398
|
+
: isSet(object.project_id)
|
|
399
|
+
? globalThis.String(object.project_id)
|
|
400
|
+
: "",
|
|
401
|
+
};
|
|
402
|
+
},
|
|
403
|
+
|
|
404
|
+
toJSON(message: StreamMetricsRequest): unknown {
|
|
405
|
+
const obj: any = {};
|
|
406
|
+
if (message.organizationId !== "") {
|
|
407
|
+
obj.organizationId = message.organizationId;
|
|
408
|
+
}
|
|
409
|
+
if (message.projectId !== "") {
|
|
410
|
+
obj.projectId = message.projectId;
|
|
411
|
+
}
|
|
412
|
+
return obj;
|
|
413
|
+
},
|
|
414
|
+
|
|
415
|
+
create<I extends Exact<DeepPartial<StreamMetricsRequest>, I>>(base?: I): StreamMetricsRequest {
|
|
416
|
+
return StreamMetricsRequest.fromPartial(base ?? ({} as any));
|
|
417
|
+
},
|
|
418
|
+
fromPartial<I extends Exact<DeepPartial<StreamMetricsRequest>, I>>(object: I): StreamMetricsRequest {
|
|
419
|
+
const message = createBaseStreamMetricsRequest();
|
|
420
|
+
message.organizationId = object.organizationId ?? "";
|
|
421
|
+
message.projectId = object.projectId ?? "";
|
|
422
|
+
return message;
|
|
423
|
+
},
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
function createBaseMetricCatalogEnvelope(): MetricCatalogEnvelope {
|
|
427
|
+
return { snapshot: undefined, added: undefined };
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export const MetricCatalogEnvelope: MessageFns<MetricCatalogEnvelope> = {
|
|
431
|
+
encode(message: MetricCatalogEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
432
|
+
if (message.snapshot !== undefined) {
|
|
433
|
+
MetricCatalogSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
|
|
434
|
+
}
|
|
435
|
+
if (message.added !== undefined) {
|
|
436
|
+
MetricInfo.encode(message.added, writer.uint32(18).fork()).join();
|
|
437
|
+
}
|
|
438
|
+
return writer;
|
|
439
|
+
},
|
|
440
|
+
|
|
441
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricCatalogEnvelope {
|
|
442
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
443
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
444
|
+
const message = createBaseMetricCatalogEnvelope();
|
|
445
|
+
while (reader.pos < end) {
|
|
446
|
+
const tag = reader.uint32();
|
|
447
|
+
switch (tag >>> 3) {
|
|
448
|
+
case 1: {
|
|
449
|
+
if (tag !== 10) {
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
message.snapshot = MetricCatalogSnapshot.decode(reader, reader.uint32());
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
case 2: {
|
|
457
|
+
if (tag !== 18) {
|
|
458
|
+
break;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
message.added = MetricInfo.decode(reader, reader.uint32());
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
reader.skip(tag & 7);
|
|
469
|
+
}
|
|
470
|
+
return message;
|
|
471
|
+
},
|
|
472
|
+
|
|
473
|
+
fromJSON(object: any): MetricCatalogEnvelope {
|
|
474
|
+
return {
|
|
475
|
+
snapshot: isSet(object.snapshot) ? MetricCatalogSnapshot.fromJSON(object.snapshot) : undefined,
|
|
476
|
+
added: isSet(object.added) ? MetricInfo.fromJSON(object.added) : undefined,
|
|
477
|
+
};
|
|
478
|
+
},
|
|
479
|
+
|
|
480
|
+
toJSON(message: MetricCatalogEnvelope): unknown {
|
|
481
|
+
const obj: any = {};
|
|
482
|
+
if (message.snapshot !== undefined) {
|
|
483
|
+
obj.snapshot = MetricCatalogSnapshot.toJSON(message.snapshot);
|
|
484
|
+
}
|
|
485
|
+
if (message.added !== undefined) {
|
|
486
|
+
obj.added = MetricInfo.toJSON(message.added);
|
|
487
|
+
}
|
|
488
|
+
return obj;
|
|
489
|
+
},
|
|
490
|
+
|
|
491
|
+
create<I extends Exact<DeepPartial<MetricCatalogEnvelope>, I>>(base?: I): MetricCatalogEnvelope {
|
|
492
|
+
return MetricCatalogEnvelope.fromPartial(base ?? ({} as any));
|
|
493
|
+
},
|
|
494
|
+
fromPartial<I extends Exact<DeepPartial<MetricCatalogEnvelope>, I>>(object: I): MetricCatalogEnvelope {
|
|
495
|
+
const message = createBaseMetricCatalogEnvelope();
|
|
496
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
497
|
+
? MetricCatalogSnapshot.fromPartial(object.snapshot)
|
|
498
|
+
: undefined;
|
|
499
|
+
message.added = (object.added !== undefined && object.added !== null)
|
|
500
|
+
? MetricInfo.fromPartial(object.added)
|
|
501
|
+
: undefined;
|
|
502
|
+
return message;
|
|
503
|
+
},
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
function createBaseMetricCatalogSnapshot(): MetricCatalogSnapshot {
|
|
507
|
+
return { metrics: [] };
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export const MetricCatalogSnapshot: MessageFns<MetricCatalogSnapshot> = {
|
|
511
|
+
encode(message: MetricCatalogSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
512
|
+
for (const v of message.metrics) {
|
|
513
|
+
MetricInfo.encode(v!, writer.uint32(10).fork()).join();
|
|
514
|
+
}
|
|
515
|
+
return writer;
|
|
516
|
+
},
|
|
517
|
+
|
|
518
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricCatalogSnapshot {
|
|
519
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
520
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
521
|
+
const message = createBaseMetricCatalogSnapshot();
|
|
522
|
+
while (reader.pos < end) {
|
|
523
|
+
const tag = reader.uint32();
|
|
524
|
+
switch (tag >>> 3) {
|
|
525
|
+
case 1: {
|
|
526
|
+
if (tag !== 10) {
|
|
527
|
+
break;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
message.metrics.push(MetricInfo.decode(reader, reader.uint32()));
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
reader.skip(tag & 7);
|
|
538
|
+
}
|
|
539
|
+
return message;
|
|
540
|
+
},
|
|
541
|
+
|
|
542
|
+
fromJSON(object: any): MetricCatalogSnapshot {
|
|
543
|
+
return {
|
|
544
|
+
metrics: globalThis.Array.isArray(object?.metrics) ? object.metrics.map((e: any) => MetricInfo.fromJSON(e)) : [],
|
|
545
|
+
};
|
|
546
|
+
},
|
|
547
|
+
|
|
548
|
+
toJSON(message: MetricCatalogSnapshot): unknown {
|
|
549
|
+
const obj: any = {};
|
|
550
|
+
if (message.metrics?.length) {
|
|
551
|
+
obj.metrics = message.metrics.map((e) => MetricInfo.toJSON(e));
|
|
552
|
+
}
|
|
553
|
+
return obj;
|
|
554
|
+
},
|
|
555
|
+
|
|
556
|
+
create<I extends Exact<DeepPartial<MetricCatalogSnapshot>, I>>(base?: I): MetricCatalogSnapshot {
|
|
557
|
+
return MetricCatalogSnapshot.fromPartial(base ?? ({} as any));
|
|
558
|
+
},
|
|
559
|
+
fromPartial<I extends Exact<DeepPartial<MetricCatalogSnapshot>, I>>(object: I): MetricCatalogSnapshot {
|
|
560
|
+
const message = createBaseMetricCatalogSnapshot();
|
|
561
|
+
message.metrics = object.metrics?.map((e) => MetricInfo.fromPartial(e)) || [];
|
|
562
|
+
return message;
|
|
563
|
+
},
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
function createBaseMetricInfo(): MetricInfo {
|
|
567
|
+
return { name: "", unit: "", kind: 0 };
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export const MetricInfo: MessageFns<MetricInfo> = {
|
|
571
|
+
encode(message: MetricInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
572
|
+
if (message.name !== "") {
|
|
573
|
+
writer.uint32(10).string(message.name);
|
|
574
|
+
}
|
|
575
|
+
if (message.unit !== "") {
|
|
576
|
+
writer.uint32(18).string(message.unit);
|
|
577
|
+
}
|
|
578
|
+
if (message.kind !== 0) {
|
|
579
|
+
writer.uint32(24).int32(message.kind);
|
|
580
|
+
}
|
|
581
|
+
return writer;
|
|
582
|
+
},
|
|
583
|
+
|
|
584
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricInfo {
|
|
585
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
586
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
587
|
+
const message = createBaseMetricInfo();
|
|
588
|
+
while (reader.pos < end) {
|
|
589
|
+
const tag = reader.uint32();
|
|
590
|
+
switch (tag >>> 3) {
|
|
591
|
+
case 1: {
|
|
592
|
+
if (tag !== 10) {
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
message.name = reader.string();
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
case 2: {
|
|
600
|
+
if (tag !== 18) {
|
|
601
|
+
break;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
message.unit = reader.string();
|
|
605
|
+
continue;
|
|
606
|
+
}
|
|
607
|
+
case 3: {
|
|
608
|
+
if (tag !== 24) {
|
|
609
|
+
break;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
message.kind = reader.int32() as any;
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
617
|
+
break;
|
|
618
|
+
}
|
|
619
|
+
reader.skip(tag & 7);
|
|
620
|
+
}
|
|
621
|
+
return message;
|
|
622
|
+
},
|
|
623
|
+
|
|
624
|
+
fromJSON(object: any): MetricInfo {
|
|
625
|
+
return {
|
|
626
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
627
|
+
unit: isSet(object.unit) ? globalThis.String(object.unit) : "",
|
|
628
|
+
kind: isSet(object.kind) ? metricKindFromJSON(object.kind) : 0,
|
|
629
|
+
};
|
|
630
|
+
},
|
|
631
|
+
|
|
632
|
+
toJSON(message: MetricInfo): unknown {
|
|
633
|
+
const obj: any = {};
|
|
634
|
+
if (message.name !== "") {
|
|
635
|
+
obj.name = message.name;
|
|
636
|
+
}
|
|
637
|
+
if (message.unit !== "") {
|
|
638
|
+
obj.unit = message.unit;
|
|
639
|
+
}
|
|
640
|
+
if (message.kind !== 0) {
|
|
641
|
+
obj.kind = metricKindToJSON(message.kind);
|
|
642
|
+
}
|
|
643
|
+
return obj;
|
|
644
|
+
},
|
|
645
|
+
|
|
646
|
+
create<I extends Exact<DeepPartial<MetricInfo>, I>>(base?: I): MetricInfo {
|
|
647
|
+
return MetricInfo.fromPartial(base ?? ({} as any));
|
|
648
|
+
},
|
|
649
|
+
fromPartial<I extends Exact<DeepPartial<MetricInfo>, I>>(object: I): MetricInfo {
|
|
650
|
+
const message = createBaseMetricInfo();
|
|
651
|
+
message.name = object.name ?? "";
|
|
652
|
+
message.unit = object.unit ?? "";
|
|
653
|
+
message.kind = object.kind ?? 0;
|
|
654
|
+
return message;
|
|
655
|
+
},
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
function createBaseStreamMetricAttributesRequest(): StreamMetricAttributesRequest {
|
|
659
|
+
return { organizationId: "", projectId: "", metricName: "" };
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export const StreamMetricAttributesRequest: MessageFns<StreamMetricAttributesRequest> = {
|
|
663
|
+
encode(message: StreamMetricAttributesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
664
|
+
if (message.organizationId !== "") {
|
|
665
|
+
writer.uint32(10).string(message.organizationId);
|
|
666
|
+
}
|
|
667
|
+
if (message.projectId !== "") {
|
|
668
|
+
writer.uint32(18).string(message.projectId);
|
|
669
|
+
}
|
|
670
|
+
if (message.metricName !== "") {
|
|
671
|
+
writer.uint32(26).string(message.metricName);
|
|
672
|
+
}
|
|
673
|
+
return writer;
|
|
674
|
+
},
|
|
675
|
+
|
|
676
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StreamMetricAttributesRequest {
|
|
677
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
678
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
679
|
+
const message = createBaseStreamMetricAttributesRequest();
|
|
680
|
+
while (reader.pos < end) {
|
|
681
|
+
const tag = reader.uint32();
|
|
682
|
+
switch (tag >>> 3) {
|
|
683
|
+
case 1: {
|
|
684
|
+
if (tag !== 10) {
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
message.organizationId = reader.string();
|
|
689
|
+
continue;
|
|
690
|
+
}
|
|
691
|
+
case 2: {
|
|
692
|
+
if (tag !== 18) {
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
message.projectId = reader.string();
|
|
697
|
+
continue;
|
|
698
|
+
}
|
|
699
|
+
case 3: {
|
|
700
|
+
if (tag !== 26) {
|
|
701
|
+
break;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
message.metricName = reader.string();
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
reader.skip(tag & 7);
|
|
712
|
+
}
|
|
713
|
+
return message;
|
|
714
|
+
},
|
|
715
|
+
|
|
716
|
+
fromJSON(object: any): StreamMetricAttributesRequest {
|
|
717
|
+
return {
|
|
718
|
+
organizationId: isSet(object.organizationId)
|
|
719
|
+
? globalThis.String(object.organizationId)
|
|
720
|
+
: isSet(object.organization_id)
|
|
721
|
+
? globalThis.String(object.organization_id)
|
|
722
|
+
: "",
|
|
723
|
+
projectId: isSet(object.projectId)
|
|
724
|
+
? globalThis.String(object.projectId)
|
|
725
|
+
: isSet(object.project_id)
|
|
726
|
+
? globalThis.String(object.project_id)
|
|
727
|
+
: "",
|
|
728
|
+
metricName: isSet(object.metricName)
|
|
729
|
+
? globalThis.String(object.metricName)
|
|
730
|
+
: isSet(object.metric_name)
|
|
731
|
+
? globalThis.String(object.metric_name)
|
|
732
|
+
: "",
|
|
733
|
+
};
|
|
734
|
+
},
|
|
735
|
+
|
|
736
|
+
toJSON(message: StreamMetricAttributesRequest): unknown {
|
|
737
|
+
const obj: any = {};
|
|
738
|
+
if (message.organizationId !== "") {
|
|
739
|
+
obj.organizationId = message.organizationId;
|
|
740
|
+
}
|
|
741
|
+
if (message.projectId !== "") {
|
|
742
|
+
obj.projectId = message.projectId;
|
|
743
|
+
}
|
|
744
|
+
if (message.metricName !== "") {
|
|
745
|
+
obj.metricName = message.metricName;
|
|
746
|
+
}
|
|
747
|
+
return obj;
|
|
748
|
+
},
|
|
749
|
+
|
|
750
|
+
create<I extends Exact<DeepPartial<StreamMetricAttributesRequest>, I>>(base?: I): StreamMetricAttributesRequest {
|
|
751
|
+
return StreamMetricAttributesRequest.fromPartial(base ?? ({} as any));
|
|
752
|
+
},
|
|
753
|
+
fromPartial<I extends Exact<DeepPartial<StreamMetricAttributesRequest>, I>>(
|
|
754
|
+
object: I,
|
|
755
|
+
): StreamMetricAttributesRequest {
|
|
756
|
+
const message = createBaseStreamMetricAttributesRequest();
|
|
757
|
+
message.organizationId = object.organizationId ?? "";
|
|
758
|
+
message.projectId = object.projectId ?? "";
|
|
759
|
+
message.metricName = object.metricName ?? "";
|
|
760
|
+
return message;
|
|
761
|
+
},
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
function createBaseMetricAttributeEnvelope(): MetricAttributeEnvelope {
|
|
765
|
+
return { snapshot: undefined, added: undefined };
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
export const MetricAttributeEnvelope: MessageFns<MetricAttributeEnvelope> = {
|
|
769
|
+
encode(message: MetricAttributeEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
770
|
+
if (message.snapshot !== undefined) {
|
|
771
|
+
MetricAttributeSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
|
|
772
|
+
}
|
|
773
|
+
if (message.added !== undefined) {
|
|
774
|
+
MetricAttribute.encode(message.added, writer.uint32(18).fork()).join();
|
|
775
|
+
}
|
|
776
|
+
return writer;
|
|
777
|
+
},
|
|
778
|
+
|
|
779
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricAttributeEnvelope {
|
|
780
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
781
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
782
|
+
const message = createBaseMetricAttributeEnvelope();
|
|
783
|
+
while (reader.pos < end) {
|
|
784
|
+
const tag = reader.uint32();
|
|
785
|
+
switch (tag >>> 3) {
|
|
786
|
+
case 1: {
|
|
787
|
+
if (tag !== 10) {
|
|
788
|
+
break;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
message.snapshot = MetricAttributeSnapshot.decode(reader, reader.uint32());
|
|
792
|
+
continue;
|
|
793
|
+
}
|
|
794
|
+
case 2: {
|
|
795
|
+
if (tag !== 18) {
|
|
796
|
+
break;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
message.added = MetricAttribute.decode(reader, reader.uint32());
|
|
800
|
+
continue;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
804
|
+
break;
|
|
805
|
+
}
|
|
806
|
+
reader.skip(tag & 7);
|
|
807
|
+
}
|
|
808
|
+
return message;
|
|
809
|
+
},
|
|
810
|
+
|
|
811
|
+
fromJSON(object: any): MetricAttributeEnvelope {
|
|
812
|
+
return {
|
|
813
|
+
snapshot: isSet(object.snapshot) ? MetricAttributeSnapshot.fromJSON(object.snapshot) : undefined,
|
|
814
|
+
added: isSet(object.added) ? MetricAttribute.fromJSON(object.added) : undefined,
|
|
815
|
+
};
|
|
816
|
+
},
|
|
817
|
+
|
|
818
|
+
toJSON(message: MetricAttributeEnvelope): unknown {
|
|
819
|
+
const obj: any = {};
|
|
820
|
+
if (message.snapshot !== undefined) {
|
|
821
|
+
obj.snapshot = MetricAttributeSnapshot.toJSON(message.snapshot);
|
|
822
|
+
}
|
|
823
|
+
if (message.added !== undefined) {
|
|
824
|
+
obj.added = MetricAttribute.toJSON(message.added);
|
|
825
|
+
}
|
|
826
|
+
return obj;
|
|
827
|
+
},
|
|
828
|
+
|
|
829
|
+
create<I extends Exact<DeepPartial<MetricAttributeEnvelope>, I>>(base?: I): MetricAttributeEnvelope {
|
|
830
|
+
return MetricAttributeEnvelope.fromPartial(base ?? ({} as any));
|
|
831
|
+
},
|
|
832
|
+
fromPartial<I extends Exact<DeepPartial<MetricAttributeEnvelope>, I>>(object: I): MetricAttributeEnvelope {
|
|
833
|
+
const message = createBaseMetricAttributeEnvelope();
|
|
834
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
835
|
+
? MetricAttributeSnapshot.fromPartial(object.snapshot)
|
|
836
|
+
: undefined;
|
|
837
|
+
message.added = (object.added !== undefined && object.added !== null)
|
|
838
|
+
? MetricAttribute.fromPartial(object.added)
|
|
839
|
+
: undefined;
|
|
840
|
+
return message;
|
|
841
|
+
},
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
function createBaseMetricAttributeSnapshot(): MetricAttributeSnapshot {
|
|
845
|
+
return { attributes: [] };
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
export const MetricAttributeSnapshot: MessageFns<MetricAttributeSnapshot> = {
|
|
849
|
+
encode(message: MetricAttributeSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
850
|
+
for (const v of message.attributes) {
|
|
851
|
+
MetricAttribute.encode(v!, writer.uint32(10).fork()).join();
|
|
852
|
+
}
|
|
853
|
+
return writer;
|
|
854
|
+
},
|
|
855
|
+
|
|
856
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricAttributeSnapshot {
|
|
857
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
858
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
859
|
+
const message = createBaseMetricAttributeSnapshot();
|
|
860
|
+
while (reader.pos < end) {
|
|
861
|
+
const tag = reader.uint32();
|
|
862
|
+
switch (tag >>> 3) {
|
|
863
|
+
case 1: {
|
|
864
|
+
if (tag !== 10) {
|
|
865
|
+
break;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
message.attributes.push(MetricAttribute.decode(reader, reader.uint32()));
|
|
869
|
+
continue;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
873
|
+
break;
|
|
874
|
+
}
|
|
875
|
+
reader.skip(tag & 7);
|
|
876
|
+
}
|
|
877
|
+
return message;
|
|
878
|
+
},
|
|
879
|
+
|
|
880
|
+
fromJSON(object: any): MetricAttributeSnapshot {
|
|
881
|
+
return {
|
|
882
|
+
attributes: globalThis.Array.isArray(object?.attributes)
|
|
883
|
+
? object.attributes.map((e: any) => MetricAttribute.fromJSON(e))
|
|
884
|
+
: [],
|
|
885
|
+
};
|
|
886
|
+
},
|
|
887
|
+
|
|
888
|
+
toJSON(message: MetricAttributeSnapshot): unknown {
|
|
889
|
+
const obj: any = {};
|
|
890
|
+
if (message.attributes?.length) {
|
|
891
|
+
obj.attributes = message.attributes.map((e) => MetricAttribute.toJSON(e));
|
|
892
|
+
}
|
|
893
|
+
return obj;
|
|
894
|
+
},
|
|
895
|
+
|
|
896
|
+
create<I extends Exact<DeepPartial<MetricAttributeSnapshot>, I>>(base?: I): MetricAttributeSnapshot {
|
|
897
|
+
return MetricAttributeSnapshot.fromPartial(base ?? ({} as any));
|
|
898
|
+
},
|
|
899
|
+
fromPartial<I extends Exact<DeepPartial<MetricAttributeSnapshot>, I>>(object: I): MetricAttributeSnapshot {
|
|
900
|
+
const message = createBaseMetricAttributeSnapshot();
|
|
901
|
+
message.attributes = object.attributes?.map((e) => MetricAttribute.fromPartial(e)) || [];
|
|
902
|
+
return message;
|
|
903
|
+
},
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
function createBaseMetricAttribute(): MetricAttribute {
|
|
907
|
+
return { key: "", values: [] };
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
export const MetricAttribute: MessageFns<MetricAttribute> = {
|
|
911
|
+
encode(message: MetricAttribute, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
912
|
+
if (message.key !== "") {
|
|
913
|
+
writer.uint32(10).string(message.key);
|
|
914
|
+
}
|
|
915
|
+
for (const v of message.values) {
|
|
916
|
+
writer.uint32(18).string(v!);
|
|
917
|
+
}
|
|
918
|
+
return writer;
|
|
919
|
+
},
|
|
920
|
+
|
|
921
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricAttribute {
|
|
922
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
923
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
924
|
+
const message = createBaseMetricAttribute();
|
|
925
|
+
while (reader.pos < end) {
|
|
926
|
+
const tag = reader.uint32();
|
|
927
|
+
switch (tag >>> 3) {
|
|
928
|
+
case 1: {
|
|
929
|
+
if (tag !== 10) {
|
|
930
|
+
break;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
message.key = reader.string();
|
|
934
|
+
continue;
|
|
935
|
+
}
|
|
936
|
+
case 2: {
|
|
937
|
+
if (tag !== 18) {
|
|
938
|
+
break;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
message.values.push(reader.string());
|
|
942
|
+
continue;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
948
|
+
reader.skip(tag & 7);
|
|
949
|
+
}
|
|
950
|
+
return message;
|
|
951
|
+
},
|
|
952
|
+
|
|
953
|
+
fromJSON(object: any): MetricAttribute {
|
|
954
|
+
return {
|
|
955
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
956
|
+
values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
|
|
957
|
+
};
|
|
958
|
+
},
|
|
959
|
+
|
|
960
|
+
toJSON(message: MetricAttribute): unknown {
|
|
961
|
+
const obj: any = {};
|
|
962
|
+
if (message.key !== "") {
|
|
963
|
+
obj.key = message.key;
|
|
964
|
+
}
|
|
965
|
+
if (message.values?.length) {
|
|
966
|
+
obj.values = message.values;
|
|
967
|
+
}
|
|
968
|
+
return obj;
|
|
969
|
+
},
|
|
970
|
+
|
|
971
|
+
create<I extends Exact<DeepPartial<MetricAttribute>, I>>(base?: I): MetricAttribute {
|
|
972
|
+
return MetricAttribute.fromPartial(base ?? ({} as any));
|
|
973
|
+
},
|
|
974
|
+
fromPartial<I extends Exact<DeepPartial<MetricAttribute>, I>>(object: I): MetricAttribute {
|
|
975
|
+
const message = createBaseMetricAttribute();
|
|
976
|
+
message.key = object.key ?? "";
|
|
977
|
+
message.values = object.values?.map((e) => e) || [];
|
|
978
|
+
return message;
|
|
979
|
+
},
|
|
980
|
+
};
|
|
981
|
+
|
|
982
|
+
function createBaseGaugeQueryRequest(): GaugeQueryRequest {
|
|
983
|
+
return { organizationId: "", projectId: "", metricName: "", aggregation: 0, timeWindow: 0, timeInterval: 0 };
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
export const GaugeQueryRequest: MessageFns<GaugeQueryRequest> = {
|
|
987
|
+
encode(message: GaugeQueryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
988
|
+
if (message.organizationId !== "") {
|
|
989
|
+
writer.uint32(10).string(message.organizationId);
|
|
990
|
+
}
|
|
991
|
+
if (message.projectId !== "") {
|
|
992
|
+
writer.uint32(18).string(message.projectId);
|
|
993
|
+
}
|
|
994
|
+
if (message.metricName !== "") {
|
|
995
|
+
writer.uint32(26).string(message.metricName);
|
|
996
|
+
}
|
|
997
|
+
if (message.aggregation !== 0) {
|
|
998
|
+
writer.uint32(32).int32(message.aggregation);
|
|
999
|
+
}
|
|
1000
|
+
if (message.timeWindow !== 0) {
|
|
1001
|
+
writer.uint32(40).int32(message.timeWindow);
|
|
1002
|
+
}
|
|
1003
|
+
if (message.timeInterval !== 0) {
|
|
1004
|
+
writer.uint32(48).int32(message.timeInterval);
|
|
1005
|
+
}
|
|
1006
|
+
return writer;
|
|
1007
|
+
},
|
|
1008
|
+
|
|
1009
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GaugeQueryRequest {
|
|
1010
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1011
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1012
|
+
const message = createBaseGaugeQueryRequest();
|
|
1013
|
+
while (reader.pos < end) {
|
|
1014
|
+
const tag = reader.uint32();
|
|
1015
|
+
switch (tag >>> 3) {
|
|
1016
|
+
case 1: {
|
|
1017
|
+
if (tag !== 10) {
|
|
1018
|
+
break;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
message.organizationId = reader.string();
|
|
1022
|
+
continue;
|
|
1023
|
+
}
|
|
1024
|
+
case 2: {
|
|
1025
|
+
if (tag !== 18) {
|
|
1026
|
+
break;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
message.projectId = reader.string();
|
|
1030
|
+
continue;
|
|
1031
|
+
}
|
|
1032
|
+
case 3: {
|
|
1033
|
+
if (tag !== 26) {
|
|
1034
|
+
break;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
message.metricName = reader.string();
|
|
1038
|
+
continue;
|
|
1039
|
+
}
|
|
1040
|
+
case 4: {
|
|
1041
|
+
if (tag !== 32) {
|
|
1042
|
+
break;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
message.aggregation = reader.int32() as any;
|
|
1046
|
+
continue;
|
|
1047
|
+
}
|
|
1048
|
+
case 5: {
|
|
1049
|
+
if (tag !== 40) {
|
|
1050
|
+
break;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
message.timeWindow = reader.int32() as any;
|
|
1054
|
+
continue;
|
|
1055
|
+
}
|
|
1056
|
+
case 6: {
|
|
1057
|
+
if (tag !== 48) {
|
|
1058
|
+
break;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
message.timeInterval = reader.int32() as any;
|
|
1062
|
+
continue;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1066
|
+
break;
|
|
1067
|
+
}
|
|
1068
|
+
reader.skip(tag & 7);
|
|
1069
|
+
}
|
|
1070
|
+
return message;
|
|
1071
|
+
},
|
|
1072
|
+
|
|
1073
|
+
fromJSON(object: any): GaugeQueryRequest {
|
|
1074
|
+
return {
|
|
1075
|
+
organizationId: isSet(object.organizationId)
|
|
1076
|
+
? globalThis.String(object.organizationId)
|
|
1077
|
+
: isSet(object.organization_id)
|
|
1078
|
+
? globalThis.String(object.organization_id)
|
|
1079
|
+
: "",
|
|
1080
|
+
projectId: isSet(object.projectId)
|
|
1081
|
+
? globalThis.String(object.projectId)
|
|
1082
|
+
: isSet(object.project_id)
|
|
1083
|
+
? globalThis.String(object.project_id)
|
|
1084
|
+
: "",
|
|
1085
|
+
metricName: isSet(object.metricName)
|
|
1086
|
+
? globalThis.String(object.metricName)
|
|
1087
|
+
: isSet(object.metric_name)
|
|
1088
|
+
? globalThis.String(object.metric_name)
|
|
1089
|
+
: "",
|
|
1090
|
+
aggregation: isSet(object.aggregation) ? gaugeAggregationFromJSON(object.aggregation) : 0,
|
|
1091
|
+
timeWindow: isSet(object.timeWindow)
|
|
1092
|
+
? analyticsTimeWindowFromJSON(object.timeWindow)
|
|
1093
|
+
: isSet(object.time_window)
|
|
1094
|
+
? analyticsTimeWindowFromJSON(object.time_window)
|
|
1095
|
+
: 0,
|
|
1096
|
+
timeInterval: isSet(object.timeInterval)
|
|
1097
|
+
? analyticsTimeIntervalFromJSON(object.timeInterval)
|
|
1098
|
+
: isSet(object.time_interval)
|
|
1099
|
+
? analyticsTimeIntervalFromJSON(object.time_interval)
|
|
1100
|
+
: 0,
|
|
1101
|
+
};
|
|
1102
|
+
},
|
|
1103
|
+
|
|
1104
|
+
toJSON(message: GaugeQueryRequest): unknown {
|
|
1105
|
+
const obj: any = {};
|
|
1106
|
+
if (message.organizationId !== "") {
|
|
1107
|
+
obj.organizationId = message.organizationId;
|
|
1108
|
+
}
|
|
1109
|
+
if (message.projectId !== "") {
|
|
1110
|
+
obj.projectId = message.projectId;
|
|
1111
|
+
}
|
|
1112
|
+
if (message.metricName !== "") {
|
|
1113
|
+
obj.metricName = message.metricName;
|
|
1114
|
+
}
|
|
1115
|
+
if (message.aggregation !== 0) {
|
|
1116
|
+
obj.aggregation = gaugeAggregationToJSON(message.aggregation);
|
|
1117
|
+
}
|
|
1118
|
+
if (message.timeWindow !== 0) {
|
|
1119
|
+
obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
|
|
1120
|
+
}
|
|
1121
|
+
if (message.timeInterval !== 0) {
|
|
1122
|
+
obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
|
|
1123
|
+
}
|
|
1124
|
+
return obj;
|
|
1125
|
+
},
|
|
1126
|
+
|
|
1127
|
+
create<I extends Exact<DeepPartial<GaugeQueryRequest>, I>>(base?: I): GaugeQueryRequest {
|
|
1128
|
+
return GaugeQueryRequest.fromPartial(base ?? ({} as any));
|
|
1129
|
+
},
|
|
1130
|
+
fromPartial<I extends Exact<DeepPartial<GaugeQueryRequest>, I>>(object: I): GaugeQueryRequest {
|
|
1131
|
+
const message = createBaseGaugeQueryRequest();
|
|
1132
|
+
message.organizationId = object.organizationId ?? "";
|
|
1133
|
+
message.projectId = object.projectId ?? "";
|
|
1134
|
+
message.metricName = object.metricName ?? "";
|
|
1135
|
+
message.aggregation = object.aggregation ?? 0;
|
|
1136
|
+
message.timeWindow = object.timeWindow ?? 0;
|
|
1137
|
+
message.timeInterval = object.timeInterval ?? 0;
|
|
1138
|
+
return message;
|
|
1139
|
+
},
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1142
|
+
function createBaseSumQueryRequest(): SumQueryRequest {
|
|
1143
|
+
return { organizationId: "", projectId: "", metricName: "", aggregation: 0, timeWindow: 0, timeInterval: 0 };
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
export const SumQueryRequest: MessageFns<SumQueryRequest> = {
|
|
1147
|
+
encode(message: SumQueryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1148
|
+
if (message.organizationId !== "") {
|
|
1149
|
+
writer.uint32(10).string(message.organizationId);
|
|
1150
|
+
}
|
|
1151
|
+
if (message.projectId !== "") {
|
|
1152
|
+
writer.uint32(18).string(message.projectId);
|
|
1153
|
+
}
|
|
1154
|
+
if (message.metricName !== "") {
|
|
1155
|
+
writer.uint32(26).string(message.metricName);
|
|
1156
|
+
}
|
|
1157
|
+
if (message.aggregation !== 0) {
|
|
1158
|
+
writer.uint32(32).int32(message.aggregation);
|
|
1159
|
+
}
|
|
1160
|
+
if (message.timeWindow !== 0) {
|
|
1161
|
+
writer.uint32(40).int32(message.timeWindow);
|
|
1162
|
+
}
|
|
1163
|
+
if (message.timeInterval !== 0) {
|
|
1164
|
+
writer.uint32(48).int32(message.timeInterval);
|
|
1165
|
+
}
|
|
1166
|
+
return writer;
|
|
1167
|
+
},
|
|
1168
|
+
|
|
1169
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SumQueryRequest {
|
|
1170
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1171
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1172
|
+
const message = createBaseSumQueryRequest();
|
|
1173
|
+
while (reader.pos < end) {
|
|
1174
|
+
const tag = reader.uint32();
|
|
1175
|
+
switch (tag >>> 3) {
|
|
1176
|
+
case 1: {
|
|
1177
|
+
if (tag !== 10) {
|
|
1178
|
+
break;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
message.organizationId = reader.string();
|
|
1182
|
+
continue;
|
|
1183
|
+
}
|
|
1184
|
+
case 2: {
|
|
1185
|
+
if (tag !== 18) {
|
|
1186
|
+
break;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
message.projectId = reader.string();
|
|
1190
|
+
continue;
|
|
1191
|
+
}
|
|
1192
|
+
case 3: {
|
|
1193
|
+
if (tag !== 26) {
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
message.metricName = reader.string();
|
|
1198
|
+
continue;
|
|
1199
|
+
}
|
|
1200
|
+
case 4: {
|
|
1201
|
+
if (tag !== 32) {
|
|
1202
|
+
break;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
message.aggregation = reader.int32() as any;
|
|
1206
|
+
continue;
|
|
1207
|
+
}
|
|
1208
|
+
case 5: {
|
|
1209
|
+
if (tag !== 40) {
|
|
1210
|
+
break;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
message.timeWindow = reader.int32() as any;
|
|
1214
|
+
continue;
|
|
1215
|
+
}
|
|
1216
|
+
case 6: {
|
|
1217
|
+
if (tag !== 48) {
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
message.timeInterval = reader.int32() as any;
|
|
1222
|
+
continue;
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1226
|
+
break;
|
|
1227
|
+
}
|
|
1228
|
+
reader.skip(tag & 7);
|
|
1229
|
+
}
|
|
1230
|
+
return message;
|
|
1231
|
+
},
|
|
1232
|
+
|
|
1233
|
+
fromJSON(object: any): SumQueryRequest {
|
|
1234
|
+
return {
|
|
1235
|
+
organizationId: isSet(object.organizationId)
|
|
1236
|
+
? globalThis.String(object.organizationId)
|
|
1237
|
+
: isSet(object.organization_id)
|
|
1238
|
+
? globalThis.String(object.organization_id)
|
|
1239
|
+
: "",
|
|
1240
|
+
projectId: isSet(object.projectId)
|
|
1241
|
+
? globalThis.String(object.projectId)
|
|
1242
|
+
: isSet(object.project_id)
|
|
1243
|
+
? globalThis.String(object.project_id)
|
|
1244
|
+
: "",
|
|
1245
|
+
metricName: isSet(object.metricName)
|
|
1246
|
+
? globalThis.String(object.metricName)
|
|
1247
|
+
: isSet(object.metric_name)
|
|
1248
|
+
? globalThis.String(object.metric_name)
|
|
1249
|
+
: "",
|
|
1250
|
+
aggregation: isSet(object.aggregation) ? sumAggregationFromJSON(object.aggregation) : 0,
|
|
1251
|
+
timeWindow: isSet(object.timeWindow)
|
|
1252
|
+
? analyticsTimeWindowFromJSON(object.timeWindow)
|
|
1253
|
+
: isSet(object.time_window)
|
|
1254
|
+
? analyticsTimeWindowFromJSON(object.time_window)
|
|
1255
|
+
: 0,
|
|
1256
|
+
timeInterval: isSet(object.timeInterval)
|
|
1257
|
+
? analyticsTimeIntervalFromJSON(object.timeInterval)
|
|
1258
|
+
: isSet(object.time_interval)
|
|
1259
|
+
? analyticsTimeIntervalFromJSON(object.time_interval)
|
|
1260
|
+
: 0,
|
|
1261
|
+
};
|
|
1262
|
+
},
|
|
1263
|
+
|
|
1264
|
+
toJSON(message: SumQueryRequest): unknown {
|
|
1265
|
+
const obj: any = {};
|
|
1266
|
+
if (message.organizationId !== "") {
|
|
1267
|
+
obj.organizationId = message.organizationId;
|
|
1268
|
+
}
|
|
1269
|
+
if (message.projectId !== "") {
|
|
1270
|
+
obj.projectId = message.projectId;
|
|
1271
|
+
}
|
|
1272
|
+
if (message.metricName !== "") {
|
|
1273
|
+
obj.metricName = message.metricName;
|
|
1274
|
+
}
|
|
1275
|
+
if (message.aggregation !== 0) {
|
|
1276
|
+
obj.aggregation = sumAggregationToJSON(message.aggregation);
|
|
1277
|
+
}
|
|
1278
|
+
if (message.timeWindow !== 0) {
|
|
1279
|
+
obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
|
|
1280
|
+
}
|
|
1281
|
+
if (message.timeInterval !== 0) {
|
|
1282
|
+
obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
|
|
1283
|
+
}
|
|
1284
|
+
return obj;
|
|
1285
|
+
},
|
|
1286
|
+
|
|
1287
|
+
create<I extends Exact<DeepPartial<SumQueryRequest>, I>>(base?: I): SumQueryRequest {
|
|
1288
|
+
return SumQueryRequest.fromPartial(base ?? ({} as any));
|
|
1289
|
+
},
|
|
1290
|
+
fromPartial<I extends Exact<DeepPartial<SumQueryRequest>, I>>(object: I): SumQueryRequest {
|
|
1291
|
+
const message = createBaseSumQueryRequest();
|
|
1292
|
+
message.organizationId = object.organizationId ?? "";
|
|
1293
|
+
message.projectId = object.projectId ?? "";
|
|
1294
|
+
message.metricName = object.metricName ?? "";
|
|
1295
|
+
message.aggregation = object.aggregation ?? 0;
|
|
1296
|
+
message.timeWindow = object.timeWindow ?? 0;
|
|
1297
|
+
message.timeInterval = object.timeInterval ?? 0;
|
|
1298
|
+
return message;
|
|
1299
|
+
},
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
function createBaseHistogramQueryRequest(): HistogramQueryRequest {
|
|
1303
|
+
return {
|
|
1304
|
+
organizationId: "",
|
|
1305
|
+
projectId: "",
|
|
1306
|
+
metricName: "",
|
|
1307
|
+
aggregation: 0,
|
|
1308
|
+
quantile: 0,
|
|
1309
|
+
timeWindow: 0,
|
|
1310
|
+
timeInterval: 0,
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
export const HistogramQueryRequest: MessageFns<HistogramQueryRequest> = {
|
|
1315
|
+
encode(message: HistogramQueryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1316
|
+
if (message.organizationId !== "") {
|
|
1317
|
+
writer.uint32(10).string(message.organizationId);
|
|
1318
|
+
}
|
|
1319
|
+
if (message.projectId !== "") {
|
|
1320
|
+
writer.uint32(18).string(message.projectId);
|
|
1321
|
+
}
|
|
1322
|
+
if (message.metricName !== "") {
|
|
1323
|
+
writer.uint32(26).string(message.metricName);
|
|
1324
|
+
}
|
|
1325
|
+
if (message.aggregation !== 0) {
|
|
1326
|
+
writer.uint32(32).int32(message.aggregation);
|
|
1327
|
+
}
|
|
1328
|
+
if (message.quantile !== 0) {
|
|
1329
|
+
writer.uint32(41).double(message.quantile);
|
|
1330
|
+
}
|
|
1331
|
+
if (message.timeWindow !== 0) {
|
|
1332
|
+
writer.uint32(48).int32(message.timeWindow);
|
|
1333
|
+
}
|
|
1334
|
+
if (message.timeInterval !== 0) {
|
|
1335
|
+
writer.uint32(56).int32(message.timeInterval);
|
|
1336
|
+
}
|
|
1337
|
+
return writer;
|
|
1338
|
+
},
|
|
1339
|
+
|
|
1340
|
+
decode(input: BinaryReader | Uint8Array, length?: number): HistogramQueryRequest {
|
|
1341
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1342
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1343
|
+
const message = createBaseHistogramQueryRequest();
|
|
1344
|
+
while (reader.pos < end) {
|
|
1345
|
+
const tag = reader.uint32();
|
|
1346
|
+
switch (tag >>> 3) {
|
|
1347
|
+
case 1: {
|
|
1348
|
+
if (tag !== 10) {
|
|
1349
|
+
break;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
message.organizationId = reader.string();
|
|
1353
|
+
continue;
|
|
1354
|
+
}
|
|
1355
|
+
case 2: {
|
|
1356
|
+
if (tag !== 18) {
|
|
1357
|
+
break;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
message.projectId = reader.string();
|
|
1361
|
+
continue;
|
|
1362
|
+
}
|
|
1363
|
+
case 3: {
|
|
1364
|
+
if (tag !== 26) {
|
|
1365
|
+
break;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
message.metricName = reader.string();
|
|
1369
|
+
continue;
|
|
1370
|
+
}
|
|
1371
|
+
case 4: {
|
|
1372
|
+
if (tag !== 32) {
|
|
1373
|
+
break;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
message.aggregation = reader.int32() as any;
|
|
1377
|
+
continue;
|
|
1378
|
+
}
|
|
1379
|
+
case 5: {
|
|
1380
|
+
if (tag !== 41) {
|
|
1381
|
+
break;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
message.quantile = reader.double();
|
|
1385
|
+
continue;
|
|
1386
|
+
}
|
|
1387
|
+
case 6: {
|
|
1388
|
+
if (tag !== 48) {
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
message.timeWindow = reader.int32() as any;
|
|
1393
|
+
continue;
|
|
1394
|
+
}
|
|
1395
|
+
case 7: {
|
|
1396
|
+
if (tag !== 56) {
|
|
1397
|
+
break;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
message.timeInterval = reader.int32() as any;
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1405
|
+
break;
|
|
1406
|
+
}
|
|
1407
|
+
reader.skip(tag & 7);
|
|
1408
|
+
}
|
|
1409
|
+
return message;
|
|
1410
|
+
},
|
|
1411
|
+
|
|
1412
|
+
fromJSON(object: any): HistogramQueryRequest {
|
|
1413
|
+
return {
|
|
1414
|
+
organizationId: isSet(object.organizationId)
|
|
1415
|
+
? globalThis.String(object.organizationId)
|
|
1416
|
+
: isSet(object.organization_id)
|
|
1417
|
+
? globalThis.String(object.organization_id)
|
|
1418
|
+
: "",
|
|
1419
|
+
projectId: isSet(object.projectId)
|
|
1420
|
+
? globalThis.String(object.projectId)
|
|
1421
|
+
: isSet(object.project_id)
|
|
1422
|
+
? globalThis.String(object.project_id)
|
|
1423
|
+
: "",
|
|
1424
|
+
metricName: isSet(object.metricName)
|
|
1425
|
+
? globalThis.String(object.metricName)
|
|
1426
|
+
: isSet(object.metric_name)
|
|
1427
|
+
? globalThis.String(object.metric_name)
|
|
1428
|
+
: "",
|
|
1429
|
+
aggregation: isSet(object.aggregation) ? histogramAggregationFromJSON(object.aggregation) : 0,
|
|
1430
|
+
quantile: isSet(object.quantile) ? globalThis.Number(object.quantile) : 0,
|
|
1431
|
+
timeWindow: isSet(object.timeWindow)
|
|
1432
|
+
? analyticsTimeWindowFromJSON(object.timeWindow)
|
|
1433
|
+
: isSet(object.time_window)
|
|
1434
|
+
? analyticsTimeWindowFromJSON(object.time_window)
|
|
1435
|
+
: 0,
|
|
1436
|
+
timeInterval: isSet(object.timeInterval)
|
|
1437
|
+
? analyticsTimeIntervalFromJSON(object.timeInterval)
|
|
1438
|
+
: isSet(object.time_interval)
|
|
1439
|
+
? analyticsTimeIntervalFromJSON(object.time_interval)
|
|
1440
|
+
: 0,
|
|
1441
|
+
};
|
|
1442
|
+
},
|
|
1443
|
+
|
|
1444
|
+
toJSON(message: HistogramQueryRequest): unknown {
|
|
1445
|
+
const obj: any = {};
|
|
1446
|
+
if (message.organizationId !== "") {
|
|
1447
|
+
obj.organizationId = message.organizationId;
|
|
1448
|
+
}
|
|
1449
|
+
if (message.projectId !== "") {
|
|
1450
|
+
obj.projectId = message.projectId;
|
|
1451
|
+
}
|
|
1452
|
+
if (message.metricName !== "") {
|
|
1453
|
+
obj.metricName = message.metricName;
|
|
1454
|
+
}
|
|
1455
|
+
if (message.aggregation !== 0) {
|
|
1456
|
+
obj.aggregation = histogramAggregationToJSON(message.aggregation);
|
|
1457
|
+
}
|
|
1458
|
+
if (message.quantile !== 0) {
|
|
1459
|
+
obj.quantile = message.quantile;
|
|
1460
|
+
}
|
|
1461
|
+
if (message.timeWindow !== 0) {
|
|
1462
|
+
obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
|
|
1463
|
+
}
|
|
1464
|
+
if (message.timeInterval !== 0) {
|
|
1465
|
+
obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
|
|
1466
|
+
}
|
|
1467
|
+
return obj;
|
|
1468
|
+
},
|
|
1469
|
+
|
|
1470
|
+
create<I extends Exact<DeepPartial<HistogramQueryRequest>, I>>(base?: I): HistogramQueryRequest {
|
|
1471
|
+
return HistogramQueryRequest.fromPartial(base ?? ({} as any));
|
|
1472
|
+
},
|
|
1473
|
+
fromPartial<I extends Exact<DeepPartial<HistogramQueryRequest>, I>>(object: I): HistogramQueryRequest {
|
|
1474
|
+
const message = createBaseHistogramQueryRequest();
|
|
1475
|
+
message.organizationId = object.organizationId ?? "";
|
|
1476
|
+
message.projectId = object.projectId ?? "";
|
|
1477
|
+
message.metricName = object.metricName ?? "";
|
|
1478
|
+
message.aggregation = object.aggregation ?? 0;
|
|
1479
|
+
message.quantile = object.quantile ?? 0;
|
|
1480
|
+
message.timeWindow = object.timeWindow ?? 0;
|
|
1481
|
+
message.timeInterval = object.timeInterval ?? 0;
|
|
1482
|
+
return message;
|
|
1483
|
+
},
|
|
1484
|
+
};
|
|
1485
|
+
|
|
1486
|
+
function createBaseMetricAnalyticsEnvelope(): MetricAnalyticsEnvelope {
|
|
1487
|
+
return { snapshot: undefined, bucketUpdate: undefined };
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
export const MetricAnalyticsEnvelope: MessageFns<MetricAnalyticsEnvelope> = {
|
|
1491
|
+
encode(message: MetricAnalyticsEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1492
|
+
if (message.snapshot !== undefined) {
|
|
1493
|
+
MetricAnalyticsSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
|
|
1494
|
+
}
|
|
1495
|
+
if (message.bucketUpdate !== undefined) {
|
|
1496
|
+
MetricSeriesBucketUpdate.encode(message.bucketUpdate, writer.uint32(18).fork()).join();
|
|
1497
|
+
}
|
|
1498
|
+
return writer;
|
|
1499
|
+
},
|
|
1500
|
+
|
|
1501
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricAnalyticsEnvelope {
|
|
1502
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1503
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1504
|
+
const message = createBaseMetricAnalyticsEnvelope();
|
|
1505
|
+
while (reader.pos < end) {
|
|
1506
|
+
const tag = reader.uint32();
|
|
1507
|
+
switch (tag >>> 3) {
|
|
1508
|
+
case 1: {
|
|
1509
|
+
if (tag !== 10) {
|
|
1510
|
+
break;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
message.snapshot = MetricAnalyticsSnapshot.decode(reader, reader.uint32());
|
|
1514
|
+
continue;
|
|
1515
|
+
}
|
|
1516
|
+
case 2: {
|
|
1517
|
+
if (tag !== 18) {
|
|
1518
|
+
break;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
message.bucketUpdate = MetricSeriesBucketUpdate.decode(reader, reader.uint32());
|
|
1522
|
+
continue;
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1526
|
+
break;
|
|
1527
|
+
}
|
|
1528
|
+
reader.skip(tag & 7);
|
|
1529
|
+
}
|
|
1530
|
+
return message;
|
|
1531
|
+
},
|
|
1532
|
+
|
|
1533
|
+
fromJSON(object: any): MetricAnalyticsEnvelope {
|
|
1534
|
+
return {
|
|
1535
|
+
snapshot: isSet(object.snapshot) ? MetricAnalyticsSnapshot.fromJSON(object.snapshot) : undefined,
|
|
1536
|
+
bucketUpdate: isSet(object.bucketUpdate)
|
|
1537
|
+
? MetricSeriesBucketUpdate.fromJSON(object.bucketUpdate)
|
|
1538
|
+
: isSet(object.bucket_update)
|
|
1539
|
+
? MetricSeriesBucketUpdate.fromJSON(object.bucket_update)
|
|
1540
|
+
: undefined,
|
|
1541
|
+
};
|
|
1542
|
+
},
|
|
1543
|
+
|
|
1544
|
+
toJSON(message: MetricAnalyticsEnvelope): unknown {
|
|
1545
|
+
const obj: any = {};
|
|
1546
|
+
if (message.snapshot !== undefined) {
|
|
1547
|
+
obj.snapshot = MetricAnalyticsSnapshot.toJSON(message.snapshot);
|
|
1548
|
+
}
|
|
1549
|
+
if (message.bucketUpdate !== undefined) {
|
|
1550
|
+
obj.bucketUpdate = MetricSeriesBucketUpdate.toJSON(message.bucketUpdate);
|
|
1551
|
+
}
|
|
1552
|
+
return obj;
|
|
1553
|
+
},
|
|
1554
|
+
|
|
1555
|
+
create<I extends Exact<DeepPartial<MetricAnalyticsEnvelope>, I>>(base?: I): MetricAnalyticsEnvelope {
|
|
1556
|
+
return MetricAnalyticsEnvelope.fromPartial(base ?? ({} as any));
|
|
1557
|
+
},
|
|
1558
|
+
fromPartial<I extends Exact<DeepPartial<MetricAnalyticsEnvelope>, I>>(object: I): MetricAnalyticsEnvelope {
|
|
1559
|
+
const message = createBaseMetricAnalyticsEnvelope();
|
|
1560
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
1561
|
+
? MetricAnalyticsSnapshot.fromPartial(object.snapshot)
|
|
1562
|
+
: undefined;
|
|
1563
|
+
message.bucketUpdate = (object.bucketUpdate !== undefined && object.bucketUpdate !== null)
|
|
1564
|
+
? MetricSeriesBucketUpdate.fromPartial(object.bucketUpdate)
|
|
1565
|
+
: undefined;
|
|
1566
|
+
return message;
|
|
1567
|
+
},
|
|
1568
|
+
};
|
|
1569
|
+
|
|
1570
|
+
function createBaseMetricAnalyticsSnapshot(): MetricAnalyticsSnapshot {
|
|
1571
|
+
return {
|
|
1572
|
+
series: [],
|
|
1573
|
+
windowStart: undefined,
|
|
1574
|
+
windowEnd: undefined,
|
|
1575
|
+
bucketSizeMs: 0,
|
|
1576
|
+
expectedBucketCount: 0,
|
|
1577
|
+
unit: "",
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
export const MetricAnalyticsSnapshot: MessageFns<MetricAnalyticsSnapshot> = {
|
|
1582
|
+
encode(message: MetricAnalyticsSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1583
|
+
for (const v of message.series) {
|
|
1584
|
+
MetricSeries.encode(v!, writer.uint32(10).fork()).join();
|
|
1585
|
+
}
|
|
1586
|
+
if (message.windowStart !== undefined) {
|
|
1587
|
+
Timestamp.encode(toTimestamp(message.windowStart), writer.uint32(18).fork()).join();
|
|
1588
|
+
}
|
|
1589
|
+
if (message.windowEnd !== undefined) {
|
|
1590
|
+
Timestamp.encode(toTimestamp(message.windowEnd), writer.uint32(26).fork()).join();
|
|
1591
|
+
}
|
|
1592
|
+
if (message.bucketSizeMs !== 0) {
|
|
1593
|
+
writer.uint32(32).int64(message.bucketSizeMs);
|
|
1594
|
+
}
|
|
1595
|
+
if (message.expectedBucketCount !== 0) {
|
|
1596
|
+
writer.uint32(40).int32(message.expectedBucketCount);
|
|
1597
|
+
}
|
|
1598
|
+
if (message.unit !== "") {
|
|
1599
|
+
writer.uint32(50).string(message.unit);
|
|
1600
|
+
}
|
|
1601
|
+
return writer;
|
|
1602
|
+
},
|
|
1603
|
+
|
|
1604
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricAnalyticsSnapshot {
|
|
1605
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1606
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1607
|
+
const message = createBaseMetricAnalyticsSnapshot();
|
|
1608
|
+
while (reader.pos < end) {
|
|
1609
|
+
const tag = reader.uint32();
|
|
1610
|
+
switch (tag >>> 3) {
|
|
1611
|
+
case 1: {
|
|
1612
|
+
if (tag !== 10) {
|
|
1613
|
+
break;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
message.series.push(MetricSeries.decode(reader, reader.uint32()));
|
|
1617
|
+
continue;
|
|
1618
|
+
}
|
|
1619
|
+
case 2: {
|
|
1620
|
+
if (tag !== 18) {
|
|
1621
|
+
break;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
message.windowStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1625
|
+
continue;
|
|
1626
|
+
}
|
|
1627
|
+
case 3: {
|
|
1628
|
+
if (tag !== 26) {
|
|
1629
|
+
break;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
message.windowEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1633
|
+
continue;
|
|
1634
|
+
}
|
|
1635
|
+
case 4: {
|
|
1636
|
+
if (tag !== 32) {
|
|
1637
|
+
break;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
message.bucketSizeMs = longToNumber(reader.int64());
|
|
1641
|
+
continue;
|
|
1642
|
+
}
|
|
1643
|
+
case 5: {
|
|
1644
|
+
if (tag !== 40) {
|
|
1645
|
+
break;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
message.expectedBucketCount = reader.int32();
|
|
1649
|
+
continue;
|
|
1650
|
+
}
|
|
1651
|
+
case 6: {
|
|
1652
|
+
if (tag !== 50) {
|
|
1653
|
+
break;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
message.unit = reader.string();
|
|
1657
|
+
continue;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1661
|
+
break;
|
|
1662
|
+
}
|
|
1663
|
+
reader.skip(tag & 7);
|
|
1664
|
+
}
|
|
1665
|
+
return message;
|
|
1666
|
+
},
|
|
1667
|
+
|
|
1668
|
+
fromJSON(object: any): MetricAnalyticsSnapshot {
|
|
1669
|
+
return {
|
|
1670
|
+
series: globalThis.Array.isArray(object?.series) ? object.series.map((e: any) => MetricSeries.fromJSON(e)) : [],
|
|
1671
|
+
windowStart: isSet(object.windowStart)
|
|
1672
|
+
? fromJsonTimestamp(object.windowStart)
|
|
1673
|
+
: isSet(object.window_start)
|
|
1674
|
+
? fromJsonTimestamp(object.window_start)
|
|
1675
|
+
: undefined,
|
|
1676
|
+
windowEnd: isSet(object.windowEnd)
|
|
1677
|
+
? fromJsonTimestamp(object.windowEnd)
|
|
1678
|
+
: isSet(object.window_end)
|
|
1679
|
+
? fromJsonTimestamp(object.window_end)
|
|
1680
|
+
: undefined,
|
|
1681
|
+
bucketSizeMs: isSet(object.bucketSizeMs)
|
|
1682
|
+
? globalThis.Number(object.bucketSizeMs)
|
|
1683
|
+
: isSet(object.bucket_size_ms)
|
|
1684
|
+
? globalThis.Number(object.bucket_size_ms)
|
|
1685
|
+
: 0,
|
|
1686
|
+
expectedBucketCount: isSet(object.expectedBucketCount)
|
|
1687
|
+
? globalThis.Number(object.expectedBucketCount)
|
|
1688
|
+
: isSet(object.expected_bucket_count)
|
|
1689
|
+
? globalThis.Number(object.expected_bucket_count)
|
|
1690
|
+
: 0,
|
|
1691
|
+
unit: isSet(object.unit) ? globalThis.String(object.unit) : "",
|
|
1692
|
+
};
|
|
1693
|
+
},
|
|
1694
|
+
|
|
1695
|
+
toJSON(message: MetricAnalyticsSnapshot): unknown {
|
|
1696
|
+
const obj: any = {};
|
|
1697
|
+
if (message.series?.length) {
|
|
1698
|
+
obj.series = message.series.map((e) => MetricSeries.toJSON(e));
|
|
1699
|
+
}
|
|
1700
|
+
if (message.windowStart !== undefined) {
|
|
1701
|
+
obj.windowStart = message.windowStart.toISOString();
|
|
1702
|
+
}
|
|
1703
|
+
if (message.windowEnd !== undefined) {
|
|
1704
|
+
obj.windowEnd = message.windowEnd.toISOString();
|
|
1705
|
+
}
|
|
1706
|
+
if (message.bucketSizeMs !== 0) {
|
|
1707
|
+
obj.bucketSizeMs = Math.round(message.bucketSizeMs);
|
|
1708
|
+
}
|
|
1709
|
+
if (message.expectedBucketCount !== 0) {
|
|
1710
|
+
obj.expectedBucketCount = Math.round(message.expectedBucketCount);
|
|
1711
|
+
}
|
|
1712
|
+
if (message.unit !== "") {
|
|
1713
|
+
obj.unit = message.unit;
|
|
1714
|
+
}
|
|
1715
|
+
return obj;
|
|
1716
|
+
},
|
|
1717
|
+
|
|
1718
|
+
create<I extends Exact<DeepPartial<MetricAnalyticsSnapshot>, I>>(base?: I): MetricAnalyticsSnapshot {
|
|
1719
|
+
return MetricAnalyticsSnapshot.fromPartial(base ?? ({} as any));
|
|
1720
|
+
},
|
|
1721
|
+
fromPartial<I extends Exact<DeepPartial<MetricAnalyticsSnapshot>, I>>(object: I): MetricAnalyticsSnapshot {
|
|
1722
|
+
const message = createBaseMetricAnalyticsSnapshot();
|
|
1723
|
+
message.series = object.series?.map((e) => MetricSeries.fromPartial(e)) || [];
|
|
1724
|
+
message.windowStart = object.windowStart ?? undefined;
|
|
1725
|
+
message.windowEnd = object.windowEnd ?? undefined;
|
|
1726
|
+
message.bucketSizeMs = object.bucketSizeMs ?? 0;
|
|
1727
|
+
message.expectedBucketCount = object.expectedBucketCount ?? 0;
|
|
1728
|
+
message.unit = object.unit ?? "";
|
|
1729
|
+
return message;
|
|
1730
|
+
},
|
|
1731
|
+
};
|
|
1732
|
+
|
|
1733
|
+
function createBaseMetricSeries(): MetricSeries {
|
|
1734
|
+
return { buckets: [] };
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
export const MetricSeries: MessageFns<MetricSeries> = {
|
|
1738
|
+
encode(message: MetricSeries, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1739
|
+
for (const v of message.buckets) {
|
|
1740
|
+
MetricBucket.encode(v!, writer.uint32(10).fork()).join();
|
|
1741
|
+
}
|
|
1742
|
+
return writer;
|
|
1743
|
+
},
|
|
1744
|
+
|
|
1745
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricSeries {
|
|
1746
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1747
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1748
|
+
const message = createBaseMetricSeries();
|
|
1749
|
+
while (reader.pos < end) {
|
|
1750
|
+
const tag = reader.uint32();
|
|
1751
|
+
switch (tag >>> 3) {
|
|
1752
|
+
case 1: {
|
|
1753
|
+
if (tag !== 10) {
|
|
1754
|
+
break;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
message.buckets.push(MetricBucket.decode(reader, reader.uint32()));
|
|
1758
|
+
continue;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1762
|
+
break;
|
|
1763
|
+
}
|
|
1764
|
+
reader.skip(tag & 7);
|
|
1765
|
+
}
|
|
1766
|
+
return message;
|
|
1767
|
+
},
|
|
1768
|
+
|
|
1769
|
+
fromJSON(object: any): MetricSeries {
|
|
1770
|
+
return {
|
|
1771
|
+
buckets: globalThis.Array.isArray(object?.buckets)
|
|
1772
|
+
? object.buckets.map((e: any) => MetricBucket.fromJSON(e))
|
|
1773
|
+
: [],
|
|
1774
|
+
};
|
|
1775
|
+
},
|
|
1776
|
+
|
|
1777
|
+
toJSON(message: MetricSeries): unknown {
|
|
1778
|
+
const obj: any = {};
|
|
1779
|
+
if (message.buckets?.length) {
|
|
1780
|
+
obj.buckets = message.buckets.map((e) => MetricBucket.toJSON(e));
|
|
1781
|
+
}
|
|
1782
|
+
return obj;
|
|
1783
|
+
},
|
|
1784
|
+
|
|
1785
|
+
create<I extends Exact<DeepPartial<MetricSeries>, I>>(base?: I): MetricSeries {
|
|
1786
|
+
return MetricSeries.fromPartial(base ?? ({} as any));
|
|
1787
|
+
},
|
|
1788
|
+
fromPartial<I extends Exact<DeepPartial<MetricSeries>, I>>(object: I): MetricSeries {
|
|
1789
|
+
const message = createBaseMetricSeries();
|
|
1790
|
+
message.buckets = object.buckets?.map((e) => MetricBucket.fromPartial(e)) || [];
|
|
1791
|
+
return message;
|
|
1792
|
+
},
|
|
1793
|
+
};
|
|
1794
|
+
|
|
1795
|
+
function createBaseMetricBucket(): MetricBucket {
|
|
1796
|
+
return { bucketStart: undefined, value: 0 };
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
export const MetricBucket: MessageFns<MetricBucket> = {
|
|
1800
|
+
encode(message: MetricBucket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1801
|
+
if (message.bucketStart !== undefined) {
|
|
1802
|
+
Timestamp.encode(toTimestamp(message.bucketStart), writer.uint32(10).fork()).join();
|
|
1803
|
+
}
|
|
1804
|
+
if (message.value !== 0) {
|
|
1805
|
+
writer.uint32(17).double(message.value);
|
|
1806
|
+
}
|
|
1807
|
+
return writer;
|
|
1808
|
+
},
|
|
1809
|
+
|
|
1810
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricBucket {
|
|
1811
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1812
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1813
|
+
const message = createBaseMetricBucket();
|
|
1814
|
+
while (reader.pos < end) {
|
|
1815
|
+
const tag = reader.uint32();
|
|
1816
|
+
switch (tag >>> 3) {
|
|
1817
|
+
case 1: {
|
|
1818
|
+
if (tag !== 10) {
|
|
1819
|
+
break;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
message.bucketStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1823
|
+
continue;
|
|
1824
|
+
}
|
|
1825
|
+
case 2: {
|
|
1826
|
+
if (tag !== 17) {
|
|
1827
|
+
break;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
message.value = reader.double();
|
|
1831
|
+
continue;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1835
|
+
break;
|
|
1836
|
+
}
|
|
1837
|
+
reader.skip(tag & 7);
|
|
1838
|
+
}
|
|
1839
|
+
return message;
|
|
1840
|
+
},
|
|
1841
|
+
|
|
1842
|
+
fromJSON(object: any): MetricBucket {
|
|
1843
|
+
return {
|
|
1844
|
+
bucketStart: isSet(object.bucketStart)
|
|
1845
|
+
? fromJsonTimestamp(object.bucketStart)
|
|
1846
|
+
: isSet(object.bucket_start)
|
|
1847
|
+
? fromJsonTimestamp(object.bucket_start)
|
|
1848
|
+
: undefined,
|
|
1849
|
+
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
|
1850
|
+
};
|
|
1851
|
+
},
|
|
1852
|
+
|
|
1853
|
+
toJSON(message: MetricBucket): unknown {
|
|
1854
|
+
const obj: any = {};
|
|
1855
|
+
if (message.bucketStart !== undefined) {
|
|
1856
|
+
obj.bucketStart = message.bucketStart.toISOString();
|
|
1857
|
+
}
|
|
1858
|
+
if (message.value !== 0) {
|
|
1859
|
+
obj.value = message.value;
|
|
1860
|
+
}
|
|
1861
|
+
return obj;
|
|
1862
|
+
},
|
|
1863
|
+
|
|
1864
|
+
create<I extends Exact<DeepPartial<MetricBucket>, I>>(base?: I): MetricBucket {
|
|
1865
|
+
return MetricBucket.fromPartial(base ?? ({} as any));
|
|
1866
|
+
},
|
|
1867
|
+
fromPartial<I extends Exact<DeepPartial<MetricBucket>, I>>(object: I): MetricBucket {
|
|
1868
|
+
const message = createBaseMetricBucket();
|
|
1869
|
+
message.bucketStart = object.bucketStart ?? undefined;
|
|
1870
|
+
message.value = object.value ?? 0;
|
|
1871
|
+
return message;
|
|
1872
|
+
},
|
|
1873
|
+
};
|
|
1874
|
+
|
|
1875
|
+
function createBaseMetricSeriesBucketUpdate(): MetricSeriesBucketUpdate {
|
|
1876
|
+
return { bucket: undefined, generatedAt: undefined };
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
export const MetricSeriesBucketUpdate: MessageFns<MetricSeriesBucketUpdate> = {
|
|
1880
|
+
encode(message: MetricSeriesBucketUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1881
|
+
if (message.bucket !== undefined) {
|
|
1882
|
+
MetricBucket.encode(message.bucket, writer.uint32(10).fork()).join();
|
|
1883
|
+
}
|
|
1884
|
+
if (message.generatedAt !== undefined) {
|
|
1885
|
+
Timestamp.encode(toTimestamp(message.generatedAt), writer.uint32(18).fork()).join();
|
|
1886
|
+
}
|
|
1887
|
+
return writer;
|
|
1888
|
+
},
|
|
1889
|
+
|
|
1890
|
+
decode(input: BinaryReader | Uint8Array, length?: number): MetricSeriesBucketUpdate {
|
|
1891
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1892
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1893
|
+
const message = createBaseMetricSeriesBucketUpdate();
|
|
1894
|
+
while (reader.pos < end) {
|
|
1895
|
+
const tag = reader.uint32();
|
|
1896
|
+
switch (tag >>> 3) {
|
|
1897
|
+
case 1: {
|
|
1898
|
+
if (tag !== 10) {
|
|
1899
|
+
break;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
message.bucket = MetricBucket.decode(reader, reader.uint32());
|
|
1903
|
+
continue;
|
|
1904
|
+
}
|
|
1905
|
+
case 2: {
|
|
1906
|
+
if (tag !== 18) {
|
|
1907
|
+
break;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
message.generatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1911
|
+
continue;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1915
|
+
break;
|
|
1916
|
+
}
|
|
1917
|
+
reader.skip(tag & 7);
|
|
1918
|
+
}
|
|
1919
|
+
return message;
|
|
1920
|
+
},
|
|
1921
|
+
|
|
1922
|
+
fromJSON(object: any): MetricSeriesBucketUpdate {
|
|
1923
|
+
return {
|
|
1924
|
+
bucket: isSet(object.bucket) ? MetricBucket.fromJSON(object.bucket) : undefined,
|
|
1925
|
+
generatedAt: isSet(object.generatedAt)
|
|
1926
|
+
? fromJsonTimestamp(object.generatedAt)
|
|
1927
|
+
: isSet(object.generated_at)
|
|
1928
|
+
? fromJsonTimestamp(object.generated_at)
|
|
1929
|
+
: undefined,
|
|
1930
|
+
};
|
|
1931
|
+
},
|
|
1932
|
+
|
|
1933
|
+
toJSON(message: MetricSeriesBucketUpdate): unknown {
|
|
1934
|
+
const obj: any = {};
|
|
1935
|
+
if (message.bucket !== undefined) {
|
|
1936
|
+
obj.bucket = MetricBucket.toJSON(message.bucket);
|
|
1937
|
+
}
|
|
1938
|
+
if (message.generatedAt !== undefined) {
|
|
1939
|
+
obj.generatedAt = message.generatedAt.toISOString();
|
|
1940
|
+
}
|
|
1941
|
+
return obj;
|
|
1942
|
+
},
|
|
1943
|
+
|
|
1944
|
+
create<I extends Exact<DeepPartial<MetricSeriesBucketUpdate>, I>>(base?: I): MetricSeriesBucketUpdate {
|
|
1945
|
+
return MetricSeriesBucketUpdate.fromPartial(base ?? ({} as any));
|
|
1946
|
+
},
|
|
1947
|
+
fromPartial<I extends Exact<DeepPartial<MetricSeriesBucketUpdate>, I>>(object: I): MetricSeriesBucketUpdate {
|
|
1948
|
+
const message = createBaseMetricSeriesBucketUpdate();
|
|
1949
|
+
message.bucket = (object.bucket !== undefined && object.bucket !== null)
|
|
1950
|
+
? MetricBucket.fromPartial(object.bucket)
|
|
1951
|
+
: undefined;
|
|
1952
|
+
message.generatedAt = object.generatedAt ?? undefined;
|
|
1953
|
+
return message;
|
|
1954
|
+
},
|
|
1955
|
+
};
|
|
1956
|
+
|
|
1957
|
+
/**
|
|
1958
|
+
* TelemetryGatewayService is the web surface of telemetry.api.v1 — the types
|
|
1959
|
+
* are domain-isolated copies converted in gateways/internal/convert. Every RPC
|
|
1960
|
+
* is a server stream (snapshot first, then live updates), split by metric kind.
|
|
1961
|
+
*/
|
|
1962
|
+
export interface TelemetryGatewayService {
|
|
1963
|
+
StreamMetrics(request: StreamMetricsRequest, metadata?: Metadata): Observable<MetricCatalogEnvelope>;
|
|
1964
|
+
StreamMetricAttributes(
|
|
1965
|
+
request: StreamMetricAttributesRequest,
|
|
1966
|
+
metadata?: Metadata,
|
|
1967
|
+
): Observable<MetricAttributeEnvelope>;
|
|
1968
|
+
StreamGaugeAnalytics(request: GaugeQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope>;
|
|
1969
|
+
StreamSumAnalytics(request: SumQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope>;
|
|
1970
|
+
StreamHistogramAnalytics(request: HistogramQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope>;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
export const TelemetryGatewayServiceServiceName = "gateway.web.v1.TelemetryGatewayService";
|
|
1974
|
+
export class TelemetryGatewayServiceClientImpl implements TelemetryGatewayService {
|
|
1975
|
+
private readonly rpc: Rpc;
|
|
1976
|
+
private readonly service: string;
|
|
1977
|
+
constructor(rpc: Rpc, opts?: { service?: string }) {
|
|
1978
|
+
this.service = opts?.service || TelemetryGatewayServiceServiceName;
|
|
1979
|
+
this.rpc = rpc;
|
|
1980
|
+
this.StreamMetrics = this.StreamMetrics.bind(this);
|
|
1981
|
+
this.StreamMetricAttributes = this.StreamMetricAttributes.bind(this);
|
|
1982
|
+
this.StreamGaugeAnalytics = this.StreamGaugeAnalytics.bind(this);
|
|
1983
|
+
this.StreamSumAnalytics = this.StreamSumAnalytics.bind(this);
|
|
1984
|
+
this.StreamHistogramAnalytics = this.StreamHistogramAnalytics.bind(this);
|
|
1985
|
+
}
|
|
1986
|
+
StreamMetrics(request: StreamMetricsRequest, metadata?: Metadata): Observable<MetricCatalogEnvelope> {
|
|
1987
|
+
const data = StreamMetricsRequest.encode(request).finish();
|
|
1988
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamMetrics", data, metadata);
|
|
1989
|
+
return result.pipe(map((data) => MetricCatalogEnvelope.decode(new BinaryReader(data))));
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
StreamMetricAttributes(
|
|
1993
|
+
request: StreamMetricAttributesRequest,
|
|
1994
|
+
metadata?: Metadata,
|
|
1995
|
+
): Observable<MetricAttributeEnvelope> {
|
|
1996
|
+
const data = StreamMetricAttributesRequest.encode(request).finish();
|
|
1997
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamMetricAttributes", data, metadata);
|
|
1998
|
+
return result.pipe(map((data) => MetricAttributeEnvelope.decode(new BinaryReader(data))));
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
StreamGaugeAnalytics(request: GaugeQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope> {
|
|
2002
|
+
const data = GaugeQueryRequest.encode(request).finish();
|
|
2003
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamGaugeAnalytics", data, metadata);
|
|
2004
|
+
return result.pipe(map((data) => MetricAnalyticsEnvelope.decode(new BinaryReader(data))));
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
StreamSumAnalytics(request: SumQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope> {
|
|
2008
|
+
const data = SumQueryRequest.encode(request).finish();
|
|
2009
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamSumAnalytics", data, metadata);
|
|
2010
|
+
return result.pipe(map((data) => MetricAnalyticsEnvelope.decode(new BinaryReader(data))));
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
StreamHistogramAnalytics(request: HistogramQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope> {
|
|
2014
|
+
const data = HistogramQueryRequest.encode(request).finish();
|
|
2015
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamHistogramAnalytics", data, metadata);
|
|
2016
|
+
return result.pipe(map((data) => MetricAnalyticsEnvelope.decode(new BinaryReader(data))));
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
interface Rpc {
|
|
2021
|
+
request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
|
|
2022
|
+
clientStreamingRequest(
|
|
2023
|
+
service: string,
|
|
2024
|
+
method: string,
|
|
2025
|
+
data: Observable<Uint8Array>,
|
|
2026
|
+
metadata?: Metadata,
|
|
2027
|
+
): Promise<Uint8Array>;
|
|
2028
|
+
serverStreamingRequest(
|
|
2029
|
+
service: string,
|
|
2030
|
+
method: string,
|
|
2031
|
+
data: Uint8Array,
|
|
2032
|
+
metadata?: Metadata,
|
|
2033
|
+
): Observable<Uint8Array>;
|
|
2034
|
+
bidirectionalStreamingRequest(
|
|
2035
|
+
service: string,
|
|
2036
|
+
method: string,
|
|
2037
|
+
data: Observable<Uint8Array>,
|
|
2038
|
+
metadata?: Metadata,
|
|
2039
|
+
): Observable<Uint8Array>;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
2043
|
+
|
|
2044
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
2045
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
2046
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
2047
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
2048
|
+
: Partial<T>;
|
|
2049
|
+
|
|
2050
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
2051
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
2052
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
2053
|
+
|
|
2054
|
+
function toTimestamp(date: Date): Timestamp {
|
|
2055
|
+
const seconds = Math.trunc(date.getTime() / 1_000);
|
|
2056
|
+
const nanos = (date.getTime() % 1_000) * 1_000_000;
|
|
2057
|
+
return { seconds, nanos };
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
function fromTimestamp(t: Timestamp): Date {
|
|
2061
|
+
let millis = (t.seconds || 0) * 1_000;
|
|
2062
|
+
millis += (t.nanos || 0) / 1_000_000;
|
|
2063
|
+
return new globalThis.Date(millis);
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
function fromJsonTimestamp(o: any): Date {
|
|
2067
|
+
if (o instanceof globalThis.Date) {
|
|
2068
|
+
return o;
|
|
2069
|
+
} else if (typeof o === "string") {
|
|
2070
|
+
return new globalThis.Date(o);
|
|
2071
|
+
} else {
|
|
2072
|
+
return fromTimestamp(Timestamp.fromJSON(o));
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
function longToNumber(int64: { toString(): string }): number {
|
|
2077
|
+
const num = globalThis.Number(int64.toString());
|
|
2078
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
2079
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
2080
|
+
}
|
|
2081
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
2082
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
2083
|
+
}
|
|
2084
|
+
return num;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
function isSet(value: any): boolean {
|
|
2088
|
+
return value !== null && value !== undefined;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
export interface MessageFns<T> {
|
|
2092
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
2093
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
2094
|
+
fromJSON(object: any): T;
|
|
2095
|
+
toJSON(message: T): unknown;
|
|
2096
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
2097
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
2098
|
+
}
|