@sentio/runtime 1.40.1 → 1.40.2-rc.2
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/lib/decode-benchmark.d.ts +2 -0
- package/lib/decode-benchmark.js +49 -0
- package/lib/decode-benchmark.js.map +1 -0
- package/lib/full-service.d.ts +1 -0
- package/lib/gen/processor/protos/processor.d.ts +1 -0
- package/lib/gen/processor/protos/processor.js +20 -1
- package/lib/gen/processor/protos/processor.js.map +1 -1
- package/package.json +5 -7
- package/src/decode-benchmark.ts +29 -0
- package/src/gen/processor/protos/processor.ts +21 -1
@@ -0,0 +1,49 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
"use strict";
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
+
if (k2 === undefined) k2 = k;
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
+
}
|
9
|
+
Object.defineProperty(o, k2, desc);
|
10
|
+
}) : (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
o[k2] = m[k];
|
13
|
+
}));
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
16
|
+
}) : function(o, v) {
|
17
|
+
o["default"] = v;
|
18
|
+
});
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
20
|
+
if (mod && mod.__esModule) return mod;
|
21
|
+
var result = {};
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
23
|
+
__setModuleDefault(result, mod);
|
24
|
+
return result;
|
25
|
+
};
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
28
|
+
};
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
30
|
+
const fs_1 = __importDefault(require("fs"));
|
31
|
+
const console = __importStar(require("console"));
|
32
|
+
const fileContent = fs_1.default.readFileSync('../../../chain/aptos/testdata/block-0-9999.json', { encoding: 'utf-8' });
|
33
|
+
// console.log(fileContent)
|
34
|
+
const contents = JSON.parse(fileContent);
|
35
|
+
console.log(contents.length);
|
36
|
+
const raws = [];
|
37
|
+
for (const content of contents) {
|
38
|
+
raws.push(new TextEncoder().encode(JSON.stringify(content)));
|
39
|
+
}
|
40
|
+
console.log('test begin');
|
41
|
+
const start = Date.now();
|
42
|
+
for (let i = 0; i < 10; i++) {
|
43
|
+
for (const raw of raws) {
|
44
|
+
const x = JSON.parse(new TextDecoder().decode(raw));
|
45
|
+
}
|
46
|
+
}
|
47
|
+
const end = Date.now();
|
48
|
+
console.log((end - start) / 1000.0, 'seconds');
|
49
|
+
//# sourceMappingURL=decode-benchmark.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"decode-benchmark.js","sourceRoot":"","sources":["../src/decode-benchmark.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,4CAAmB;AACnB,iDAAkC;AAElC,MAAM,WAAW,GAAG,YAAE,CAAC,YAAY,CAAC,iDAAiD,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;AAC7G,2BAA2B;AAE3B,MAAM,QAAQ,GAAa,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;AAElD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AAE5B,MAAM,IAAI,GAAiB,EAAE,CAAA;AAC7B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;IAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;CAC7D;AAED,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;AAEzB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AAExB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;IAC3B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;KACpD;CACF;AAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AACtB,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,EAAE,SAAS,CAAC,CAAA","sourcesContent":["#!/usr/bin/env node\n\nimport fs from 'fs'\nimport * as console from 'console'\n\nconst fileContent = fs.readFileSync('../../../chain/aptos/testdata/block-0-9999.json', { encoding: 'utf-8' })\n// console.log(fileContent)\n\nconst contents: object[] = JSON.parse(fileContent)\n\nconsole.log(contents.length)\n\nconst raws: Uint8Array[] = []\nfor (const content of contents) {\n raws.push(new TextEncoder().encode(JSON.stringify(content)))\n}\n\nconsole.log('test begin')\n\nconst start = Date.now()\n\nfor (let i = 0; i < 10; i++) {\n for (const raw of raws) {\n const x = JSON.parse(new TextDecoder().decode(raw))\n }\n}\n\nconst end = Date.now()\nconsole.log((end - start) / 1000.0, 'seconds')\n"]}
|
package/lib/full-service.d.ts
CHANGED
@@ -158,6 +158,7 @@ export declare class FullProcessorServiceImpl implements ProcessorServiceImpleme
|
|
158
158
|
description?: string | undefined;
|
159
159
|
unit?: string | undefined;
|
160
160
|
sparse?: boolean | undefined;
|
161
|
+
persistentBetweenVersion?: boolean | undefined;
|
161
162
|
type?: import("./gen/processor/protos/processor").MetricType | undefined;
|
162
163
|
aggregationConfig?: {
|
163
164
|
intervalInMinutes?: number[] | undefined;
|
@@ -976,7 +976,15 @@ exports.ExportConfig = {
|
|
976
976
|
},
|
977
977
|
};
|
978
978
|
function createBaseMetricConfig() {
|
979
|
-
return {
|
979
|
+
return {
|
980
|
+
name: "",
|
981
|
+
description: "",
|
982
|
+
unit: "",
|
983
|
+
sparse: false,
|
984
|
+
persistentBetweenVersion: false,
|
985
|
+
type: 0,
|
986
|
+
aggregationConfig: undefined,
|
987
|
+
};
|
980
988
|
}
|
981
989
|
exports.MetricConfig = {
|
982
990
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
@@ -992,6 +1000,9 @@ exports.MetricConfig = {
|
|
992
1000
|
if (message.sparse === true) {
|
993
1001
|
writer.uint32(32).bool(message.sparse);
|
994
1002
|
}
|
1003
|
+
if (message.persistentBetweenVersion === true) {
|
1004
|
+
writer.uint32(40).bool(message.persistentBetweenVersion);
|
1005
|
+
}
|
995
1006
|
if (message.type !== 0) {
|
996
1007
|
writer.uint32(56).int32(message.type);
|
997
1008
|
}
|
@@ -1019,6 +1030,9 @@ exports.MetricConfig = {
|
|
1019
1030
|
case 4:
|
1020
1031
|
message.sparse = reader.bool();
|
1021
1032
|
break;
|
1033
|
+
case 5:
|
1034
|
+
message.persistentBetweenVersion = reader.bool();
|
1035
|
+
break;
|
1022
1036
|
case 7:
|
1023
1037
|
message.type = reader.int32();
|
1024
1038
|
break;
|
@@ -1038,6 +1052,9 @@ exports.MetricConfig = {
|
|
1038
1052
|
description: isSet(object.description) ? String(object.description) : "",
|
1039
1053
|
unit: isSet(object.unit) ? String(object.unit) : "",
|
1040
1054
|
sparse: isSet(object.sparse) ? Boolean(object.sparse) : false,
|
1055
|
+
persistentBetweenVersion: isSet(object.persistentBetweenVersion)
|
1056
|
+
? Boolean(object.persistentBetweenVersion)
|
1057
|
+
: false,
|
1041
1058
|
type: isSet(object.type) ? metricTypeFromJSON(object.type) : 0,
|
1042
1059
|
aggregationConfig: isSet(object.aggregationConfig)
|
1043
1060
|
? exports.AggregationConfig.fromJSON(object.aggregationConfig)
|
@@ -1050,6 +1067,7 @@ exports.MetricConfig = {
|
|
1050
1067
|
message.description !== undefined && (obj.description = message.description);
|
1051
1068
|
message.unit !== undefined && (obj.unit = message.unit);
|
1052
1069
|
message.sparse !== undefined && (obj.sparse = message.sparse);
|
1070
|
+
message.persistentBetweenVersion !== undefined && (obj.persistentBetweenVersion = message.persistentBetweenVersion);
|
1053
1071
|
message.type !== undefined && (obj.type = metricTypeToJSON(message.type));
|
1054
1072
|
message.aggregationConfig !== undefined && (obj.aggregationConfig = message.aggregationConfig
|
1055
1073
|
? exports.AggregationConfig.toJSON(message.aggregationConfig)
|
@@ -1062,6 +1080,7 @@ exports.MetricConfig = {
|
|
1062
1080
|
message.description = object.description ?? "";
|
1063
1081
|
message.unit = object.unit ?? "";
|
1064
1082
|
message.sparse = object.sparse ?? false;
|
1083
|
+
message.persistentBetweenVersion = object.persistentBetweenVersion ?? false;
|
1065
1084
|
message.type = object.type ?? 0;
|
1066
1085
|
message.aggregationConfig = (object.aggregationConfig !== undefined && object.aggregationConfig !== null)
|
1067
1086
|
? exports.AggregationConfig.fromPartial(object.aggregationConfig)
|