@sentio/runtime 2.57.8 → 2.57.9-rc.10

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.
@@ -1499,6 +1499,9 @@ export enum TabularData_ColumnType {
1499
1499
  LIST = 3,
1500
1500
  TIME = 4,
1501
1501
  MAP = 5,
1502
+ JSON = 6,
1503
+ TOKEN = 7,
1504
+ DYNAMIC = 8,
1502
1505
  UNRECOGNIZED = -1,
1503
1506
  }
1504
1507
 
@@ -1522,6 +1525,15 @@ export function tabularData_ColumnTypeFromJSON(object: any): TabularData_ColumnT
1522
1525
  case 5:
1523
1526
  case "MAP":
1524
1527
  return TabularData_ColumnType.MAP;
1528
+ case 6:
1529
+ case "JSON":
1530
+ return TabularData_ColumnType.JSON;
1531
+ case 7:
1532
+ case "TOKEN":
1533
+ return TabularData_ColumnType.TOKEN;
1534
+ case 8:
1535
+ case "DYNAMIC":
1536
+ return TabularData_ColumnType.DYNAMIC;
1525
1537
  case -1:
1526
1538
  case "UNRECOGNIZED":
1527
1539
  default:
@@ -1543,6 +1555,12 @@ export function tabularData_ColumnTypeToJSON(object: TabularData_ColumnType): st
1543
1555
  return "TIME";
1544
1556
  case TabularData_ColumnType.MAP:
1545
1557
  return "MAP";
1558
+ case TabularData_ColumnType.JSON:
1559
+ return "JSON";
1560
+ case TabularData_ColumnType.TOKEN:
1561
+ return "TOKEN";
1562
+ case TabularData_ColumnType.DYNAMIC:
1563
+ return "DYNAMIC";
1546
1564
  case TabularData_ColumnType.UNRECOGNIZED:
1547
1565
  default:
1548
1566
  return "UNRECOGNIZED";
