envio 3.0.0-alpha.2 → 3.0.0-alpha.21
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/README.md +164 -30
- package/bin.mjs +49 -0
- package/evm.schema.json +79 -169
- package/fuel.schema.json +50 -21
- package/index.d.ts +578 -1
- package/index.js +4 -0
- package/package.json +47 -31
- package/rescript.json +4 -1
- package/src/Batch.res +11 -8
- package/src/Batch.res.mjs +11 -9
- package/src/ChainFetcher.res +531 -0
- package/src/ChainFetcher.res.mjs +339 -0
- package/src/ChainManager.res +190 -0
- package/src/ChainManager.res.mjs +166 -0
- package/src/Change.res +3 -3
- package/src/Config.gen.ts +19 -0
- package/src/Config.res +725 -25
- package/src/Config.res.mjs +692 -26
- package/src/{Indexer.res → Ctx.res} +1 -1
- package/src/Ecosystem.res +9 -124
- package/src/Ecosystem.res.mjs +19 -160
- package/src/Env.res +33 -73
- package/src/Env.res.mjs +29 -85
- package/src/Envio.gen.ts +3 -1
- package/src/Envio.res +77 -9
- package/src/Envio.res.mjs +39 -1
- package/src/EventConfigBuilder.res +408 -0
- package/src/EventConfigBuilder.res.mjs +376 -0
- package/src/EventProcessing.res +469 -0
- package/src/EventProcessing.res.mjs +337 -0
- package/src/EvmTypes.gen.ts +6 -0
- package/src/EvmTypes.res +1 -0
- package/src/FetchState.res +1256 -639
- package/src/FetchState.res.mjs +1135 -612
- package/src/GlobalState.res +1224 -0
- package/src/GlobalState.res.mjs +1291 -0
- package/src/GlobalStateManager.res +68 -0
- package/src/GlobalStateManager.res.mjs +75 -0
- package/src/GlobalStateManager.resi +7 -0
- package/src/HandlerLoader.res +89 -0
- package/src/HandlerLoader.res.mjs +79 -0
- package/src/HandlerRegister.res +357 -0
- package/src/HandlerRegister.res.mjs +299 -0
- package/src/HandlerRegister.resi +30 -0
- package/src/Hasura.res +111 -175
- package/src/Hasura.res.mjs +88 -150
- package/src/InMemoryStore.res +1 -1
- package/src/InMemoryStore.res.mjs +3 -3
- package/src/InMemoryTable.res +1 -1
- package/src/InMemoryTable.res.mjs +1 -1
- package/src/Internal.gen.ts +6 -0
- package/src/Internal.res +265 -12
- package/src/Internal.res.mjs +115 -1
- package/src/LoadLayer.res +444 -0
- package/src/LoadLayer.res.mjs +296 -0
- package/src/LoadLayer.resi +32 -0
- package/src/LogSelection.res +33 -27
- package/src/LogSelection.res.mjs +6 -0
- package/src/Logging.res +21 -7
- package/src/Logging.res.mjs +16 -8
- package/src/Main.res +390 -0
- package/src/Main.res.mjs +341 -0
- package/src/Persistence.res +7 -21
- package/src/Persistence.res.mjs +3 -3
- package/src/PgStorage.gen.ts +10 -0
- package/src/PgStorage.res +116 -69
- package/src/PgStorage.res.d.mts +5 -0
- package/src/PgStorage.res.mjs +93 -50
- package/src/Prometheus.res +294 -224
- package/src/Prometheus.res.mjs +353 -340
- package/src/ReorgDetection.res +6 -10
- package/src/ReorgDetection.res.mjs +6 -6
- package/src/SafeCheckpointTracking.res +4 -4
- package/src/SafeCheckpointTracking.res.mjs +2 -2
- package/src/SimulateItems.res +353 -0
- package/src/SimulateItems.res.mjs +335 -0
- package/src/Sink.res +4 -2
- package/src/Sink.res.mjs +2 -1
- package/src/TableIndices.res +0 -1
- package/src/TestIndexer.res +913 -0
- package/src/TestIndexer.res.mjs +698 -0
- package/src/TestIndexerProxyStorage.res +205 -0
- package/src/TestIndexerProxyStorage.res.mjs +151 -0
- package/src/TopicFilter.res +1 -1
- package/src/Types.ts +1 -1
- package/src/UserContext.res +424 -0
- package/src/UserContext.res.mjs +279 -0
- package/src/Utils.res +97 -26
- package/src/Utils.res.mjs +91 -44
- package/src/bindings/BigInt.res +10 -0
- package/src/bindings/BigInt.res.mjs +15 -0
- package/src/bindings/ClickHouse.res +120 -23
- package/src/bindings/ClickHouse.res.mjs +118 -28
- package/src/bindings/DateFns.res +74 -0
- package/src/bindings/DateFns.res.mjs +22 -0
- package/src/bindings/EventSource.res +11 -2
- package/src/bindings/EventSource.res.mjs +8 -1
- package/src/bindings/Express.res +1 -0
- package/src/bindings/Hrtime.res +14 -1
- package/src/bindings/Hrtime.res.mjs +22 -2
- package/src/bindings/Hrtime.resi +4 -0
- package/src/bindings/Lodash.res +0 -1
- package/src/bindings/NodeJs.res +49 -3
- package/src/bindings/NodeJs.res.mjs +11 -3
- package/src/bindings/Pino.res +24 -10
- package/src/bindings/Pino.res.mjs +14 -8
- package/src/bindings/Postgres.gen.ts +8 -0
- package/src/bindings/Postgres.res +5 -1
- package/src/bindings/Postgres.res.d.mts +5 -0
- package/src/bindings/PromClient.res +0 -10
- package/src/bindings/PromClient.res.mjs +0 -3
- package/src/bindings/Vitest.res +144 -0
- package/src/bindings/Vitest.res.mjs +9 -0
- package/src/bindings/WebSocket.res +27 -0
- package/src/bindings/WebSocket.res.mjs +2 -0
- package/src/bindings/Yargs.res +8 -0
- package/src/bindings/Yargs.res.mjs +2 -0
- package/src/db/EntityHistory.res +7 -7
- package/src/db/EntityHistory.res.mjs +9 -9
- package/src/db/InternalTable.res +59 -111
- package/src/db/InternalTable.res.mjs +73 -104
- package/src/db/Table.res +27 -8
- package/src/db/Table.res.mjs +25 -14
- package/src/sources/Evm.res +84 -0
- package/src/sources/Evm.res.mjs +105 -0
- package/src/sources/EvmChain.res +94 -0
- package/src/sources/EvmChain.res.mjs +60 -0
- package/src/sources/Fuel.res +19 -34
- package/src/sources/Fuel.res.mjs +34 -16
- package/src/sources/FuelSDK.res +38 -0
- package/src/sources/FuelSDK.res.mjs +29 -0
- package/src/sources/HyperFuel.res +2 -2
- package/src/sources/HyperFuel.resi +1 -1
- package/src/sources/HyperFuelClient.res +2 -2
- package/src/sources/HyperFuelSource.res +35 -13
- package/src/sources/HyperFuelSource.res.mjs +26 -16
- package/src/sources/HyperSync.res +61 -60
- package/src/sources/HyperSync.res.mjs +53 -67
- package/src/sources/HyperSync.resi +6 -4
- package/src/sources/HyperSyncClient.res +29 -2
- package/src/sources/HyperSyncClient.res.mjs +9 -0
- package/src/sources/HyperSyncHeightStream.res +76 -118
- package/src/sources/HyperSyncHeightStream.res.mjs +68 -75
- package/src/sources/HyperSyncSource.res +122 -143
- package/src/sources/HyperSyncSource.res.mjs +106 -121
- package/src/sources/Rpc.res +86 -14
- package/src/sources/Rpc.res.mjs +101 -9
- package/src/sources/RpcSource.res +731 -364
- package/src/sources/RpcSource.res.mjs +845 -410
- package/src/sources/RpcWebSocketHeightStream.res +181 -0
- package/src/sources/RpcWebSocketHeightStream.res.mjs +196 -0
- package/src/sources/SimulateSource.res +59 -0
- package/src/sources/SimulateSource.res.mjs +50 -0
- package/src/sources/Source.res +7 -5
- package/src/sources/SourceManager.res +358 -221
- package/src/sources/SourceManager.res.mjs +346 -171
- package/src/sources/SourceManager.resi +17 -6
- package/src/sources/Svm.res +81 -0
- package/src/sources/Svm.res.mjs +90 -0
- package/src/tui/Tui.res +247 -0
- package/src/tui/Tui.res.mjs +337 -0
- package/src/tui/bindings/Ink.res +371 -0
- package/src/tui/bindings/Ink.res.mjs +72 -0
- package/src/tui/bindings/Style.res +123 -0
- package/src/tui/bindings/Style.res.mjs +2 -0
- package/src/tui/components/BufferedProgressBar.res +40 -0
- package/src/tui/components/BufferedProgressBar.res.mjs +57 -0
- package/src/tui/components/CustomHooks.res +122 -0
- package/src/tui/components/CustomHooks.res.mjs +179 -0
- package/src/tui/components/Messages.res +41 -0
- package/src/tui/components/Messages.res.mjs +75 -0
- package/src/tui/components/SyncETA.res +174 -0
- package/src/tui/components/SyncETA.res.mjs +263 -0
- package/src/tui/components/TuiData.res +47 -0
- package/src/tui/components/TuiData.res.mjs +34 -0
- package/svm.schema.json +112 -0
- package/bin.js +0 -48
- package/src/EventRegister.res +0 -241
- package/src/EventRegister.res.mjs +0 -240
- package/src/EventRegister.resi +0 -30
- package/src/bindings/Ethers.gen.ts +0 -14
- package/src/bindings/Ethers.res +0 -204
- package/src/bindings/Ethers.res.mjs +0 -130
- /package/src/{Indexer.res.mjs → Ctx.res.mjs} +0 -0
package/src/Prometheus.res.mjs
CHANGED
|
@@ -4,52 +4,9 @@ import * as Utils from "./Utils.res.mjs";
|
|
|
4
4
|
import * as Hrtime from "./bindings/Hrtime.res.mjs";
|
|
5
5
|
import * as Js_exn from "rescript/lib/es6/js_exn.js";
|
|
6
6
|
import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
|
|
7
|
-
import * as Belt_Result from "rescript/lib/es6/belt_Result.js";
|
|
8
7
|
import * as PromClient from "prom-client";
|
|
9
8
|
import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
|
|
10
9
|
|
|
11
|
-
var loadEntitiesDurationCounter = new PromClient.Counter({
|
|
12
|
-
name: "load_entities_processing_time_spent",
|
|
13
|
-
help: "Duration spend on loading entities",
|
|
14
|
-
labelNames: []
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
var eventRouterDurationCounter = new PromClient.Counter({
|
|
18
|
-
name: "event_router_processing_time_spent",
|
|
19
|
-
help: "Duration spend on event routing",
|
|
20
|
-
labelNames: []
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
var executeBatchDurationCounter = new PromClient.Counter({
|
|
24
|
-
name: "execute_batch_processing_time_spent",
|
|
25
|
-
help: "Duration spend on executing batch",
|
|
26
|
-
labelNames: []
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
var storageWriteTimeCounter = new PromClient.Counter({
|
|
30
|
-
name: "envio_storage_write_time",
|
|
31
|
-
help: "Cumulative time spent writing batches to storage in milliseconds",
|
|
32
|
-
labelNames: []
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
var storageWriteCounter = new PromClient.Counter({
|
|
36
|
-
name: "envio_storage_write_count",
|
|
37
|
-
help: "Total number of batch writes to storage",
|
|
38
|
-
labelNames: []
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
var allChainsSyncedToHead = new PromClient.Gauge({
|
|
42
|
-
name: "hyperindex_synced_to_head",
|
|
43
|
-
help: "All chains fully synced",
|
|
44
|
-
labelNames: []
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
var sourceChainHeight = new PromClient.Gauge({
|
|
48
|
-
name: "chain_block_height",
|
|
49
|
-
help: "Chain Height of Source Chain",
|
|
50
|
-
labelNames: ["chainId"]
|
|
51
|
-
});
|
|
52
|
-
|
|
53
10
|
function schemaIsString(_schema) {
|
|
54
11
|
while(true) {
|
|
55
12
|
var schema = _schema;
|
|
@@ -249,127 +206,188 @@ var SafeGauge = {
|
|
|
249
206
|
incrementMany: incrementMany$1
|
|
250
207
|
};
|
|
251
208
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
labelNames: Belt_Result.getExn(getLabelNames(labelSchema)),
|
|
257
|
-
buckets: backets
|
|
258
|
-
});
|
|
259
|
-
return function (labels) {
|
|
260
|
-
return histogram.labels(S$RescriptSchema.reverseConvertToJsonOrThrow(labels, labelSchema)).startTimer();
|
|
261
|
-
};
|
|
262
|
-
}
|
|
209
|
+
var loadTimeCounter = new PromClient.Counter({
|
|
210
|
+
name: "envio_preload_seconds",
|
|
211
|
+
help: "Cumulative time spent on preloading entities during batch processing."
|
|
212
|
+
});
|
|
263
213
|
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
stat: s.m(S$RescriptSchema.string),
|
|
268
|
-
label: s.m(S$RescriptSchema.string)
|
|
269
|
-
};
|
|
214
|
+
var handlerTimeCounter = new PromClient.Counter({
|
|
215
|
+
name: "envio_processing_seconds",
|
|
216
|
+
help: "Cumulative time spent executing event handlers during batch processing."
|
|
270
217
|
});
|
|
271
218
|
|
|
272
|
-
var
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
stat: "min",
|
|
288
|
-
label: label
|
|
289
|
-
}, min);
|
|
290
|
-
handleFloat$1(gauge, {
|
|
291
|
-
group: group,
|
|
292
|
-
stat: "max",
|
|
293
|
-
label: label
|
|
294
|
-
}, max);
|
|
295
|
-
handleFloat$1(gauge, {
|
|
296
|
-
group: group,
|
|
297
|
-
stat: "sum",
|
|
298
|
-
label: label
|
|
299
|
-
}, sum);
|
|
300
|
-
if (stdDev !== undefined) {
|
|
301
|
-
return handleFloat$1(gauge, {
|
|
302
|
-
group: group,
|
|
303
|
-
stat: "stdDev",
|
|
304
|
-
label: label
|
|
305
|
-
}, stdDev);
|
|
306
|
-
}
|
|
307
|
-
|
|
219
|
+
var writeTimeCounter = new PromClient.Counter({
|
|
220
|
+
name: "envio_storage_write_seconds",
|
|
221
|
+
help: "Cumulative time spent writing batch data to storage."
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
var writeCount = new PromClient.Counter({
|
|
225
|
+
name: "envio_storage_write_total",
|
|
226
|
+
help: "Total number of batch writes to storage."
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
function registerMetrics(loadDuration, handlerDuration, dbWriteDuration) {
|
|
230
|
+
loadTimeCounter.inc(loadDuration);
|
|
231
|
+
handlerTimeCounter.inc(handlerDuration);
|
|
232
|
+
writeTimeCounter.inc(dbWriteDuration);
|
|
233
|
+
writeCount.inc();
|
|
308
234
|
}
|
|
309
235
|
|
|
310
|
-
var
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
236
|
+
var ProcessingBatch = {
|
|
237
|
+
loadTimeCounter: loadTimeCounter,
|
|
238
|
+
handlerTimeCounter: handlerTimeCounter,
|
|
239
|
+
writeTimeCounter: writeTimeCounter,
|
|
240
|
+
writeCount: writeCount,
|
|
241
|
+
registerMetrics: registerMetrics
|
|
314
242
|
};
|
|
315
243
|
|
|
316
|
-
function
|
|
317
|
-
|
|
244
|
+
var chainIdLabelsSchema = S$RescriptSchema.object(function (s) {
|
|
245
|
+
return s.f("chainId", S$RescriptSchema.coerce(S$RescriptSchema.string, S$RescriptSchema.$$int));
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
var gauge = makeOrThrow$1("envio_progress_ready", "Whether the chain is fully synced to the head.", chainIdLabelsSchema);
|
|
249
|
+
|
|
250
|
+
var legacyGauge = new PromClient.Gauge({
|
|
251
|
+
name: "hyperindex_synced_to_head",
|
|
252
|
+
help: "All chains fully synced"
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
function init(chainId) {
|
|
256
|
+
handleInt$1(gauge, chainId, 0);
|
|
318
257
|
}
|
|
319
258
|
|
|
320
|
-
function
|
|
321
|
-
|
|
259
|
+
function set(chainId) {
|
|
260
|
+
handleInt$1(gauge, chainId, 1);
|
|
322
261
|
}
|
|
323
262
|
|
|
324
|
-
function
|
|
325
|
-
|
|
263
|
+
function setAllReady() {
|
|
264
|
+
legacyGauge.set(1);
|
|
326
265
|
}
|
|
327
266
|
|
|
328
|
-
|
|
329
|
-
|
|
267
|
+
var ProgressReady = {
|
|
268
|
+
gauge: gauge,
|
|
269
|
+
legacyGauge: legacyGauge,
|
|
270
|
+
init: init,
|
|
271
|
+
set: set,
|
|
272
|
+
setAllReady: setAllReady
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
var handlerLabelsSchema = S$RescriptSchema.schema(function (s) {
|
|
276
|
+
return {
|
|
277
|
+
contract: s.m(S$RescriptSchema.string),
|
|
278
|
+
event: s.m(S$RescriptSchema.string)
|
|
279
|
+
};
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
var timeCounter = makeOrThrow("envio_processing_handler_seconds", "Cumulative time spent inside individual event handler executions.", handlerLabelsSchema);
|
|
283
|
+
|
|
284
|
+
var count = makeOrThrow("envio_processing_handler_total", "Total number of individual event handler executions.", handlerLabelsSchema);
|
|
285
|
+
|
|
286
|
+
function increment$2(contract, $$event, duration) {
|
|
287
|
+
var labels = {
|
|
288
|
+
contract: contract,
|
|
289
|
+
event: $$event
|
|
290
|
+
};
|
|
291
|
+
handleFloat(timeCounter, labels, duration);
|
|
292
|
+
increment(count, labels);
|
|
330
293
|
}
|
|
331
294
|
|
|
332
|
-
|
|
333
|
-
|
|
295
|
+
var ProcessingHandler = {
|
|
296
|
+
timeCounter: timeCounter,
|
|
297
|
+
count: count,
|
|
298
|
+
increment: increment$2
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
var timeCounter$1 = makeOrThrow("envio_preload_handler_seconds", "Wall-clock time spent inside individual preload handler executions.", handlerLabelsSchema);
|
|
302
|
+
|
|
303
|
+
var count$1 = makeOrThrow("envio_preload_handler_total", "Total number of individual preload handler executions.", handlerLabelsSchema);
|
|
304
|
+
|
|
305
|
+
var sumTimeCounter = makeOrThrow("envio_preload_handler_seconds_total", "Cumulative time spent inside individual preload handler executions. Can exceed wall-clock time due to parallel execution.", handlerLabelsSchema);
|
|
306
|
+
|
|
307
|
+
var operations = {};
|
|
308
|
+
|
|
309
|
+
function makeKey(contract, $$event) {
|
|
310
|
+
return contract + ":" + $$event;
|
|
334
311
|
}
|
|
335
312
|
|
|
336
|
-
function
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
313
|
+
function startOperation(contract, $$event) {
|
|
314
|
+
var key = makeKey(contract, $$event);
|
|
315
|
+
var operationRef = operations[key];
|
|
316
|
+
if (operationRef !== undefined) {
|
|
317
|
+
operationRef.pendingCount = operationRef.pendingCount + 1 | 0;
|
|
318
|
+
} else {
|
|
319
|
+
operations[key] = {
|
|
320
|
+
pendingCount: 1,
|
|
321
|
+
timerRef: Hrtime.makeTimer()
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
return Hrtime.makeTimer();
|
|
340
325
|
}
|
|
341
326
|
|
|
342
|
-
function
|
|
343
|
-
|
|
327
|
+
function endOperation(timerRef, contract, $$event) {
|
|
328
|
+
var key = makeKey(contract, $$event);
|
|
329
|
+
var labels = {
|
|
330
|
+
contract: contract,
|
|
331
|
+
event: $$event
|
|
332
|
+
};
|
|
333
|
+
var operationRef = operations[key];
|
|
334
|
+
operationRef.pendingCount = operationRef.pendingCount - 1 | 0;
|
|
335
|
+
if (operationRef.pendingCount === 0) {
|
|
336
|
+
handleFloat(timeCounter$1, labels, Hrtime.toSecondsFloat(Hrtime.timeSince(operationRef.timerRef)));
|
|
337
|
+
Utils.Dict.deleteInPlace(operations, key);
|
|
338
|
+
}
|
|
339
|
+
handleFloat(sumTimeCounter, labels, Hrtime.toSecondsFloat(Hrtime.timeSince(timerRef)));
|
|
340
|
+
increment(count$1, labels);
|
|
344
341
|
}
|
|
345
342
|
|
|
346
|
-
var
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
343
|
+
var PreloadHandler = {
|
|
344
|
+
timeCounter: timeCounter$1,
|
|
345
|
+
count: count$1,
|
|
346
|
+
sumTimeCounter: sumTimeCounter,
|
|
347
|
+
operations: operations,
|
|
348
|
+
makeKey: makeKey,
|
|
349
|
+
startOperation: startOperation,
|
|
350
|
+
endOperation: endOperation
|
|
351
|
+
};
|
|
351
352
|
|
|
352
|
-
var
|
|
353
|
+
var timeCounter$2 = makeOrThrow("envio_fetching_block_range_seconds", "Cumulative time spent fetching block ranges.", chainIdLabelsSchema);
|
|
353
354
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
355
|
+
var parseTimeCounter = makeOrThrow("envio_fetching_block_range_parse_seconds", "Cumulative time spent parsing block range fetch responses.", chainIdLabelsSchema);
|
|
356
|
+
|
|
357
|
+
var count$2 = makeOrThrow("envio_fetching_block_range_total", "Total number of block range fetch operations.", chainIdLabelsSchema);
|
|
358
|
+
|
|
359
|
+
var eventsCount = makeOrThrow("envio_fetching_block_range_events_total", "Cumulative number of events fetched across all block range operations.", chainIdLabelsSchema);
|
|
360
|
+
|
|
361
|
+
var sizeCounter = makeOrThrow("envio_fetching_block_range_size", "Cumulative number of blocks covered across all block range fetch operations.", chainIdLabelsSchema);
|
|
362
|
+
|
|
363
|
+
function increment$3(chainId, totalTimeElapsed, parsingTimeElapsed, numEvents, blockRangeSize) {
|
|
364
|
+
handleFloat(timeCounter$2, chainId, totalTimeElapsed);
|
|
365
|
+
handleFloat(parseTimeCounter, chainId, parsingTimeElapsed);
|
|
366
|
+
increment(count$2, chainId);
|
|
367
|
+
handleInt(eventsCount, chainId, numEvents);
|
|
368
|
+
handleInt(sizeCounter, chainId, blockRangeSize);
|
|
361
369
|
}
|
|
362
370
|
|
|
363
|
-
var
|
|
364
|
-
|
|
371
|
+
var FetchingBlockRange = {
|
|
372
|
+
timeCounter: timeCounter$2,
|
|
373
|
+
parseTimeCounter: parseTimeCounter,
|
|
374
|
+
count: count$2,
|
|
375
|
+
eventsCount: eventsCount,
|
|
376
|
+
sizeCounter: sizeCounter,
|
|
377
|
+
increment: increment$3
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
var gauge$1 = makeOrThrow$1("envio_indexing_known_height", "The latest known block number reported by the active indexing source. This value may lag behind the actual chain height, as it is updated only when needed.", chainIdLabelsSchema);
|
|
381
|
+
|
|
382
|
+
function set$1(blockNumber, chainId) {
|
|
383
|
+
handleInt$1(gauge$1, chainId, blockNumber);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
var IndexingKnownHeight = {
|
|
365
387
|
gauge: gauge$1,
|
|
366
388
|
set: set$1
|
|
367
389
|
};
|
|
368
390
|
|
|
369
|
-
var chainIdLabelsSchema = S$RescriptSchema.object(function (s) {
|
|
370
|
-
return s.f("chainId", S$RescriptSchema.coerce(S$RescriptSchema.string, S$RescriptSchema.$$int));
|
|
371
|
-
});
|
|
372
|
-
|
|
373
391
|
var gauge$2 = makeOrThrow$1("envio_info", "Information about the indexer", S$RescriptSchema.schema(function (s) {
|
|
374
392
|
return {
|
|
375
393
|
version: s.m(S$RescriptSchema.string)
|
|
@@ -387,123 +405,127 @@ var Info = {
|
|
|
387
405
|
set: set$2
|
|
388
406
|
};
|
|
389
407
|
|
|
390
|
-
var gauge$3 =
|
|
408
|
+
var gauge$3 = new PromClient.Gauge({
|
|
409
|
+
name: "envio_process_start_time_seconds",
|
|
410
|
+
help: "Start time of the process since unix epoch in seconds."
|
|
411
|
+
});
|
|
391
412
|
|
|
392
|
-
function set$3(
|
|
393
|
-
|
|
413
|
+
function set$3() {
|
|
414
|
+
gauge$3.set(Date.now() / 1000.0);
|
|
394
415
|
}
|
|
395
416
|
|
|
396
|
-
var
|
|
417
|
+
var ProcessStartTimeSeconds = {
|
|
397
418
|
gauge: gauge$3,
|
|
398
419
|
set: set$3
|
|
399
420
|
};
|
|
400
421
|
|
|
401
|
-
var gauge$4 = makeOrThrow$1("
|
|
422
|
+
var gauge$4 = makeOrThrow$1("envio_indexing_addresses", "The number of addresses indexed on chain. Includes both static and dynamic addresses.", chainIdLabelsSchema);
|
|
402
423
|
|
|
403
|
-
function set$4(
|
|
404
|
-
handleInt$1(gauge$4, chainId,
|
|
424
|
+
function set$4(addressesCount, chainId) {
|
|
425
|
+
handleInt$1(gauge$4, chainId, addressesCount);
|
|
405
426
|
}
|
|
406
427
|
|
|
407
|
-
var
|
|
428
|
+
var IndexingAddresses = {
|
|
408
429
|
gauge: gauge$4,
|
|
409
430
|
set: set$4
|
|
410
431
|
};
|
|
411
432
|
|
|
412
|
-
var gauge$5 = makeOrThrow$1("
|
|
433
|
+
var gauge$5 = makeOrThrow$1("envio_indexing_max_concurrency", "The maximum number of concurrent queries to the chain data-source.", chainIdLabelsSchema);
|
|
413
434
|
|
|
414
|
-
function set$5(
|
|
415
|
-
handleInt$1(gauge$5, chainId,
|
|
435
|
+
function set$5(maxConcurrency, chainId) {
|
|
436
|
+
handleInt$1(gauge$5, chainId, maxConcurrency);
|
|
416
437
|
}
|
|
417
438
|
|
|
418
|
-
var
|
|
439
|
+
var IndexingMaxConcurrency = {
|
|
419
440
|
gauge: gauge$5,
|
|
420
441
|
set: set$5
|
|
421
442
|
};
|
|
422
443
|
|
|
423
|
-
var gauge$6 = makeOrThrow$1("
|
|
444
|
+
var gauge$6 = makeOrThrow$1("envio_indexing_concurrency", "The number of executing concurrent queries to the chain data-source.", chainIdLabelsSchema);
|
|
424
445
|
|
|
425
|
-
function set$6(
|
|
426
|
-
handleInt$1(gauge$6, chainId,
|
|
446
|
+
function set$6(concurrency, chainId) {
|
|
447
|
+
handleInt$1(gauge$6, chainId, concurrency);
|
|
427
448
|
}
|
|
428
449
|
|
|
429
|
-
var
|
|
450
|
+
var IndexingConcurrency = {
|
|
430
451
|
gauge: gauge$6,
|
|
431
452
|
set: set$6
|
|
432
453
|
};
|
|
433
454
|
|
|
434
|
-
var
|
|
455
|
+
var gauge$7 = makeOrThrow$1("envio_indexing_partitions", "The number of partitions used to split fetching logic by addresses and block ranges.", chainIdLabelsSchema);
|
|
456
|
+
|
|
457
|
+
function set$7(partitionsCount, chainId) {
|
|
458
|
+
handleInt$1(gauge$7, chainId, partitionsCount);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
var IndexingPartitions = {
|
|
462
|
+
gauge: gauge$7,
|
|
463
|
+
set: set$7
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
var counter = makeOrThrow("envio_indexing_idle_seconds", "The time the indexer source syncing has been idle. A high value may indicate the source sync is a bottleneck.", chainIdLabelsSchema);
|
|
435
467
|
|
|
436
468
|
var IndexingIdleTime = {
|
|
437
469
|
counter: counter
|
|
438
470
|
};
|
|
439
471
|
|
|
440
|
-
var counter$1 = makeOrThrow("
|
|
472
|
+
var counter$1 = makeOrThrow("envio_indexing_source_waiting_seconds", "The time the indexer has been waiting for new blocks.", chainIdLabelsSchema);
|
|
441
473
|
|
|
442
474
|
var IndexingSourceWaitingTime = {
|
|
443
475
|
counter: counter$1
|
|
444
476
|
};
|
|
445
477
|
|
|
446
|
-
var counter$2 = makeOrThrow("
|
|
478
|
+
var counter$2 = makeOrThrow("envio_indexing_source_querying_seconds", "The time spent performing queries to the chain data-source.", chainIdLabelsSchema);
|
|
447
479
|
|
|
448
480
|
var IndexingQueryTime = {
|
|
449
481
|
counter: counter$2
|
|
450
482
|
};
|
|
451
483
|
|
|
452
|
-
var gauge$
|
|
484
|
+
var gauge$8 = makeOrThrow$1("envio_indexing_buffer_size", "The current number of items in the indexing buffer.", chainIdLabelsSchema);
|
|
453
485
|
|
|
454
|
-
function set$
|
|
455
|
-
handleInt$1(gauge$
|
|
486
|
+
function set$8(bufferSize, chainId) {
|
|
487
|
+
handleInt$1(gauge$8, chainId, bufferSize);
|
|
456
488
|
}
|
|
457
489
|
|
|
458
490
|
var IndexingBufferSize = {
|
|
459
|
-
gauge: gauge$
|
|
460
|
-
set: set$
|
|
491
|
+
gauge: gauge$8,
|
|
492
|
+
set: set$8
|
|
461
493
|
};
|
|
462
494
|
|
|
463
|
-
var gauge$
|
|
495
|
+
var gauge$9 = new PromClient.Gauge({
|
|
464
496
|
name: "envio_indexing_target_buffer_size",
|
|
465
497
|
help: "The target buffer size per chain for indexing. The actual number of items in the queue may exceed this value, but the indexer always tries to keep the buffer filled up to this target."
|
|
466
498
|
});
|
|
467
499
|
|
|
468
|
-
function set$
|
|
469
|
-
gauge$
|
|
500
|
+
function set$9(targetBufferSize) {
|
|
501
|
+
gauge$9.set(targetBufferSize);
|
|
470
502
|
}
|
|
471
503
|
|
|
472
504
|
var IndexingTargetBufferSize = {
|
|
473
|
-
gauge: gauge$
|
|
474
|
-
set: set$
|
|
505
|
+
gauge: gauge$9,
|
|
506
|
+
set: set$9
|
|
475
507
|
};
|
|
476
508
|
|
|
477
|
-
var
|
|
478
|
-
name: "chain_block_height_fully_fetched",
|
|
479
|
-
help: "Block height fully fetched by indexer",
|
|
480
|
-
labelNames: ["chainId"]
|
|
481
|
-
});
|
|
482
|
-
|
|
483
|
-
var gauge$9 = makeOrThrow$1("envio_indexing_buffer_block_number", "The highest block number that has been fully fetched by the indexer.", chainIdLabelsSchema);
|
|
509
|
+
var gauge$10 = makeOrThrow$1("envio_indexing_buffer_block", "The highest block number that has been fully fetched by the indexer.", chainIdLabelsSchema);
|
|
484
510
|
|
|
485
|
-
function set$
|
|
486
|
-
|
|
487
|
-
chainId: chainId
|
|
488
|
-
}).set(blockNumber);
|
|
489
|
-
handleInt$1(gauge$9, chainId, blockNumber);
|
|
511
|
+
function set$10(blockNumber, chainId) {
|
|
512
|
+
handleInt$1(gauge$10, chainId, blockNumber);
|
|
490
513
|
}
|
|
491
514
|
|
|
492
515
|
var IndexingBufferBlockNumber = {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
set: set$9
|
|
516
|
+
gauge: gauge$10,
|
|
517
|
+
set: set$10
|
|
496
518
|
};
|
|
497
519
|
|
|
498
|
-
var gauge$
|
|
520
|
+
var gauge$11 = makeOrThrow$1("envio_indexing_end_block", "The block number to stop indexing at. (inclusive)", chainIdLabelsSchema);
|
|
499
521
|
|
|
500
|
-
function set$
|
|
501
|
-
handleInt$1(gauge$
|
|
522
|
+
function set$11(endBlock, chainId) {
|
|
523
|
+
handleInt$1(gauge$11, chainId, endBlock);
|
|
502
524
|
}
|
|
503
525
|
|
|
504
526
|
var IndexingEndBlock = {
|
|
505
|
-
gauge: gauge$
|
|
506
|
-
set: set$
|
|
527
|
+
gauge: gauge$11,
|
|
528
|
+
set: set$11
|
|
507
529
|
};
|
|
508
530
|
|
|
509
531
|
var sourceLabelsSchema = S$RescriptSchema.schema(function (s) {
|
|
@@ -513,51 +535,75 @@ var sourceLabelsSchema = S$RescriptSchema.schema(function (s) {
|
|
|
513
535
|
};
|
|
514
536
|
});
|
|
515
537
|
|
|
516
|
-
var
|
|
538
|
+
var sourceRequestLabelsSchema = S$RescriptSchema.schema(function (s) {
|
|
539
|
+
return {
|
|
540
|
+
source: s.m(S$RescriptSchema.string),
|
|
541
|
+
chainId: s.m(S$RescriptSchema.coerce(S$RescriptSchema.string, S$RescriptSchema.$$int)),
|
|
542
|
+
method: s.m(S$RescriptSchema.string)
|
|
543
|
+
};
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
var counter$3 = makeOrThrow("envio_source_request_total", "The number of requests made to data sources.", sourceRequestLabelsSchema);
|
|
517
547
|
|
|
518
|
-
|
|
519
|
-
|
|
548
|
+
var sumTimeCounter$1 = makeOrThrow("envio_source_request_seconds_total", "Cumulative time spent on data source requests.", sourceRequestLabelsSchema);
|
|
549
|
+
|
|
550
|
+
function increment$4(sourceName, chainId, method) {
|
|
551
|
+
increment(counter$3, {
|
|
520
552
|
source: sourceName,
|
|
521
|
-
chainId: chainId
|
|
522
|
-
|
|
553
|
+
chainId: chainId,
|
|
554
|
+
method: method
|
|
555
|
+
});
|
|
523
556
|
}
|
|
524
557
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
558
|
+
function addSeconds(sourceName, chainId, method, seconds) {
|
|
559
|
+
handleFloat(sumTimeCounter$1, {
|
|
560
|
+
source: sourceName,
|
|
561
|
+
chainId: chainId,
|
|
562
|
+
method: method
|
|
563
|
+
}, seconds);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
var SourceRequestCount = {
|
|
567
|
+
counter: counter$3,
|
|
568
|
+
sumTimeCounter: sumTimeCounter$1,
|
|
569
|
+
increment: increment$4,
|
|
570
|
+
addSeconds: addSeconds
|
|
528
571
|
};
|
|
529
572
|
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
573
|
+
var gauge$12 = makeOrThrow$1("envio_source_known_height", "The latest known block number reported by the source. This value may lag behind the actual chain height, as it is updated only when queried.", sourceLabelsSchema);
|
|
574
|
+
|
|
575
|
+
function set$12(sourceName, chainId, blockNumber) {
|
|
576
|
+
handleInt$1(gauge$12, {
|
|
577
|
+
source: sourceName,
|
|
578
|
+
chainId: chainId
|
|
579
|
+
}, blockNumber);
|
|
580
|
+
}
|
|
536
581
|
|
|
537
|
-
var
|
|
538
|
-
|
|
582
|
+
var SourceHeight = {
|
|
583
|
+
gauge: gauge$12,
|
|
584
|
+
set: set$12
|
|
539
585
|
};
|
|
540
586
|
|
|
541
|
-
var
|
|
587
|
+
var counter$4 = makeOrThrow("envio_reorg_detected_total", "Total number of reorgs detected", chainIdLabelsSchema);
|
|
542
588
|
|
|
543
|
-
function increment$
|
|
544
|
-
increment
|
|
589
|
+
function increment$5(chain) {
|
|
590
|
+
increment(counter$4, chain);
|
|
545
591
|
}
|
|
546
592
|
|
|
547
593
|
var ReorgCount = {
|
|
548
|
-
|
|
549
|
-
increment: increment$
|
|
594
|
+
counter: counter$4,
|
|
595
|
+
increment: increment$5
|
|
550
596
|
};
|
|
551
597
|
|
|
552
|
-
var gauge$13 = makeOrThrow$1("
|
|
598
|
+
var gauge$13 = makeOrThrow$1("envio_reorg_detected_block", "The block number where reorg was detected the last time. This doesn't mean that the block was reorged, this is simply where we found block hash to be different.", chainIdLabelsSchema);
|
|
553
599
|
|
|
554
|
-
function set$
|
|
600
|
+
function set$13(blockNumber, chain) {
|
|
555
601
|
handleInt$1(gauge$13, chain, blockNumber);
|
|
556
602
|
}
|
|
557
603
|
|
|
558
604
|
var ReorgDetectionBlockNumber = {
|
|
559
605
|
gauge: gauge$13,
|
|
560
|
-
set: set$
|
|
606
|
+
set: set$13
|
|
561
607
|
};
|
|
562
608
|
|
|
563
609
|
var gauge$14 = new PromClient.Gauge({
|
|
@@ -565,13 +611,13 @@ var gauge$14 = new PromClient.Gauge({
|
|
|
565
611
|
help: "Whether indexing is currently within the reorg threshold"
|
|
566
612
|
});
|
|
567
613
|
|
|
568
|
-
function set$
|
|
614
|
+
function set$14(isInReorgThreshold) {
|
|
569
615
|
gauge$14.set(isInReorgThreshold ? 1 : 0);
|
|
570
616
|
}
|
|
571
617
|
|
|
572
618
|
var ReorgThreshold = {
|
|
573
619
|
gauge: gauge$14,
|
|
574
|
-
set: set$
|
|
620
|
+
set: set$14
|
|
575
621
|
};
|
|
576
622
|
|
|
577
623
|
var gauge$15 = new PromClient.Gauge({
|
|
@@ -579,72 +625,72 @@ var gauge$15 = new PromClient.Gauge({
|
|
|
579
625
|
help: "Whether rollback on reorg is enabled"
|
|
580
626
|
});
|
|
581
627
|
|
|
582
|
-
function set$
|
|
628
|
+
function set$15(enabled) {
|
|
583
629
|
gauge$15.set(enabled ? 1 : 0);
|
|
584
630
|
}
|
|
585
631
|
|
|
586
632
|
var RollbackEnabled = {
|
|
587
633
|
gauge: gauge$15,
|
|
588
|
-
set: set$
|
|
634
|
+
set: set$15
|
|
589
635
|
};
|
|
590
636
|
|
|
591
|
-
var timeCounter = new PromClient.Counter({
|
|
592
|
-
name: "
|
|
593
|
-
help: "Rollback on reorg total time
|
|
637
|
+
var timeCounter$3 = new PromClient.Counter({
|
|
638
|
+
name: "envio_rollback_seconds",
|
|
639
|
+
help: "Rollback on reorg total time."
|
|
594
640
|
});
|
|
595
641
|
|
|
596
|
-
var counter$
|
|
597
|
-
name: "
|
|
642
|
+
var counter$5 = new PromClient.Counter({
|
|
643
|
+
name: "envio_rollback_total",
|
|
598
644
|
help: "Number of successful rollbacks on reorg"
|
|
599
645
|
});
|
|
600
646
|
|
|
601
647
|
var eventsCounter = new PromClient.Counter({
|
|
602
|
-
name: "
|
|
648
|
+
name: "envio_rollback_events",
|
|
603
649
|
help: "Number of events rollbacked on reorg"
|
|
604
650
|
});
|
|
605
651
|
|
|
606
|
-
function increment$
|
|
607
|
-
timeCounter.inc(
|
|
608
|
-
counter$
|
|
609
|
-
eventsCounter.inc(rollbackedProcessedEvents);
|
|
652
|
+
function increment$6(timeSeconds, rollbackedProcessedEvents) {
|
|
653
|
+
timeCounter$3.inc(timeSeconds);
|
|
654
|
+
counter$5.inc();
|
|
655
|
+
eventsCounter.inc(Math.trunc(rollbackedProcessedEvents));
|
|
610
656
|
}
|
|
611
657
|
|
|
612
658
|
var RollbackSuccess = {
|
|
613
|
-
timeCounter: timeCounter,
|
|
614
|
-
counter: counter$
|
|
659
|
+
timeCounter: timeCounter$3,
|
|
660
|
+
counter: counter$5,
|
|
615
661
|
eventsCounter: eventsCounter,
|
|
616
|
-
increment: increment$
|
|
662
|
+
increment: increment$6
|
|
617
663
|
};
|
|
618
664
|
|
|
619
665
|
var entityNameLabelsSchema = S$RescriptSchema.object(function (s) {
|
|
620
666
|
return s.f("entity", S$RescriptSchema.string);
|
|
621
667
|
});
|
|
622
668
|
|
|
623
|
-
var timeCounter$
|
|
669
|
+
var timeCounter$4 = makeOrThrow("envio_rollback_history_prune_seconds", "The total time spent pruning entity history which is not in the reorg threshold.", entityNameLabelsSchema);
|
|
624
670
|
|
|
625
|
-
var counter$
|
|
671
|
+
var counter$6 = makeOrThrow("envio_rollback_history_prune_total", "Number of successful entity history prunes", entityNameLabelsSchema);
|
|
626
672
|
|
|
627
|
-
function increment$
|
|
628
|
-
|
|
629
|
-
increment(counter$
|
|
673
|
+
function increment$7(timeSeconds, entityName) {
|
|
674
|
+
handleFloat(timeCounter$4, entityName, timeSeconds);
|
|
675
|
+
increment(counter$6, entityName);
|
|
630
676
|
}
|
|
631
677
|
|
|
632
678
|
var RollbackHistoryPrune = {
|
|
633
679
|
entityNameLabelsSchema: entityNameLabelsSchema,
|
|
634
|
-
timeCounter: timeCounter$
|
|
635
|
-
counter: counter$
|
|
636
|
-
increment: increment$
|
|
680
|
+
timeCounter: timeCounter$4,
|
|
681
|
+
counter: counter$6,
|
|
682
|
+
increment: increment$7
|
|
637
683
|
};
|
|
638
684
|
|
|
639
|
-
var gauge$16 = makeOrThrow$1("
|
|
685
|
+
var gauge$16 = makeOrThrow$1("envio_rollback_target_block", "The block number reorg was rollbacked to the last time.", chainIdLabelsSchema);
|
|
640
686
|
|
|
641
|
-
function set$
|
|
687
|
+
function set$16(blockNumber, chain) {
|
|
642
688
|
handleInt$1(gauge$16, chain, blockNumber);
|
|
643
689
|
}
|
|
644
690
|
|
|
645
691
|
var RollbackTargetBlockNumber = {
|
|
646
692
|
gauge: gauge$16,
|
|
647
|
-
set: set$
|
|
693
|
+
set: set$16
|
|
648
694
|
};
|
|
649
695
|
|
|
650
696
|
var gauge$17 = new PromClient.Gauge({
|
|
@@ -652,149 +698,125 @@ var gauge$17 = new PromClient.Gauge({
|
|
|
652
698
|
help: "The maximum number of items to process in a single batch."
|
|
653
699
|
});
|
|
654
700
|
|
|
655
|
-
function set$
|
|
701
|
+
function set$17(maxBatchSize) {
|
|
656
702
|
gauge$17.set(maxBatchSize);
|
|
657
703
|
}
|
|
658
704
|
|
|
659
705
|
var ProcessingMaxBatchSize = {
|
|
660
706
|
gauge: gauge$17,
|
|
661
|
-
set: set$
|
|
707
|
+
set: set$17
|
|
662
708
|
};
|
|
663
709
|
|
|
664
|
-
var gauge$18 = makeOrThrow$1("
|
|
710
|
+
var gauge$18 = makeOrThrow$1("envio_progress_block", "The block number of the latest block processed and stored in the database.", chainIdLabelsSchema);
|
|
665
711
|
|
|
666
|
-
function set$
|
|
712
|
+
function set$18(blockNumber, chainId) {
|
|
667
713
|
handleInt$1(gauge$18, chainId, blockNumber);
|
|
668
714
|
}
|
|
669
715
|
|
|
670
716
|
var ProgressBlockNumber = {
|
|
671
717
|
gauge: gauge$18,
|
|
672
|
-
set: set$
|
|
718
|
+
set: set$18
|
|
673
719
|
};
|
|
674
720
|
|
|
675
|
-
var
|
|
676
|
-
name: "events_processed",
|
|
677
|
-
help: "Total number of events processed",
|
|
678
|
-
labelNames: ["chainId"]
|
|
679
|
-
});
|
|
680
|
-
|
|
681
|
-
var gauge$19 = makeOrThrow$1("envio_progress_events_count", "The number of events processed and reflected in the database.", chainIdLabelsSchema);
|
|
721
|
+
var gauge$19 = makeOrThrow$1("envio_progress_events", "The number of events processed and reflected in the database.", chainIdLabelsSchema);
|
|
682
722
|
|
|
683
|
-
function set$
|
|
684
|
-
|
|
685
|
-
chainId: chainId
|
|
686
|
-
}).set(processedCount);
|
|
687
|
-
handleInt$1(gauge$19, chainId, processedCount);
|
|
723
|
+
function set$19(processedCount, chainId) {
|
|
724
|
+
handleFloat$1(gauge$19, chainId, processedCount);
|
|
688
725
|
}
|
|
689
726
|
|
|
690
727
|
var ProgressEventsCount = {
|
|
691
|
-
deprecatedGauge: deprecatedGauge$1,
|
|
692
728
|
gauge: gauge$19,
|
|
693
|
-
set: set$
|
|
694
|
-
};
|
|
695
|
-
|
|
696
|
-
var counter$5 = new PromClient.Counter({
|
|
697
|
-
name: "envio_progress_batches_count",
|
|
698
|
-
help: "The number of batches processed and reflected in the database."
|
|
699
|
-
});
|
|
700
|
-
|
|
701
|
-
function increment$5() {
|
|
702
|
-
counter$5.inc();
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
var ProgressBatchCount = {
|
|
706
|
-
counter: counter$5,
|
|
707
|
-
increment: increment$5
|
|
729
|
+
set: set$19
|
|
708
730
|
};
|
|
709
731
|
|
|
710
732
|
var gauge$20 = makeOrThrow$1("envio_progress_latency", "The latency in milliseconds between the latest processed event creation and the time it was written to storage.", chainIdLabelsSchema);
|
|
711
733
|
|
|
712
|
-
function set$
|
|
734
|
+
function set$20(latencyMs, chainId) {
|
|
713
735
|
handleInt$1(gauge$20, chainId, latencyMs);
|
|
714
736
|
}
|
|
715
737
|
|
|
716
738
|
var ProgressLatency = {
|
|
717
739
|
gauge: gauge$20,
|
|
718
|
-
set: set$
|
|
740
|
+
set: set$20
|
|
719
741
|
};
|
|
720
742
|
|
|
721
743
|
var effectLabelsSchema = S$RescriptSchema.object(function (s) {
|
|
722
744
|
return s.f("effect", S$RescriptSchema.string);
|
|
723
745
|
});
|
|
724
746
|
|
|
725
|
-
var timeCounter$
|
|
747
|
+
var timeCounter$5 = makeOrThrow("envio_effect_call_seconds", "Processing time taken to call the Effect function.", effectLabelsSchema);
|
|
726
748
|
|
|
727
|
-
var sumTimeCounter = makeOrThrow("
|
|
749
|
+
var sumTimeCounter$2 = makeOrThrow("envio_effect_call_seconds_total", "Cumulative time spent calling the Effect function during the indexing process.", effectLabelsSchema);
|
|
728
750
|
|
|
729
|
-
var totalCallsCount = makeOrThrow("
|
|
751
|
+
var totalCallsCount = makeOrThrow("envio_effect_call_total", "Cumulative number of resolved Effect function calls during the indexing process.", effectLabelsSchema);
|
|
730
752
|
|
|
731
|
-
var activeCallsCount = makeOrThrow$1("
|
|
753
|
+
var activeCallsCount = makeOrThrow$1("envio_effect_active_calls", "The number of Effect function calls that are currently running.", effectLabelsSchema);
|
|
732
754
|
|
|
733
755
|
var EffectCalls = {
|
|
734
|
-
timeCounter: timeCounter$
|
|
735
|
-
sumTimeCounter: sumTimeCounter,
|
|
756
|
+
timeCounter: timeCounter$5,
|
|
757
|
+
sumTimeCounter: sumTimeCounter$2,
|
|
736
758
|
totalCallsCount: totalCallsCount,
|
|
737
759
|
activeCallsCount: activeCallsCount
|
|
738
760
|
};
|
|
739
761
|
|
|
740
|
-
var gauge$21 = makeOrThrow$1("
|
|
762
|
+
var gauge$21 = makeOrThrow$1("envio_effect_cache", "The number of items in the effect cache.", effectLabelsSchema);
|
|
741
763
|
|
|
742
|
-
function set$
|
|
764
|
+
function set$21(count, effectName) {
|
|
743
765
|
handleInt$1(gauge$21, effectName, count);
|
|
744
766
|
}
|
|
745
767
|
|
|
746
768
|
var EffectCacheCount = {
|
|
747
769
|
gauge: gauge$21,
|
|
748
|
-
set: set$
|
|
770
|
+
set: set$21
|
|
749
771
|
};
|
|
750
772
|
|
|
751
|
-
var counter$
|
|
773
|
+
var counter$7 = makeOrThrow("envio_effect_cache_invalidations", "The number of effect cache invalidations.", effectLabelsSchema);
|
|
752
774
|
|
|
753
|
-
function increment$
|
|
754
|
-
increment(counter$
|
|
775
|
+
function increment$8(effectName) {
|
|
776
|
+
increment(counter$7, effectName);
|
|
755
777
|
}
|
|
756
778
|
|
|
757
779
|
var EffectCacheInvalidationsCount = {
|
|
758
|
-
counter: counter$
|
|
759
|
-
increment: increment$
|
|
780
|
+
counter: counter$7,
|
|
781
|
+
increment: increment$8
|
|
760
782
|
};
|
|
761
783
|
|
|
762
|
-
var gauge$22 = makeOrThrow$1("
|
|
784
|
+
var gauge$22 = makeOrThrow$1("envio_effect_queue", "The number of effect calls waiting in the rate limit queue.", effectLabelsSchema);
|
|
763
785
|
|
|
764
|
-
var timeCounter$
|
|
786
|
+
var timeCounter$6 = makeOrThrow("envio_effect_queue_wait_seconds", "The time spent waiting in the rate limit queue.", effectLabelsSchema);
|
|
765
787
|
|
|
766
|
-
function set$
|
|
788
|
+
function set$22(count, effectName) {
|
|
767
789
|
handleInt$1(gauge$22, effectName, count);
|
|
768
790
|
}
|
|
769
791
|
|
|
770
792
|
var EffectQueueCount = {
|
|
771
793
|
gauge: gauge$22,
|
|
772
|
-
timeCounter: timeCounter$
|
|
773
|
-
set: set$
|
|
794
|
+
timeCounter: timeCounter$6,
|
|
795
|
+
set: set$22
|
|
774
796
|
};
|
|
775
797
|
|
|
776
798
|
var operationLabelsSchema = S$RescriptSchema.object(function (s) {
|
|
777
799
|
return s.f("operation", S$RescriptSchema.string);
|
|
778
800
|
});
|
|
779
801
|
|
|
780
|
-
var timeCounter$
|
|
802
|
+
var timeCounter$7 = makeOrThrow("envio_storage_load_seconds", "Processing time taken to load data from storage.", operationLabelsSchema);
|
|
781
803
|
|
|
782
|
-
var sumTimeCounter$
|
|
804
|
+
var sumTimeCounter$3 = makeOrThrow("envio_storage_load_seconds_total", "Cumulative time spent loading data from storage during the indexing process.", operationLabelsSchema);
|
|
783
805
|
|
|
784
|
-
var counter$
|
|
806
|
+
var counter$8 = makeOrThrow("envio_storage_load_total", "Cumulative number of successful storage load operations during the indexing process.", operationLabelsSchema);
|
|
785
807
|
|
|
786
808
|
var whereSizeCounter = makeOrThrow("envio_storage_load_where_size", "Cumulative number of filter conditions ('where' items) used in storage load operations during the indexing process.", operationLabelsSchema);
|
|
787
809
|
|
|
788
|
-
var sizeCounter = makeOrThrow("envio_storage_load_size", "Cumulative number of records loaded from storage during the indexing process.", operationLabelsSchema);
|
|
810
|
+
var sizeCounter$1 = makeOrThrow("envio_storage_load_size", "Cumulative number of records loaded from storage during the indexing process.", operationLabelsSchema);
|
|
789
811
|
|
|
790
|
-
var operations = {};
|
|
812
|
+
var operations$1 = {};
|
|
791
813
|
|
|
792
|
-
function startOperation(operation) {
|
|
793
|
-
var operationRef = operations[operation];
|
|
814
|
+
function startOperation$1(operation) {
|
|
815
|
+
var operationRef = operations$1[operation];
|
|
794
816
|
if (operationRef !== undefined) {
|
|
795
817
|
operationRef.pendingCount = operationRef.pendingCount + 1 | 0;
|
|
796
818
|
} else {
|
|
797
|
-
operations[operation] = {
|
|
819
|
+
operations$1[operation] = {
|
|
798
820
|
pendingCount: 1,
|
|
799
821
|
timerRef: Hrtime.makeTimer()
|
|
800
822
|
};
|
|
@@ -802,76 +824,67 @@ function startOperation(operation) {
|
|
|
802
824
|
return Hrtime.makeTimer();
|
|
803
825
|
}
|
|
804
826
|
|
|
805
|
-
function endOperation(timerRef, operation, whereSize, size) {
|
|
806
|
-
var operationRef = operations[operation];
|
|
827
|
+
function endOperation$1(timerRef, operation, whereSize, size) {
|
|
828
|
+
var operationRef = operations$1[operation];
|
|
807
829
|
operationRef.pendingCount = operationRef.pendingCount - 1 | 0;
|
|
808
830
|
if (operationRef.pendingCount === 0) {
|
|
809
|
-
|
|
810
|
-
Utils.Dict.deleteInPlace(operations, operation);
|
|
831
|
+
handleFloat(timeCounter$7, operation, Hrtime.toSecondsFloat(Hrtime.timeSince(operationRef.timerRef)));
|
|
832
|
+
Utils.Dict.deleteInPlace(operations$1, operation);
|
|
811
833
|
}
|
|
812
|
-
|
|
813
|
-
increment(counter$
|
|
834
|
+
handleFloat(sumTimeCounter$3, operation, Hrtime.toSecondsFloat(Hrtime.timeSince(timerRef)));
|
|
835
|
+
increment(counter$8, operation);
|
|
814
836
|
handleInt(whereSizeCounter, operation, whereSize);
|
|
815
|
-
handleInt(sizeCounter, operation, size);
|
|
837
|
+
handleInt(sizeCounter$1, operation, size);
|
|
816
838
|
}
|
|
817
839
|
|
|
818
840
|
var StorageLoad = {
|
|
819
841
|
operationLabelsSchema: operationLabelsSchema,
|
|
820
|
-
timeCounter: timeCounter$
|
|
821
|
-
sumTimeCounter: sumTimeCounter$
|
|
822
|
-
counter: counter$
|
|
842
|
+
timeCounter: timeCounter$7,
|
|
843
|
+
sumTimeCounter: sumTimeCounter$3,
|
|
844
|
+
counter: counter$8,
|
|
823
845
|
whereSizeCounter: whereSizeCounter,
|
|
824
|
-
sizeCounter: sizeCounter,
|
|
825
|
-
operations: operations,
|
|
826
|
-
startOperation: startOperation,
|
|
827
|
-
endOperation: endOperation
|
|
846
|
+
sizeCounter: sizeCounter$1,
|
|
847
|
+
operations: operations$1,
|
|
848
|
+
startOperation: startOperation$1,
|
|
849
|
+
endOperation: endOperation$1
|
|
828
850
|
};
|
|
829
851
|
|
|
830
852
|
var sinkLabelsSchema = S$RescriptSchema.object(function (s) {
|
|
831
853
|
return s.f("sink", S$RescriptSchema.string);
|
|
832
854
|
});
|
|
833
855
|
|
|
834
|
-
var timeCounter$
|
|
856
|
+
var timeCounter$8 = makeOrThrow("envio_sink_write_seconds", "Processing time taken to write data to sink.", sinkLabelsSchema);
|
|
835
857
|
|
|
836
|
-
var counter$
|
|
858
|
+
var counter$9 = makeOrThrow("envio_sink_write_total", "Cumulative number of successful sink write operations during the indexing process.", sinkLabelsSchema);
|
|
837
859
|
|
|
838
|
-
function increment$
|
|
839
|
-
|
|
840
|
-
increment(counter$
|
|
860
|
+
function increment$9(sinkName, timeSeconds) {
|
|
861
|
+
handleFloat(timeCounter$8, sinkName, timeSeconds);
|
|
862
|
+
increment(counter$9, sinkName);
|
|
841
863
|
}
|
|
842
864
|
|
|
843
865
|
var SinkWrite = {
|
|
844
866
|
sinkLabelsSchema: sinkLabelsSchema,
|
|
845
|
-
timeCounter: timeCounter$
|
|
846
|
-
counter: counter$
|
|
847
|
-
increment: increment$
|
|
867
|
+
timeCounter: timeCounter$8,
|
|
868
|
+
counter: counter$9,
|
|
869
|
+
increment: increment$9
|
|
848
870
|
};
|
|
849
871
|
|
|
850
872
|
export {
|
|
851
|
-
loadEntitiesDurationCounter ,
|
|
852
|
-
eventRouterDurationCounter ,
|
|
853
|
-
executeBatchDurationCounter ,
|
|
854
|
-
storageWriteTimeCounter ,
|
|
855
|
-
storageWriteCounter ,
|
|
856
|
-
allChainsSyncedToHead ,
|
|
857
|
-
sourceChainHeight ,
|
|
858
873
|
Labels ,
|
|
859
874
|
metricNames ,
|
|
860
875
|
MakeSafePromMetric ,
|
|
861
876
|
SafeCounter ,
|
|
862
877
|
SafeGauge ,
|
|
863
|
-
|
|
864
|
-
BenchmarkSummaryData ,
|
|
865
|
-
incrementLoadEntityDurationCounter ,
|
|
866
|
-
incrementEventRouterDurationCounter ,
|
|
867
|
-
incrementExecuteBatchDurationCounter ,
|
|
868
|
-
incrementStorageWriteTimeCounter ,
|
|
869
|
-
incrementStorageWriteCounter ,
|
|
870
|
-
setSourceChainHeight ,
|
|
871
|
-
setAllChainsSyncedToHead ,
|
|
872
|
-
BenchmarkCounters ,
|
|
878
|
+
ProcessingBatch ,
|
|
873
879
|
chainIdLabelsSchema ,
|
|
880
|
+
ProgressReady ,
|
|
881
|
+
handlerLabelsSchema ,
|
|
882
|
+
ProcessingHandler ,
|
|
883
|
+
PreloadHandler ,
|
|
884
|
+
FetchingBlockRange ,
|
|
885
|
+
IndexingKnownHeight ,
|
|
874
886
|
Info ,
|
|
887
|
+
ProcessStartTimeSeconds ,
|
|
875
888
|
IndexingAddresses ,
|
|
876
889
|
IndexingMaxConcurrency ,
|
|
877
890
|
IndexingConcurrency ,
|
|
@@ -884,8 +897,9 @@ export {
|
|
|
884
897
|
IndexingBufferBlockNumber ,
|
|
885
898
|
IndexingEndBlock ,
|
|
886
899
|
sourceLabelsSchema ,
|
|
900
|
+
sourceRequestLabelsSchema ,
|
|
901
|
+
SourceRequestCount ,
|
|
887
902
|
SourceHeight ,
|
|
888
|
-
SourceGetHeightDuration ,
|
|
889
903
|
ReorgCount ,
|
|
890
904
|
ReorgDetectionBlockNumber ,
|
|
891
905
|
ReorgThreshold ,
|
|
@@ -896,7 +910,6 @@ export {
|
|
|
896
910
|
ProcessingMaxBatchSize ,
|
|
897
911
|
ProgressBlockNumber ,
|
|
898
912
|
ProgressEventsCount ,
|
|
899
|
-
ProgressBatchCount ,
|
|
900
913
|
ProgressLatency ,
|
|
901
914
|
effectLabelsSchema ,
|
|
902
915
|
EffectCalls ,
|
|
@@ -906,4 +919,4 @@ export {
|
|
|
906
919
|
StorageLoad ,
|
|
907
920
|
SinkWrite ,
|
|
908
921
|
}
|
|
909
|
-
/*
|
|
922
|
+
/* metricNames Not a pure module */
|