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
CHANGED
|
@@ -1,45 +1,3 @@
|
|
|
1
|
-
let loadEntitiesDurationCounter = PromClient.Counter.makeCounter({
|
|
2
|
-
"name": "load_entities_processing_time_spent",
|
|
3
|
-
"help": "Duration spend on loading entities",
|
|
4
|
-
"labelNames": [],
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
let eventRouterDurationCounter = PromClient.Counter.makeCounter({
|
|
8
|
-
"name": "event_router_processing_time_spent",
|
|
9
|
-
"help": "Duration spend on event routing",
|
|
10
|
-
"labelNames": [],
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
let executeBatchDurationCounter = PromClient.Counter.makeCounter({
|
|
14
|
-
"name": "execute_batch_processing_time_spent",
|
|
15
|
-
"help": "Duration spend on executing batch",
|
|
16
|
-
"labelNames": [],
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
let storageWriteTimeCounter = PromClient.Counter.makeCounter({
|
|
20
|
-
"name": "envio_storage_write_time",
|
|
21
|
-
"help": "Cumulative time spent writing batches to storage in milliseconds",
|
|
22
|
-
"labelNames": [],
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
let storageWriteCounter = PromClient.Counter.makeCounter({
|
|
26
|
-
"name": "envio_storage_write_count",
|
|
27
|
-
"help": "Total number of batch writes to storage",
|
|
28
|
-
"labelNames": [],
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
let allChainsSyncedToHead = PromClient.Gauge.makeGauge({
|
|
32
|
-
"name": "hyperindex_synced_to_head",
|
|
33
|
-
"help": "All chains fully synced",
|
|
34
|
-
"labelNames": [],
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
let sourceChainHeight = PromClient.Gauge.makeGauge({
|
|
38
|
-
"name": "chain_block_height",
|
|
39
|
-
"help": "Chain Height of Source Chain",
|
|
40
|
-
"labelNames": ["chainId"],
|
|
41
|
-
})
|
|
42
|
-
|
|
43
1
|
module Labels = {
|
|
44
2
|
let rec schemaIsString = (schema: S.t<'a>) =>
|
|
45
3
|
switch schema->S.classify {
|
|
@@ -142,7 +100,13 @@ module SafeCounter = MakeSafePromMetric({
|
|
|
142
100
|
let make = PromClient.Counter.makeCounter
|
|
143
101
|
let labels = PromClient.Counter.labels
|
|
144
102
|
let handleInt = PromClient.Counter.incMany
|
|
145
|
-
let handleFloat =
|
|
103
|
+
let handleFloat =
|
|
104
|
+
PromClient.Counter.incMany->(
|
|
105
|
+
Utils.magic: ((PromClient.Counter.counter, int) => unit) => (
|
|
106
|
+
PromClient.Counter.counter,
|
|
107
|
+
float,
|
|
108
|
+
) => unit
|
|
109
|
+
)
|
|
146
110
|
})
|
|
147
111
|
|
|
148
112
|
module SafeGauge = MakeSafePromMetric({
|
|
@@ -153,117 +117,213 @@ module SafeGauge = MakeSafePromMetric({
|
|
|
153
117
|
let handleFloat = PromClient.Gauge.setFloat
|
|
154
118
|
})
|
|
155
119
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
|
|
120
|
+
|
|
121
|
+
module ProcessingBatch = {
|
|
122
|
+
let loadTimeCounter = PromClient.Counter.makeCounter({
|
|
123
|
+
"name": "envio_preload_seconds",
|
|
124
|
+
"help": "Cumulative time spent on preloading entities during batch processing.",
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
let handlerTimeCounter = PromClient.Counter.makeCounter({
|
|
128
|
+
"name": "envio_processing_seconds",
|
|
129
|
+
"help": "Cumulative time spent executing event handlers during batch processing.",
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
let writeTimeCounter = PromClient.Counter.makeCounter({
|
|
133
|
+
"name": "envio_storage_write_seconds",
|
|
134
|
+
"help": "Cumulative time spent writing batch data to storage.",
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
let writeCount = PromClient.Counter.makeCounter({
|
|
138
|
+
"name": "envio_storage_write_total",
|
|
139
|
+
"help": "Total number of batch writes to storage.",
|
|
162
140
|
})
|
|
163
141
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
->PromClient.
|
|
167
|
-
->PromClient.
|
|
142
|
+
let registerMetrics = (~loadDuration, ~handlerDuration, ~dbWriteDuration) => {
|
|
143
|
+
loadTimeCounter->PromClient.Counter.incMany(loadDuration->(Utils.magic: float => int))
|
|
144
|
+
handlerTimeCounter->PromClient.Counter.incMany(handlerDuration->(Utils.magic: float => int))
|
|
145
|
+
writeTimeCounter->PromClient.Counter.incMany(dbWriteDuration->(Utils.magic: float => int))
|
|
146
|
+
writeCount->PromClient.Counter.inc
|
|
168
147
|
}
|
|
169
148
|
}
|
|
170
149
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
stat: string,
|
|
175
|
-
label: string,
|
|
176
|
-
}
|
|
177
|
-
let labelSchema = S.schema(s => {
|
|
178
|
-
group: s.matches(S.string),
|
|
179
|
-
stat: s.matches(S.string),
|
|
180
|
-
label: s.matches(S.string),
|
|
181
|
-
})
|
|
150
|
+
let chainIdLabelsSchema = S.object(s => {
|
|
151
|
+
s.field("chainId", S.string->S.coerce(S.int))
|
|
152
|
+
})
|
|
182
153
|
|
|
154
|
+
module ProgressReady = {
|
|
183
155
|
let gauge = SafeGauge.makeOrThrow(
|
|
184
|
-
~name="
|
|
185
|
-
~help="
|
|
186
|
-
~labelSchema,
|
|
187
|
-
)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
~
|
|
197
|
-
~sum: float,
|
|
198
|
-
) => {
|
|
199
|
-
let mk = stat => {
|
|
200
|
-
group,
|
|
201
|
-
stat,
|
|
202
|
-
label,
|
|
203
|
-
}
|
|
204
|
-
gauge->SafeGauge.handleFloat(~labels=mk("n"), ~value=n)
|
|
205
|
-
gauge->SafeGauge.handleFloat(~labels=mk("mean"), ~value=mean)
|
|
206
|
-
gauge->SafeGauge.handleFloat(~labels=mk("min"), ~value=min)
|
|
207
|
-
gauge->SafeGauge.handleFloat(~labels=mk("max"), ~value=max)
|
|
208
|
-
gauge->SafeGauge.handleFloat(~labels=mk("sum"), ~value=sum)
|
|
209
|
-
switch stdDev {
|
|
210
|
-
| Some(stdDev) => gauge->SafeGauge.handleFloat(~labels=mk("stdDev"), ~value=stdDev)
|
|
211
|
-
| None => ()
|
|
212
|
-
}
|
|
156
|
+
~name="envio_progress_ready",
|
|
157
|
+
~help="Whether the chain is fully synced to the head.",
|
|
158
|
+
~labelSchema=chainIdLabelsSchema,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
// Keep legacy metric name for backward compatibility
|
|
162
|
+
let legacyGauge = PromClient.Gauge.makeGauge({
|
|
163
|
+
"name": "hyperindex_synced_to_head",
|
|
164
|
+
"help": "All chains fully synced",
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
let init = (~chainId) => {
|
|
168
|
+
gauge->SafeGauge.handleInt(~labels=chainId, ~value=0)
|
|
213
169
|
}
|
|
214
|
-
}
|
|
215
170
|
|
|
216
|
-
let
|
|
217
|
-
|
|
218
|
-
}
|
|
171
|
+
let set = (~chainId) => {
|
|
172
|
+
gauge->SafeGauge.handleInt(~labels=chainId, ~value=1)
|
|
173
|
+
}
|
|
219
174
|
|
|
220
|
-
let
|
|
221
|
-
|
|
175
|
+
let setAllReady = () => {
|
|
176
|
+
legacyGauge->PromClient.Gauge.set(1)
|
|
177
|
+
}
|
|
222
178
|
}
|
|
223
179
|
|
|
224
|
-
let
|
|
225
|
-
|
|
226
|
-
|
|
180
|
+
let handlerLabelsSchema = S.schema(s =>
|
|
181
|
+
{
|
|
182
|
+
"contract": s.matches(S.string),
|
|
183
|
+
"event": s.matches(S.string),
|
|
184
|
+
}
|
|
185
|
+
)
|
|
227
186
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
187
|
+
module ProcessingHandler = {
|
|
188
|
+
let timeCounter = SafeCounter.makeOrThrow(
|
|
189
|
+
~name="envio_processing_handler_seconds",
|
|
190
|
+
~help="Cumulative time spent inside individual event handler executions.",
|
|
191
|
+
~labelSchema=handlerLabelsSchema,
|
|
192
|
+
)
|
|
231
193
|
|
|
232
|
-
let
|
|
233
|
-
|
|
234
|
-
|
|
194
|
+
let count = SafeCounter.makeOrThrow(
|
|
195
|
+
~name="envio_processing_handler_total",
|
|
196
|
+
~help="Total number of individual event handler executions.",
|
|
197
|
+
~labelSchema=handlerLabelsSchema,
|
|
198
|
+
)
|
|
235
199
|
|
|
236
|
-
let
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
200
|
+
let increment = (~contract, ~event, ~duration) => {
|
|
201
|
+
let labels = {"contract": contract, "event": event}
|
|
202
|
+
timeCounter->SafeCounter.handleFloat(~labels, ~value=duration)
|
|
203
|
+
count->SafeCounter.increment(~labels)
|
|
204
|
+
}
|
|
240
205
|
}
|
|
241
206
|
|
|
242
|
-
|
|
243
|
-
|
|
207
|
+
module PreloadHandler = {
|
|
208
|
+
let timeCounter = SafeCounter.makeOrThrow(
|
|
209
|
+
~name="envio_preload_handler_seconds",
|
|
210
|
+
~help="Wall-clock time spent inside individual preload handler executions.",
|
|
211
|
+
~labelSchema=handlerLabelsSchema,
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
let count = SafeCounter.makeOrThrow(
|
|
215
|
+
~name="envio_preload_handler_total",
|
|
216
|
+
~help="Total number of individual preload handler executions.",
|
|
217
|
+
~labelSchema=handlerLabelsSchema,
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
let sumTimeCounter = SafeCounter.makeOrThrow(
|
|
221
|
+
~name="envio_preload_handler_seconds_total",
|
|
222
|
+
~help="Cumulative time spent inside individual preload handler executions. Can exceed wall-clock time due to parallel execution.",
|
|
223
|
+
~labelSchema=handlerLabelsSchema,
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
type operationRef = {
|
|
227
|
+
mutable pendingCount: int,
|
|
228
|
+
timerRef: Hrtime.timeRef,
|
|
229
|
+
}
|
|
230
|
+
let operations: Js.Dict.t<operationRef> = Js.Dict.empty()
|
|
231
|
+
|
|
232
|
+
let makeKey = (~contract, ~event) => contract ++ ":" ++ event
|
|
233
|
+
|
|
234
|
+
let startOperation = (~contract, ~event) => {
|
|
235
|
+
let key = makeKey(~contract, ~event)
|
|
236
|
+
switch operations->Utils.Dict.dangerouslyGetNonOption(key) {
|
|
237
|
+
| Some(operationRef) => operationRef.pendingCount = operationRef.pendingCount + 1
|
|
238
|
+
| None =>
|
|
239
|
+
operations->Js.Dict.set(
|
|
240
|
+
key,
|
|
241
|
+
{
|
|
242
|
+
pendingCount: 1,
|
|
243
|
+
timerRef: Hrtime.makeTimer(),
|
|
244
|
+
},
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
Hrtime.makeTimer()
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
let endOperation = (timerRef, ~contract, ~event) => {
|
|
251
|
+
let key = makeKey(~contract, ~event)
|
|
252
|
+
let labels = {"contract": contract, "event": event}
|
|
253
|
+
let operationRef = operations->Js.Dict.unsafeGet(key)
|
|
254
|
+
operationRef.pendingCount = operationRef.pendingCount - 1
|
|
255
|
+
if operationRef.pendingCount === 0 {
|
|
256
|
+
timeCounter->SafeCounter.handleFloat(
|
|
257
|
+
~labels,
|
|
258
|
+
~value=operationRef.timerRef->Hrtime.timeSince->Hrtime.toSecondsFloat,
|
|
259
|
+
)
|
|
260
|
+
operations->Utils.Dict.deleteInPlace(key)
|
|
261
|
+
}
|
|
262
|
+
sumTimeCounter->SafeCounter.handleFloat(
|
|
263
|
+
~labels,
|
|
264
|
+
~value=timerRef->Hrtime.timeSince->Hrtime.toSecondsFloat,
|
|
265
|
+
)
|
|
266
|
+
count->SafeCounter.increment(~labels)
|
|
267
|
+
}
|
|
244
268
|
}
|
|
245
269
|
|
|
246
|
-
module
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
270
|
+
module FetchingBlockRange = {
|
|
271
|
+
let timeCounter = SafeCounter.makeOrThrow(
|
|
272
|
+
~name="envio_fetching_block_range_seconds",
|
|
273
|
+
~help="Cumulative time spent fetching block ranges.",
|
|
274
|
+
~labelSchema=chainIdLabelsSchema,
|
|
275
|
+
)
|
|
251
276
|
|
|
252
|
-
let
|
|
253
|
-
~name="
|
|
254
|
-
~help="
|
|
255
|
-
~labelSchema,
|
|
277
|
+
let parseTimeCounter = SafeCounter.makeOrThrow(
|
|
278
|
+
~name="envio_fetching_block_range_parse_seconds",
|
|
279
|
+
~help="Cumulative time spent parsing block range fetch responses.",
|
|
280
|
+
~labelSchema=chainIdLabelsSchema,
|
|
256
281
|
)
|
|
257
282
|
|
|
258
|
-
let
|
|
259
|
-
|
|
260
|
-
|
|
283
|
+
let count = SafeCounter.makeOrThrow(
|
|
284
|
+
~name="envio_fetching_block_range_total",
|
|
285
|
+
~help="Total number of block range fetch operations.",
|
|
286
|
+
~labelSchema=chainIdLabelsSchema,
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
let eventsCount = SafeCounter.makeOrThrow(
|
|
290
|
+
~name="envio_fetching_block_range_events_total",
|
|
291
|
+
~help="Cumulative number of events fetched across all block range operations.",
|
|
292
|
+
~labelSchema=chainIdLabelsSchema,
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
let sizeCounter = SafeCounter.makeOrThrow(
|
|
296
|
+
~name="envio_fetching_block_range_size",
|
|
297
|
+
~help="Cumulative number of blocks covered across all block range fetch operations.",
|
|
298
|
+
~labelSchema=chainIdLabelsSchema,
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
let increment = (
|
|
302
|
+
~chainId,
|
|
303
|
+
~totalTimeElapsed,
|
|
304
|
+
~parsingTimeElapsed,
|
|
305
|
+
~numEvents,
|
|
306
|
+
~blockRangeSize,
|
|
307
|
+
) => {
|
|
308
|
+
timeCounter->SafeCounter.handleFloat(~labels=chainId, ~value=totalTimeElapsed)
|
|
309
|
+
parseTimeCounter->SafeCounter.handleFloat(~labels=chainId, ~value=parsingTimeElapsed)
|
|
310
|
+
count->SafeCounter.increment(~labels=chainId)
|
|
311
|
+
eventsCount->SafeCounter.handleInt(~labels=chainId, ~value=numEvents)
|
|
312
|
+
sizeCounter->SafeCounter.handleInt(~labels=chainId, ~value=blockRangeSize)
|
|
261
313
|
}
|
|
262
314
|
}
|
|
263
315
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
316
|
+
module IndexingKnownHeight = {
|
|
317
|
+
let gauge = SafeGauge.makeOrThrow(
|
|
318
|
+
~name="envio_indexing_known_height",
|
|
319
|
+
~help="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.",
|
|
320
|
+
~labelSchema=chainIdLabelsSchema,
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
let set = (~blockNumber, ~chainId) => {
|
|
324
|
+
gauge->SafeGauge.handleInt(~labels=chainId, ~value=blockNumber)
|
|
325
|
+
}
|
|
326
|
+
}
|
|
267
327
|
|
|
268
328
|
module Info = {
|
|
269
329
|
let gauge = SafeGauge.makeOrThrow(
|
|
@@ -281,6 +341,17 @@ module Info = {
|
|
|
281
341
|
}
|
|
282
342
|
}
|
|
283
343
|
|
|
344
|
+
module ProcessStartTimeSeconds = {
|
|
345
|
+
let gauge = PromClient.Gauge.makeGauge({
|
|
346
|
+
"name": "envio_process_start_time_seconds",
|
|
347
|
+
"help": "Start time of the process since unix epoch in seconds.",
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
let set = () => {
|
|
351
|
+
gauge->PromClient.Gauge.setFloat(Js.Date.now() /. 1000.0)
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
284
355
|
module IndexingAddresses = {
|
|
285
356
|
let gauge = SafeGauge.makeOrThrow(
|
|
286
357
|
~name="envio_indexing_addresses",
|
|
@@ -331,24 +402,24 @@ module IndexingPartitions = {
|
|
|
331
402
|
|
|
332
403
|
module IndexingIdleTime = {
|
|
333
404
|
let counter = SafeCounter.makeOrThrow(
|
|
334
|
-
~name="
|
|
335
|
-
~help="The
|
|
405
|
+
~name="envio_indexing_idle_seconds",
|
|
406
|
+
~help="The time the indexer source syncing has been idle. A high value may indicate the source sync is a bottleneck.",
|
|
336
407
|
~labelSchema=chainIdLabelsSchema,
|
|
337
408
|
)
|
|
338
409
|
}
|
|
339
410
|
|
|
340
411
|
module IndexingSourceWaitingTime = {
|
|
341
412
|
let counter = SafeCounter.makeOrThrow(
|
|
342
|
-
~name="
|
|
343
|
-
~help="The
|
|
413
|
+
~name="envio_indexing_source_waiting_seconds",
|
|
414
|
+
~help="The time the indexer has been waiting for new blocks.",
|
|
344
415
|
~labelSchema=chainIdLabelsSchema,
|
|
345
416
|
)
|
|
346
417
|
}
|
|
347
418
|
|
|
348
419
|
module IndexingQueryTime = {
|
|
349
420
|
let counter = SafeCounter.makeOrThrow(
|
|
350
|
-
~name="
|
|
351
|
-
~help="The
|
|
421
|
+
~name="envio_indexing_source_querying_seconds",
|
|
422
|
+
~help="The time spent performing queries to the chain data-source.",
|
|
352
423
|
~labelSchema=chainIdLabelsSchema,
|
|
353
424
|
)
|
|
354
425
|
}
|
|
@@ -377,22 +448,13 @@ module IndexingTargetBufferSize = {
|
|
|
377
448
|
}
|
|
378
449
|
|
|
379
450
|
module IndexingBufferBlockNumber = {
|
|
380
|
-
let deprecatedGauge = PromClient.Gauge.makeGauge({
|
|
381
|
-
"name": "chain_block_height_fully_fetched",
|
|
382
|
-
"help": "Block height fully fetched by indexer",
|
|
383
|
-
"labelNames": ["chainId"],
|
|
384
|
-
})
|
|
385
|
-
|
|
386
451
|
let gauge = SafeGauge.makeOrThrow(
|
|
387
|
-
~name="
|
|
452
|
+
~name="envio_indexing_buffer_block",
|
|
388
453
|
~help="The highest block number that has been fully fetched by the indexer.",
|
|
389
454
|
~labelSchema=chainIdLabelsSchema,
|
|
390
455
|
)
|
|
391
456
|
|
|
392
457
|
let set = (~blockNumber, ~chainId) => {
|
|
393
|
-
deprecatedGauge
|
|
394
|
-
->PromClient.Gauge.labels({"chainId": chainId})
|
|
395
|
-
->PromClient.Gauge.set(blockNumber)
|
|
396
458
|
gauge->SafeGauge.handleInt(~labels=chainId, ~value=blockNumber)
|
|
397
459
|
}
|
|
398
460
|
}
|
|
@@ -416,9 +478,44 @@ let sourceLabelsSchema = S.schema(s =>
|
|
|
416
478
|
}
|
|
417
479
|
)
|
|
418
480
|
|
|
481
|
+
let sourceRequestLabelsSchema = S.schema(s =>
|
|
482
|
+
{
|
|
483
|
+
"source": s.matches(S.string),
|
|
484
|
+
"chainId": s.matches(S.string->S.coerce(S.int)),
|
|
485
|
+
"method": s.matches(S.string),
|
|
486
|
+
}
|
|
487
|
+
)
|
|
488
|
+
|
|
489
|
+
module SourceRequestCount = {
|
|
490
|
+
let counter = SafeCounter.makeOrThrow(
|
|
491
|
+
~name="envio_source_request_total",
|
|
492
|
+
~help="The number of requests made to data sources.",
|
|
493
|
+
~labelSchema=sourceRequestLabelsSchema,
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
let sumTimeCounter = SafeCounter.makeOrThrow(
|
|
497
|
+
~name="envio_source_request_seconds_total",
|
|
498
|
+
~help="Cumulative time spent on data source requests.",
|
|
499
|
+
~labelSchema=sourceRequestLabelsSchema,
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
let increment = (~sourceName, ~chainId, ~method) => {
|
|
503
|
+
counter->SafeCounter.increment(
|
|
504
|
+
~labels={"source": sourceName, "chainId": chainId, "method": method},
|
|
505
|
+
)
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
let addSeconds = (~sourceName, ~chainId, ~method, ~seconds) => {
|
|
509
|
+
sumTimeCounter->SafeCounter.handleFloat(
|
|
510
|
+
~labels={"source": sourceName, "chainId": chainId, "method": method},
|
|
511
|
+
~value=seconds,
|
|
512
|
+
)
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
419
516
|
module SourceHeight = {
|
|
420
517
|
let gauge = SafeGauge.makeOrThrow(
|
|
421
|
-
~name="
|
|
518
|
+
~name="envio_source_known_height",
|
|
422
519
|
~help="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.",
|
|
423
520
|
~labelSchema=sourceLabelsSchema,
|
|
424
521
|
)
|
|
@@ -431,30 +528,21 @@ module SourceHeight = {
|
|
|
431
528
|
}
|
|
432
529
|
}
|
|
433
530
|
|
|
434
|
-
module SourceGetHeightDuration = {
|
|
435
|
-
let startTimer = makeSafeHistogramOrThrow(
|
|
436
|
-
~name="envio_source_get_height_duration",
|
|
437
|
-
~help="Duration of the source get height requests in seconds",
|
|
438
|
-
~labelSchema=sourceLabelsSchema,
|
|
439
|
-
~backets=[0.1, 0.5, 1., 10.],
|
|
440
|
-
)
|
|
441
|
-
}
|
|
442
|
-
|
|
443
531
|
module ReorgCount = {
|
|
444
|
-
let
|
|
445
|
-
~name="
|
|
532
|
+
let counter = SafeCounter.makeOrThrow(
|
|
533
|
+
~name="envio_reorg_detected_total",
|
|
446
534
|
~help="Total number of reorgs detected",
|
|
447
535
|
~labelSchema=chainIdLabelsSchema,
|
|
448
536
|
)
|
|
449
537
|
|
|
450
538
|
let increment = (~chain) => {
|
|
451
|
-
|
|
539
|
+
counter->SafeCounter.increment(~labels=chain->ChainMap.Chain.toChainId)
|
|
452
540
|
}
|
|
453
541
|
}
|
|
454
542
|
|
|
455
543
|
module ReorgDetectionBlockNumber = {
|
|
456
544
|
let gauge = SafeGauge.makeOrThrow(
|
|
457
|
-
~name="
|
|
545
|
+
~name="envio_reorg_detected_block",
|
|
458
546
|
~help="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.",
|
|
459
547
|
~labelSchema=chainIdLabelsSchema,
|
|
460
548
|
)
|
|
@@ -488,24 +576,26 @@ module RollbackEnabled = {
|
|
|
488
576
|
|
|
489
577
|
module RollbackSuccess = {
|
|
490
578
|
let timeCounter = PromClient.Counter.makeCounter({
|
|
491
|
-
"name": "
|
|
492
|
-
"help": "Rollback on reorg total time
|
|
579
|
+
"name": "envio_rollback_seconds",
|
|
580
|
+
"help": "Rollback on reorg total time.",
|
|
493
581
|
})
|
|
494
582
|
|
|
495
583
|
let counter = PromClient.Counter.makeCounter({
|
|
496
|
-
"name": "
|
|
584
|
+
"name": "envio_rollback_total",
|
|
497
585
|
"help": "Number of successful rollbacks on reorg",
|
|
498
586
|
})
|
|
499
587
|
|
|
500
588
|
let eventsCounter = PromClient.Counter.makeCounter({
|
|
501
|
-
"name": "
|
|
589
|
+
"name": "envio_rollback_events",
|
|
502
590
|
"help": "Number of events rollbacked on reorg",
|
|
503
591
|
})
|
|
504
592
|
|
|
505
|
-
let increment = (~
|
|
506
|
-
timeCounter->PromClient.Counter.incMany(
|
|
593
|
+
let increment = (~timeSeconds: float, ~rollbackedProcessedEvents: float) => {
|
|
594
|
+
timeCounter->PromClient.Counter.incMany(timeSeconds->(Utils.magic: float => int))
|
|
507
595
|
counter->PromClient.Counter.inc
|
|
508
|
-
eventsCounter->PromClient.Counter.incMany(
|
|
596
|
+
eventsCounter->PromClient.Counter.incMany(
|
|
597
|
+
rollbackedProcessedEvents->Utils.floatToInt,
|
|
598
|
+
)
|
|
509
599
|
}
|
|
510
600
|
}
|
|
511
601
|
|
|
@@ -513,29 +603,26 @@ module RollbackHistoryPrune = {
|
|
|
513
603
|
let entityNameLabelsSchema = S.object(s => s.field("entity", S.string))
|
|
514
604
|
|
|
515
605
|
let timeCounter = SafeCounter.makeOrThrow(
|
|
516
|
-
~name="
|
|
517
|
-
~help="The total time spent pruning entity history which is not in the reorg threshold.
|
|
606
|
+
~name="envio_rollback_history_prune_seconds",
|
|
607
|
+
~help="The total time spent pruning entity history which is not in the reorg threshold.",
|
|
518
608
|
~labelSchema=entityNameLabelsSchema,
|
|
519
609
|
)
|
|
520
610
|
|
|
521
611
|
let counter = SafeCounter.makeOrThrow(
|
|
522
|
-
~name="
|
|
612
|
+
~name="envio_rollback_history_prune_total",
|
|
523
613
|
~help="Number of successful entity history prunes",
|
|
524
614
|
~labelSchema=entityNameLabelsSchema,
|
|
525
615
|
)
|
|
526
616
|
|
|
527
|
-
let increment = (~
|
|
528
|
-
timeCounter->SafeCounter.
|
|
529
|
-
~labels={entityName},
|
|
530
|
-
~value=timeMillis->Hrtime.intFromMillis,
|
|
531
|
-
)
|
|
617
|
+
let increment = (~timeSeconds, ~entityName) => {
|
|
618
|
+
timeCounter->SafeCounter.handleFloat(~labels={entityName}, ~value=timeSeconds)
|
|
532
619
|
counter->SafeCounter.increment(~labels={entityName})
|
|
533
620
|
}
|
|
534
621
|
}
|
|
535
622
|
|
|
536
623
|
module RollbackTargetBlockNumber = {
|
|
537
624
|
let gauge = SafeGauge.makeOrThrow(
|
|
538
|
-
~name="
|
|
625
|
+
~name="envio_rollback_target_block",
|
|
539
626
|
~help="The block number reorg was rollbacked to the last time.",
|
|
540
627
|
~labelSchema=chainIdLabelsSchema,
|
|
541
628
|
)
|
|
@@ -558,7 +645,7 @@ module ProcessingMaxBatchSize = {
|
|
|
558
645
|
|
|
559
646
|
module ProgressBlockNumber = {
|
|
560
647
|
let gauge = SafeGauge.makeOrThrow(
|
|
561
|
-
~name="
|
|
648
|
+
~name="envio_progress_block",
|
|
562
649
|
~help="The block number of the latest block processed and stored in the database.",
|
|
563
650
|
~labelSchema=chainIdLabelsSchema,
|
|
564
651
|
)
|
|
@@ -569,34 +656,17 @@ module ProgressBlockNumber = {
|
|
|
569
656
|
}
|
|
570
657
|
|
|
571
658
|
module ProgressEventsCount = {
|
|
572
|
-
let deprecatedGauge = PromClient.Gauge.makeGauge({
|
|
573
|
-
"name": "events_processed",
|
|
574
|
-
"help": "Total number of events processed",
|
|
575
|
-
"labelNames": ["chainId"],
|
|
576
|
-
})
|
|
577
|
-
|
|
578
659
|
let gauge = SafeGauge.makeOrThrow(
|
|
579
|
-
~name="
|
|
660
|
+
~name="envio_progress_events",
|
|
580
661
|
~help="The number of events processed and reflected in the database.",
|
|
581
662
|
~labelSchema=chainIdLabelsSchema,
|
|
582
663
|
)
|
|
583
664
|
|
|
584
|
-
let set = (~processedCount, ~chainId) => {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
module ProgressBatchCount = {
|
|
593
|
-
let counter = PromClient.Counter.makeCounter({
|
|
594
|
-
"name": "envio_progress_batches_count",
|
|
595
|
-
"help": "The number of batches processed and reflected in the database.",
|
|
596
|
-
})
|
|
597
|
-
|
|
598
|
-
let increment = () => {
|
|
599
|
-
counter->PromClient.Counter.inc
|
|
665
|
+
let set = (~processedCount: float, ~chainId) => {
|
|
666
|
+
gauge->SafeGauge.handleFloat(
|
|
667
|
+
~labels=chainId,
|
|
668
|
+
~value=processedCount,
|
|
669
|
+
)
|
|
600
670
|
}
|
|
601
671
|
}
|
|
602
672
|
|
|
@@ -618,25 +688,25 @@ let effectLabelsSchema = S.object(s => {
|
|
|
618
688
|
|
|
619
689
|
module EffectCalls = {
|
|
620
690
|
let timeCounter = SafeCounter.makeOrThrow(
|
|
621
|
-
~name="
|
|
622
|
-
~help="Processing time taken to call the Effect function.
|
|
691
|
+
~name="envio_effect_call_seconds",
|
|
692
|
+
~help="Processing time taken to call the Effect function.",
|
|
623
693
|
~labelSchema=effectLabelsSchema,
|
|
624
694
|
)
|
|
625
695
|
|
|
626
696
|
let sumTimeCounter = SafeCounter.makeOrThrow(
|
|
627
|
-
~name="
|
|
628
|
-
~help="Cumulative time spent calling the Effect function during the indexing process.
|
|
697
|
+
~name="envio_effect_call_seconds_total",
|
|
698
|
+
~help="Cumulative time spent calling the Effect function during the indexing process.",
|
|
629
699
|
~labelSchema=effectLabelsSchema,
|
|
630
700
|
)
|
|
631
701
|
|
|
632
702
|
let totalCallsCount = SafeCounter.makeOrThrow(
|
|
633
|
-
~name="
|
|
703
|
+
~name="envio_effect_call_total",
|
|
634
704
|
~help="Cumulative number of resolved Effect function calls during the indexing process.",
|
|
635
705
|
~labelSchema=effectLabelsSchema,
|
|
636
706
|
)
|
|
637
707
|
|
|
638
708
|
let activeCallsCount = SafeGauge.makeOrThrow(
|
|
639
|
-
~name="
|
|
709
|
+
~name="envio_effect_active_calls",
|
|
640
710
|
~help="The number of Effect function calls that are currently running.",
|
|
641
711
|
~labelSchema=effectLabelsSchema,
|
|
642
712
|
)
|
|
@@ -644,7 +714,7 @@ module EffectCalls = {
|
|
|
644
714
|
|
|
645
715
|
module EffectCacheCount = {
|
|
646
716
|
let gauge = SafeGauge.makeOrThrow(
|
|
647
|
-
~name="
|
|
717
|
+
~name="envio_effect_cache",
|
|
648
718
|
~help="The number of items in the effect cache.",
|
|
649
719
|
~labelSchema=effectLabelsSchema,
|
|
650
720
|
)
|
|
@@ -656,7 +726,7 @@ module EffectCacheCount = {
|
|
|
656
726
|
|
|
657
727
|
module EffectCacheInvalidationsCount = {
|
|
658
728
|
let counter = SafeCounter.makeOrThrow(
|
|
659
|
-
~name="
|
|
729
|
+
~name="envio_effect_cache_invalidations",
|
|
660
730
|
~help="The number of effect cache invalidations.",
|
|
661
731
|
~labelSchema=effectLabelsSchema,
|
|
662
732
|
)
|
|
@@ -668,14 +738,14 @@ module EffectCacheInvalidationsCount = {
|
|
|
668
738
|
|
|
669
739
|
module EffectQueueCount = {
|
|
670
740
|
let gauge = SafeGauge.makeOrThrow(
|
|
671
|
-
~name="
|
|
741
|
+
~name="envio_effect_queue",
|
|
672
742
|
~help="The number of effect calls waiting in the rate limit queue.",
|
|
673
743
|
~labelSchema=effectLabelsSchema,
|
|
674
744
|
)
|
|
675
745
|
|
|
676
746
|
let timeCounter = SafeCounter.makeOrThrow(
|
|
677
|
-
~name="
|
|
678
|
-
~help="The time spent waiting in the rate limit queue.
|
|
747
|
+
~name="envio_effect_queue_wait_seconds",
|
|
748
|
+
~help="The time spent waiting in the rate limit queue.",
|
|
679
749
|
~labelSchema=effectLabelsSchema,
|
|
680
750
|
)
|
|
681
751
|
|
|
@@ -688,19 +758,19 @@ module StorageLoad = {
|
|
|
688
758
|
let operationLabelsSchema = S.object(s => s.field("operation", S.string))
|
|
689
759
|
|
|
690
760
|
let timeCounter = SafeCounter.makeOrThrow(
|
|
691
|
-
~name="
|
|
692
|
-
~help="Processing time taken to load data from storage.
|
|
761
|
+
~name="envio_storage_load_seconds",
|
|
762
|
+
~help="Processing time taken to load data from storage.",
|
|
693
763
|
~labelSchema=operationLabelsSchema,
|
|
694
764
|
)
|
|
695
765
|
|
|
696
766
|
let sumTimeCounter = SafeCounter.makeOrThrow(
|
|
697
|
-
~name="
|
|
698
|
-
~help="Cumulative time spent loading data from storage during the indexing process.
|
|
767
|
+
~name="envio_storage_load_seconds_total",
|
|
768
|
+
~help="Cumulative time spent loading data from storage during the indexing process.",
|
|
699
769
|
~labelSchema=operationLabelsSchema,
|
|
700
770
|
)
|
|
701
771
|
|
|
702
772
|
let counter = SafeCounter.makeOrThrow(
|
|
703
|
-
~name="
|
|
773
|
+
~name="envio_storage_load_total",
|
|
704
774
|
~help="Cumulative number of successful storage load operations during the indexing process.",
|
|
705
775
|
~labelSchema=operationLabelsSchema,
|
|
706
776
|
)
|
|
@@ -744,15 +814,15 @@ module StorageLoad = {
|
|
|
744
814
|
let operationRef = operations->Js.Dict.unsafeGet(operation)
|
|
745
815
|
operationRef.pendingCount = operationRef.pendingCount - 1
|
|
746
816
|
if operationRef.pendingCount === 0 {
|
|
747
|
-
timeCounter->SafeCounter.
|
|
817
|
+
timeCounter->SafeCounter.handleFloat(
|
|
748
818
|
~labels={operation},
|
|
749
|
-
~value=operationRef.timerRef->Hrtime.timeSince->Hrtime.
|
|
819
|
+
~value=operationRef.timerRef->Hrtime.timeSince->Hrtime.toSecondsFloat,
|
|
750
820
|
)
|
|
751
821
|
operations->Utils.Dict.deleteInPlace(operation)
|
|
752
822
|
}
|
|
753
|
-
sumTimeCounter->SafeCounter.
|
|
823
|
+
sumTimeCounter->SafeCounter.handleFloat(
|
|
754
824
|
~labels={operation},
|
|
755
|
-
~value=timerRef->Hrtime.timeSince->Hrtime.
|
|
825
|
+
~value=timerRef->Hrtime.timeSince->Hrtime.toSecondsFloat,
|
|
756
826
|
)
|
|
757
827
|
counter->SafeCounter.increment(~labels={operation})
|
|
758
828
|
whereSizeCounter->SafeCounter.handleInt(~labels={operation}, ~value=whereSize)
|
|
@@ -764,19 +834,19 @@ module SinkWrite = {
|
|
|
764
834
|
let sinkLabelsSchema = S.object(s => s.field("sink", S.string))
|
|
765
835
|
|
|
766
836
|
let timeCounter = SafeCounter.makeOrThrow(
|
|
767
|
-
~name="
|
|
768
|
-
~help="Processing time taken to write data to sink.
|
|
837
|
+
~name="envio_sink_write_seconds",
|
|
838
|
+
~help="Processing time taken to write data to sink.",
|
|
769
839
|
~labelSchema=sinkLabelsSchema,
|
|
770
840
|
)
|
|
771
841
|
|
|
772
842
|
let counter = SafeCounter.makeOrThrow(
|
|
773
|
-
~name="
|
|
843
|
+
~name="envio_sink_write_total",
|
|
774
844
|
~help="Cumulative number of successful sink write operations during the indexing process.",
|
|
775
845
|
~labelSchema=sinkLabelsSchema,
|
|
776
846
|
)
|
|
777
847
|
|
|
778
|
-
let increment = (~sinkName, ~
|
|
779
|
-
timeCounter->SafeCounter.
|
|
848
|
+
let increment = (~sinkName, ~timeSeconds) => {
|
|
849
|
+
timeCounter->SafeCounter.handleFloat(~labels={sinkName}, ~value=timeSeconds)
|
|
780
850
|
counter->SafeCounter.increment(~labels={sinkName})
|
|
781
851
|
}
|
|
782
852
|
}
|