@@ -1922,6 +1940,7 @@ export interface Notification_AttributesEntry {
1922
1940
  export interface RichValue {
1923
1941
  nullValue?: RichValue_NullValue | undefined;
1924
1942
  intValue?: number | undefined;
1943
+ int64Value?: bigint | undefined;
1925
1944
  floatValue?: number | undefined;
1926
1945
  bytesValue?: Uint8Array | undefined;
1927
1946
  boolValue?: boolean | undefined;
@@ -1994,6 +2013,24 @@ export interface TokenAmount {
1994
2013
  specifiedAt: Date | undefined;
1995
2014
  }
1996
2015
 
2016
+ export interface RequestLog {
2017
+ requestId: string;
2018
+ endpointId: string;
2019
+ owner: string;
2020
+ slug: string;
2021
+ statusCode: number;
2022
+ error: string;
2023
+ requestBody: Uint8Array;
2024
+ requestHeader: { [key: string]: any } | undefined;
2025
+ responseBody: Uint8Array;
2026
+ responseHeader: { [key: string]: any } | undefined;
2027
+ createdAt: Date | undefined;
2028
+ duration: bigint;
2029
+ queryDuration: bigint;
2030
+ method: string;
2031
+ rpcNodeId: string;
2032
+ }
2033
+
1997
2034
  function createBaseUsageTracker(): UsageTracker {
1998
2035
  return {
1999
2036
  apiSku: "",
@@ -13214,6 +13251,7 @@ function createBaseRichValue(): RichValue {
13214
13251
  return {
13215
13252
  nullValue: undefined,
13216
13253
  intValue: undefined,
13254
+ int64Value: undefined,
13217
13255
  floatValue: undefined,
13218
13256
  bytesValue: undefined,
13219
13257
  boolValue: undefined,
@@ -13235,6 +13273,12 @@ export const RichValue = {
13235
13273
  if (message.intValue !== undefined) {
13236
13274
  writer.uint32(16).int32(message.intValue);
13237
13275
  }
13276
+ if (message.int64Value !== undefined) {
13277
+ if (BigInt.asIntN(64, message.int64Value) !== message.int64Value) {
13278
+ throw new globalThis.Error("value provided for field message.int64Value of type int64 too large");
13279
+ }
13280
+ writer.uint32(104).int64(message.int64Value.toString());
13281
+ }
13238
13282
  if (message.floatValue !== undefined) {
13239
13283
  writer.uint32(25).double(message.floatValue);
13240
13284
  }
@@ -13289,6 +13333,13 @@ export const RichValue = {
13289
13333
 
13290
13334
  message.intValue = reader.int32();
13291
13335
  continue;
13336
+ case 13:
13337
+ if (tag !== 104) {
13338
+ break;
13339
+ }
13340
+
13341
+ message.int64Value = longToBigint(reader.int64() as Long);
13342
+ continue;
13292
13343
  case 3:
13293
13344
  if (tag !== 25) {
13294
13345
  break;
@@ -13372,6 +13423,7 @@ export const RichValue = {
13372
13423
  return {
13373
13424
  nullValue: isSet(object.nullValue) ? richValue_NullValueFromJSON(object.nullValue) : undefined,
13374
13425
  intValue: isSet(object.intValue) ? globalThis.Number(object.intValue) : undefined,
13426
+ int64Value: isSet(object.int64Value) ? BigInt(object.int64Value) : undefined,
13375
13427
  floatValue: isSet(object.floatValue) ? globalThis.Number(object.floatValue) : undefined,
13376
13428
  bytesValue: isSet(object.bytesValue) ? bytesFromBase64(object.bytesValue) : undefined,
13377
13429
  boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
@@ -13393,6 +13445,9 @@ export const RichValue = {
13393
13445
  if (message.intValue !== undefined) {
13394
13446
  obj.intValue = Math.round(message.intValue);
13395
13447
  }
13448
+ if (message.int64Value !== undefined) {
13449
+ obj.int64Value = message.int64Value.toString();
13450
+ }
13396
13451
  if (message.floatValue !== undefined) {
13397
13452
  obj.floatValue = message.floatValue;
13398
13453
  }
@@ -13433,6 +13488,7 @@ export const RichValue = {
13433
13488
  const message = createBaseRichValue();
13434
13489
  message.nullValue = object.nullValue ?? undefined;
13435
13490
  message.intValue = object.intValue ?? undefined;
13491
+ message.int64Value = object.int64Value ?? undefined;
13436
13492
  message.floatValue = object.floatValue ?? undefined;
13437
13493
  message.bytesValue = object.bytesValue ?? undefined;
13438
13494
  message.boolValue = object.boolValue ?? undefined;
@@ -13974,6 +14030,297 @@ export const TokenAmount = {
13974
14030
  },
13975
14031
  };
13976
14032
 
14033
+ function createBaseRequestLog(): RequestLog {
14034
+ return {
14035
+ requestId: "",
14036
+ endpointId: "",
14037
+ owner: "",
14038
+ slug: "",
14039
+ statusCode: 0,
14040
+ error: "",
14041
+ requestBody: new Uint8Array(0),
14042
+ requestHeader: undefined,
14043
+ responseBody: new Uint8Array(0),
14044
+ responseHeader: undefined,
14045
+ createdAt: undefined,
14046
+ duration: BigInt("0"),
14047
+ queryDuration: BigInt("0"),
14048
+ method: "",
14049
+ rpcNodeId: "",
14050
+ };
14051
+ }
14052
+
14053
+ export const RequestLog = {
14054
+ encode(message: RequestLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
14055
+ if (message.requestId !== "") {
14056
+ writer.uint32(10).string(message.requestId);
14057
+ }
14058
+ if (message.endpointId !== "") {
14059
+ writer.uint32(18).string(message.endpointId);
14060
+ }
14061
+ if (message.owner !== "") {
14062
+ writer.uint32(26).string(message.owner);
14063
+ }
14064
+ if (message.slug !== "") {
14065
+ writer.uint32(34).string(message.slug);
14066
+ }
14067
+ if (message.statusCode !== 0) {
14068
+ writer.uint32(40).uint32(message.statusCode);
14069
+ }
14070
+ if (message.error !== "") {
14071
+ writer.uint32(50).string(message.error);
14072
+ }
14073
+ if (message.requestBody.length !== 0) {
14074
+ writer.uint32(58).bytes(message.requestBody);
14075
+ }
14076
+ if (message.requestHeader !== undefined) {
14077
+ Struct.encode(Struct.wrap(message.requestHeader), writer.uint32(66).fork()).ldelim();
14078
+ }
14079
+ if (message.responseBody.length !== 0) {
14080
+ writer.uint32(74).bytes(message.responseBody);
14081
+ }
14082
+ if (message.responseHeader !== undefined) {
14083
+ Struct.encode(Struct.wrap(message.responseHeader), writer.uint32(82).fork()).ldelim();
14084
+ }
14085
+ if (message.createdAt !== undefined) {
14086
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(90).fork()).ldelim();
14087
+ }
14088
+ if (message.duration !== BigInt("0")) {
14089
+ if (BigInt.asUintN(64, message.duration) !== message.duration) {
14090
+ throw new globalThis.Error("value provided for field message.duration of type uint64 too large");
14091
+ }
14092
+ writer.uint32(96).uint64(message.duration.toString());
14093
+ }
14094
+ if (message.queryDuration !== BigInt("0")) {
14095
+ if (BigInt.asUintN(64, message.queryDuration) !== message.queryDuration) {
14096
+ throw new globalThis.Error("value provided for field message.queryDuration of type uint64 too large");
14097
+ }
14098
+ writer.uint32(104).uint64(message.queryDuration.toString());
14099
+ }
14100
+ if (message.method !== "") {
14101
+ writer.uint32(114).string(message.method);
14102
+ }
14103
+ if (message.rpcNodeId !== "") {
14104
+ writer.uint32(122).string(message.rpcNodeId);
14105
+ }
14106
+ return writer;
14107
+ },
14108
+
14109
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestLog {
14110
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
14111
+ let end = length === undefined ? reader.len : reader.pos + length;
14112
+ const message = createBaseRequestLog();
14113
+ while (reader.pos < end) {
14114
+ const tag = reader.uint32();
14115
+ switch (tag >>> 3) {
14116
+ case 1:
14117
+ if (tag !== 10) {
14118
+ break;
14119
+ }
14120
+
14121
+ message.requestId = reader.string();
14122
+ continue;
14123
+ case 2:
14124
+ if (tag !== 18) {
14125
+ break;
14126
+ }
14127
+
14128
+ message.endpointId = reader.string();
14129
+ continue;
14130
+ case 3:
14131
+ if (tag !== 26) {
14132
+ break;
14133
+ }
14134
+
14135
+ message.owner = reader.string();
14136
+ continue;
14137
+ case 4:
14138
+ if (tag !== 34) {
14139
+ break;
14140
+ }
14141
+
14142
+ message.slug = reader.string();
14143
+ continue;
14144
+ case 5:
14145
+ if (tag !== 40) {
14146
+ break;
14147
+ }
14148
+
14149
+ message.statusCode = reader.uint32();
14150
+ continue;
14151
+ case 6:
14152
+ if (tag !== 50) {
14153
+ break;
14154
+ }
14155
+
14156
+ message.error = reader.string();
14157
+ continue;
14158
+ case 7:
14159
+ if (tag !== 58) {
14160
+ break;
14161
+ }
14162
+
14163
+ message.requestBody = reader.bytes();
14164
+ continue;
14165
+ case 8:
14166
+ if (tag !== 66) {
14167
+ break;
14168
+ }
14169
+
14170
+ message.requestHeader = Struct.unwrap(Struct.decode(reader, reader.uint32()));
14171
+ continue;
14172
+ case 9:
14173
+ if (tag !== 74) {
14174
+ break;
14175
+ }
14176
+
14177
+ message.responseBody = reader.bytes();
14178
+ continue;
14179
+ case 10:
14180
+ if (tag !== 82) {
14181
+ break;
14182
+ }
14183
+
14184
+ message.responseHeader = Struct.unwrap(Struct.decode(reader, reader.uint32()));
14185
+ continue;
14186
+ case 11:
14187
+ if (tag !== 90) {
14188
+ break;
14189
+ }
14190
+
14191
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
14192
+ continue;
14193
+ case 12:
14194
+ if (tag !== 96) {
14195
+ break;
14196
+ }
14197
+
14198
+ message.duration = longToBigint(reader.uint64() as Long);
14199
+ continue;
14200
+ case 13:
14201
+ if (tag !== 104) {
14202
+ break;
14203
+ }
14204
+
14205
+ message.queryDuration = longToBigint(reader.uint64() as Long);
14206
+ continue;
14207
+ case 14:
14208
+ if (tag !== 114) {
14209
+ break;
14210
+ }
14211
+
14212
+ message.method = reader.string();
14213
+ continue;
14214
+ case 15:
14215
+ if (tag !== 122) {
14216
+ break;
14217
+ }
14218
+
14219
+ message.rpcNodeId = reader.string();
14220
+ continue;
14221
+ }
14222
+ if ((tag & 7) === 4 || tag === 0) {
14223
+ break;
14224
+ }
14225
+ reader.skipType(tag & 7);
14226
+ }
14227
+ return message;
14228
+ },
14229
+
14230
+ fromJSON(object: any): RequestLog {
14231
+ return {
14232
+ requestId: isSet(object.requestId) ? globalThis.String(object.requestId) : "",
14233
+ endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "",
14234
+ owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
14235
+ slug: isSet(object.slug) ? globalThis.String(object.slug) : "",
14236
+ statusCode: isSet(object.statusCode) ? globalThis.Number(object.statusCode) : 0,
14237
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
14238
+ requestBody: isSet(object.requestBody) ? bytesFromBase64(object.requestBody) : new Uint8Array(0),
14239
+ requestHeader: isObject(object.requestHeader) ? object.requestHeader : undefined,
14240
+ responseBody: isSet(object.responseBody) ? bytesFromBase64(object.responseBody) : new Uint8Array(0),
14241
+ responseHeader: isObject(object.responseHeader) ? object.responseHeader : undefined,
14242
+ createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined,
14243
+ duration: isSet(object.duration) ? BigInt(object.duration) : BigInt("0"),
14244
+ queryDuration: isSet(object.queryDuration) ? BigInt(object.queryDuration) : BigInt("0"),
14245
+ method: isSet(object.method) ? globalThis.String(object.method) : "",
14246
+ rpcNodeId: isSet(object.rpcNodeId) ? globalThis.String(object.rpcNodeId) : "",
14247
+ };
14248
+ },
14249
+
14250
+ toJSON(message: RequestLog): unknown {
14251
+ const obj: any = {};
14252
+ if (message.requestId !== "") {
14253
+ obj.requestId = message.requestId;
14254
+ }
14255
+ if (message.endpointId !== "") {
14256
+ obj.endpointId = message.endpointId;
14257
+ }
14258
+ if (message.owner !== "") {
14259
+ obj.owner = message.owner;
14260
+ }
14261
+ if (message.slug !== "") {
14262
+ obj.slug = message.slug;
14263
+ }
14264
+ if (message.statusCode !== 0) {
14265
+ obj.statusCode = Math.round(message.statusCode);
14266
+ }
14267
+ if (message.error !== "") {
14268
+ obj.error = message.error;
14269
+ }
14270
+ if (message.requestBody.length !== 0) {
14271
+ obj.requestBody = base64FromBytes(message.requestBody);
14272
+ }
14273
+ if (message.requestHeader !== undefined) {
14274
+ obj.requestHeader = message.requestHeader;
14275
+ }
14276
+ if (message.responseBody.length !== 0) {
14277
+ obj.responseBody = base64FromBytes(message.responseBody);
14278
+ }
14279
+ if (message.responseHeader !== undefined) {
14280
+ obj.responseHeader = message.responseHeader;
14281
+ }
14282
+ if (message.createdAt !== undefined) {
14283
+ obj.createdAt = message.createdAt.toISOString();
14284
+ }
14285
+ if (message.duration !== BigInt("0")) {
14286
+ obj.duration = message.duration.toString();
14287
+ }
14288
+ if (message.queryDuration !== BigInt("0")) {
14289
+ obj.queryDuration = message.queryDuration.toString();
14290
+ }
14291
+ if (message.method !== "") {
14292
+ obj.method = message.method;
14293
+ }
14294
+ if (message.rpcNodeId !== "") {
14295
+ obj.rpcNodeId = message.rpcNodeId;
14296
+ }
14297
+ return obj;
14298
+ },
14299
+
14300
+ create(base?: DeepPartial<RequestLog>): RequestLog {
14301
+ return RequestLog.fromPartial(base ?? {});
14302
+ },
14303
+ fromPartial(object: DeepPartial<RequestLog>): RequestLog {
14304
+ const message = createBaseRequestLog();
14305
+ message.requestId = object.requestId ?? "";
14306
+ message.endpointId = object.endpointId ?? "";
14307
+ message.owner = object.owner ?? "";
14308
+ message.slug = object.slug ?? "";
14309
+ message.statusCode = object.statusCode ?? 0;
14310
+ message.error = object.error ?? "";
14311
+ message.requestBody = object.requestBody ?? new Uint8Array(0);
14312
+ message.requestHeader = object.requestHeader ?? undefined;
14313
+ message.responseBody = object.responseBody ?? new Uint8Array(0);
14314
+ message.responseHeader = object.responseHeader ?? undefined;
14315
+ message.createdAt = object.createdAt ?? undefined;
14316
+ message.duration = object.duration ?? BigInt("0");
14317
+ message.queryDuration = object.queryDuration ?? BigInt("0");
14318
+ message.method = object.method ?? "";
14319
+ message.rpcNodeId = object.rpcNodeId ?? "";
14320
+ return message;
14321
+ },
14322
+ };
14323
+
13977
14324
  function bytesFromBase64(b64: string): Uint8Array {
13978
14325
  if ((globalThis as any).Buffer) {
13979
14326
  return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
package/src/metrics.ts CHANGED
@@ -172,6 +172,11 @@ export const processMetrics = {
172
172
  processor_rpc_duration: new H('processor_rpc_duration'),
173
173
  processor_rpc_queue_duration: new H('processor_rpc_queue_duration'),
174
174
  processor_template_instance_count: new C('process_template_instance_count'),
175
+ processor_worker_run_time: new G('processor_worker_run_time'),
176
+ processor_worker_wait_time: new G('processor_worker_wait_time'),
177
+ processor_worker_utilization: new G('processor_worker_utilization'),
178
+ processor_worker_queue_size: new G('processor_worker_queue_size'),
179
+ processor_worker_completed: new G('processor_worker_completed'),
175
180
  stats() {
176
181
  return {
177
182
  process_binding_count: this.process_binding_count.get(),
@@ -186,7 +191,12 @@ export const processMetrics = {
186
191
  processor_handler_duration: this.processor_handler_duration.get(),
187
192
  processor_rpc_duration: this.processor_rpc_duration.get(),
188
193
  processor_rpc_queue_duration: this.processor_rpc_queue_duration.get(),
189
- processor_template_instance_count: this.processor_template_instance_count.get()
194
+ processor_template_instance_count: this.processor_template_instance_count.get(),
195
+ processor_worker_run_time: this.processor_worker_run_time.get(),
196
+ processor_worker_wait_time: this.processor_worker_wait_time.get(),
197
+ processor_worker_utilization: this.processor_worker_utilization.get(),
198
+ processor_worker_queue_size: this.processor_worker_queue_size.get(),
199
+ processor_worker_completed: this.processor_worker_completed.get()
190
200
  }
191
201
  }
192
202
  }