envio 3.0.0-alpha.21 → 3.0.0-alpha.23

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.
Files changed (220) hide show
  1. package/README.md +3 -3
  2. package/bin.mjs +2 -48
  3. package/evm.schema.json +67 -0
  4. package/fuel.schema.json +67 -0
  5. package/index.d.ts +822 -38
  6. package/index.js +5 -3
  7. package/package.json +10 -8
  8. package/rescript.json +5 -9
  9. package/src/Address.res +4 -5
  10. package/src/Address.res.mjs +9 -12
  11. package/src/Api.res +15 -0
  12. package/src/Api.res.mjs +20 -0
  13. package/src/Batch.res +32 -34
  14. package/src/Batch.res.mjs +172 -187
  15. package/src/Bin.res +89 -0
  16. package/src/Bin.res.mjs +97 -0
  17. package/src/ChainFetcher.res +33 -57
  18. package/src/ChainFetcher.res.mjs +197 -227
  19. package/src/ChainManager.res +6 -14
  20. package/src/ChainManager.res.mjs +74 -85
  21. package/src/ChainMap.res +14 -16
  22. package/src/ChainMap.res.mjs +38 -38
  23. package/src/Config.res +193 -135
  24. package/src/Config.res.mjs +566 -592
  25. package/src/Core.res +182 -0
  26. package/src/Core.res.mjs +207 -0
  27. package/src/Ecosystem.res +25 -4
  28. package/src/Ecosystem.res.mjs +12 -13
  29. package/src/Env.res +20 -13
  30. package/src/Env.res.mjs +124 -113
  31. package/src/EnvSafe.res +269 -0
  32. package/src/EnvSafe.res.mjs +296 -0
  33. package/src/EnvSafe.resi +18 -0
  34. package/src/Envio.res +37 -26
  35. package/src/Envio.res.mjs +59 -60
  36. package/src/ErrorHandling.res +2 -2
  37. package/src/ErrorHandling.res.mjs +15 -15
  38. package/src/EventConfigBuilder.res +219 -81
  39. package/src/EventConfigBuilder.res.mjs +259 -202
  40. package/src/EventProcessing.res +27 -38
  41. package/src/EventProcessing.res.mjs +165 -183
  42. package/src/EventUtils.res +11 -11
  43. package/src/EventUtils.res.mjs +21 -22
  44. package/src/EvmTypes.res +0 -1
  45. package/src/EvmTypes.res.mjs +5 -5
  46. package/src/FetchState.res +360 -256
  47. package/src/FetchState.res.mjs +958 -914
  48. package/src/GlobalState.res +365 -351
  49. package/src/GlobalState.res.mjs +958 -992
  50. package/src/GlobalStateManager.res +1 -2
  51. package/src/GlobalStateManager.res.mjs +36 -44
  52. package/src/HandlerLoader.res +107 -23
  53. package/src/HandlerLoader.res.mjs +128 -38
  54. package/src/HandlerRegister.res +127 -103
  55. package/src/HandlerRegister.res.mjs +164 -164
  56. package/src/HandlerRegister.resi +12 -4
  57. package/src/Hasura.res +35 -22
  58. package/src/Hasura.res.mjs +158 -167
  59. package/src/InMemoryStore.res +20 -27
  60. package/src/InMemoryStore.res.mjs +64 -80
  61. package/src/InMemoryTable.res +34 -39
  62. package/src/InMemoryTable.res.mjs +165 -170
  63. package/src/Internal.res +52 -33
  64. package/src/Internal.res.mjs +84 -81
  65. package/src/LazyLoader.res.mjs +55 -61
  66. package/src/LoadLayer.res +77 -78
  67. package/src/LoadLayer.res.mjs +160 -189
  68. package/src/LoadManager.res +16 -21
  69. package/src/LoadManager.res.mjs +79 -84
  70. package/src/LogSelection.res +236 -68
  71. package/src/LogSelection.res.mjs +211 -141
  72. package/src/Logging.res +13 -9
  73. package/src/Logging.res.mjs +130 -143
  74. package/src/Main.res +430 -51
  75. package/src/Main.res.mjs +530 -271
  76. package/src/Persistence.res +80 -84
  77. package/src/Persistence.res.mjs +131 -132
  78. package/src/PgStorage.res +294 -167
  79. package/src/PgStorage.res.mjs +799 -817
  80. package/src/Prometheus.res +50 -58
  81. package/src/Prometheus.res.mjs +345 -373
  82. package/src/ReorgDetection.res +22 -24
  83. package/src/ReorgDetection.res.mjs +100 -106
  84. package/src/SafeCheckpointTracking.res +7 -7
  85. package/src/SafeCheckpointTracking.res.mjs +40 -43
  86. package/src/SimulateItems.res +41 -49
  87. package/src/SimulateItems.res.mjs +257 -272
  88. package/src/Sink.res +2 -2
  89. package/src/Sink.res.mjs +22 -26
  90. package/src/TableIndices.res +1 -2
  91. package/src/TableIndices.res.mjs +42 -48
  92. package/src/TestIndexer.res +196 -189
  93. package/src/TestIndexer.res.mjs +536 -536
  94. package/src/TestIndexerProxyStorage.res +16 -16
  95. package/src/TestIndexerProxyStorage.res.mjs +99 -122
  96. package/src/TestIndexerWorker.res +4 -0
  97. package/src/TestIndexerWorker.res.mjs +7 -0
  98. package/src/Throttler.res +3 -3
  99. package/src/Throttler.res.mjs +23 -24
  100. package/src/Time.res +1 -1
  101. package/src/Time.res.mjs +18 -21
  102. package/src/TopicFilter.res +3 -3
  103. package/src/TopicFilter.res.mjs +29 -30
  104. package/src/UserContext.res +93 -54
  105. package/src/UserContext.res.mjs +197 -182
  106. package/src/Utils.res +141 -86
  107. package/src/Utils.res.mjs +334 -295
  108. package/src/bindings/BigDecimal.res +0 -2
  109. package/src/bindings/BigDecimal.res.mjs +19 -23
  110. package/src/bindings/ClickHouse.res +28 -27
  111. package/src/bindings/ClickHouse.res.mjs +243 -240
  112. package/src/bindings/DateFns.res +11 -11
  113. package/src/bindings/DateFns.res.mjs +7 -7
  114. package/src/bindings/EventSource.res.mjs +2 -2
  115. package/src/bindings/Express.res +2 -5
  116. package/src/bindings/Hrtime.res +2 -2
  117. package/src/bindings/Hrtime.res.mjs +30 -32
  118. package/src/bindings/Lodash.res.mjs +1 -1
  119. package/src/bindings/NodeJs.res +14 -9
  120. package/src/bindings/NodeJs.res.mjs +20 -20
  121. package/src/bindings/Pino.res +8 -10
  122. package/src/bindings/Pino.res.mjs +40 -43
  123. package/src/bindings/Postgres.res +7 -5
  124. package/src/bindings/Postgres.res.mjs +9 -9
  125. package/src/bindings/PromClient.res +17 -2
  126. package/src/bindings/PromClient.res.mjs +30 -7
  127. package/src/bindings/SDSL.res.mjs +2 -2
  128. package/src/bindings/Viem.res +4 -4
  129. package/src/bindings/Viem.res.mjs +20 -22
  130. package/src/bindings/Vitest.res +1 -1
  131. package/src/bindings/Vitest.res.mjs +2 -2
  132. package/src/bindings/WebSocket.res +1 -1
  133. package/src/db/EntityHistory.res +9 -3
  134. package/src/db/EntityHistory.res.mjs +84 -59
  135. package/src/db/InternalTable.res +62 -60
  136. package/src/db/InternalTable.res.mjs +271 -203
  137. package/src/db/Schema.res +1 -2
  138. package/src/db/Schema.res.mjs +28 -32
  139. package/src/db/Table.res +28 -27
  140. package/src/db/Table.res.mjs +276 -292
  141. package/src/sources/EventRouter.res +21 -16
  142. package/src/sources/EventRouter.res.mjs +55 -57
  143. package/src/sources/Evm.res +17 -1
  144. package/src/sources/Evm.res.mjs +16 -8
  145. package/src/sources/EvmChain.res +15 -17
  146. package/src/sources/EvmChain.res.mjs +40 -42
  147. package/src/sources/Fuel.res +14 -1
  148. package/src/sources/Fuel.res.mjs +16 -8
  149. package/src/sources/FuelSDK.res +1 -1
  150. package/src/sources/FuelSDK.res.mjs +6 -8
  151. package/src/sources/HyperFuel.res +8 -10
  152. package/src/sources/HyperFuel.res.mjs +113 -123
  153. package/src/sources/HyperFuelClient.res.mjs +6 -7
  154. package/src/sources/HyperFuelSource.res +19 -20
  155. package/src/sources/HyperFuelSource.res.mjs +339 -356
  156. package/src/sources/HyperSync.res +11 -13
  157. package/src/sources/HyperSync.res.mjs +206 -220
  158. package/src/sources/HyperSyncClient.res +5 -7
  159. package/src/sources/HyperSyncClient.res.mjs +70 -75
  160. package/src/sources/HyperSyncHeightStream.res +8 -9
  161. package/src/sources/HyperSyncHeightStream.res.mjs +78 -86
  162. package/src/sources/HyperSyncJsonApi.res +18 -15
  163. package/src/sources/HyperSyncJsonApi.res.mjs +201 -231
  164. package/src/sources/HyperSyncSource.res +17 -21
  165. package/src/sources/HyperSyncSource.res.mjs +268 -290
  166. package/src/sources/Rpc.res +5 -5
  167. package/src/sources/Rpc.res.mjs +168 -192
  168. package/src/sources/RpcSource.res +166 -167
  169. package/src/sources/RpcSource.res.mjs +972 -1046
  170. package/src/sources/RpcWebSocketHeightStream.res +10 -11
  171. package/src/sources/RpcWebSocketHeightStream.res.mjs +131 -145
  172. package/src/sources/SimulateSource.res +1 -1
  173. package/src/sources/SimulateSource.res.mjs +35 -38
  174. package/src/sources/Source.res +1 -1
  175. package/src/sources/Source.res.mjs +3 -3
  176. package/src/sources/SourceManager.res +39 -20
  177. package/src/sources/SourceManager.res.mjs +340 -371
  178. package/src/sources/SourceManager.resi +2 -1
  179. package/src/sources/Svm.res +12 -5
  180. package/src/sources/Svm.res.mjs +44 -41
  181. package/src/tui/Tui.res +23 -12
  182. package/src/tui/Tui.res.mjs +292 -290
  183. package/src/tui/bindings/Ink.res +2 -4
  184. package/src/tui/bindings/Ink.res.mjs +35 -41
  185. package/src/tui/components/BufferedProgressBar.res +7 -7
  186. package/src/tui/components/BufferedProgressBar.res.mjs +46 -46
  187. package/src/tui/components/CustomHooks.res +1 -2
  188. package/src/tui/components/CustomHooks.res.mjs +102 -122
  189. package/src/tui/components/Messages.res +1 -2
  190. package/src/tui/components/Messages.res.mjs +38 -42
  191. package/src/tui/components/SyncETA.res +10 -11
  192. package/src/tui/components/SyncETA.res.mjs +178 -196
  193. package/src/tui/components/TuiData.res +1 -1
  194. package/src/tui/components/TuiData.res.mjs +7 -6
  195. package/src/vendored/Rest.res +52 -66
  196. package/src/vendored/Rest.res.mjs +324 -364
  197. package/svm.schema.json +67 -0
  198. package/src/Address.gen.ts +0 -8
  199. package/src/Config.gen.ts +0 -19
  200. package/src/Envio.gen.ts +0 -55
  201. package/src/EvmTypes.gen.ts +0 -6
  202. package/src/InMemoryStore.gen.ts +0 -6
  203. package/src/Internal.gen.ts +0 -64
  204. package/src/PgStorage.gen.ts +0 -10
  205. package/src/PgStorage.res.d.mts +0 -5
  206. package/src/Types.ts +0 -56
  207. package/src/bindings/BigDecimal.gen.ts +0 -14
  208. package/src/bindings/BigDecimal.res.d.mts +0 -5
  209. package/src/bindings/BigInt.gen.ts +0 -10
  210. package/src/bindings/BigInt.res +0 -70
  211. package/src/bindings/BigInt.res.d.mts +0 -5
  212. package/src/bindings/BigInt.res.mjs +0 -154
  213. package/src/bindings/Ethers.res.d.mts +0 -5
  214. package/src/bindings/Pino.gen.ts +0 -17
  215. package/src/bindings/Postgres.gen.ts +0 -8
  216. package/src/bindings/Postgres.res.d.mts +0 -5
  217. package/src/bindings/Promise.res +0 -67
  218. package/src/bindings/Promise.res.mjs +0 -26
  219. package/src/db/InternalTable.gen.ts +0 -36
  220. package/src/sources/HyperSyncClient.gen.ts +0 -19
@@ -22,7 +22,7 @@ module Labels = {
22
22
  switch nonStringFields {
23
23
  | [] => items->Belt.Array.map(item => item.location)->Ok
24
24
  | nonStringItems =>
25
- let nonStringItems = nonStringItems->Js.Array2.joinWith(", ")
25
+ let nonStringItems = nonStringItems->Array.joinUnsafe(", ")
26
26
  Error(
27
27
  `Label schema must be an object with string (or optional string) values. Non string values: ${nonStringItems}`,
28
28
  )
@@ -55,7 +55,7 @@ module MakeSafePromMetric = (
55
55
  switch labelSchema->Labels.getLabelNames {
56
56
  | Ok(labelNames) =>
57
57
  if metricNames->Utils.Set.has(name) {
58
- Js.Exn.raiseError("Duplicate prometheus metric name: " ++ name)
58
+ JsError.throwWithMessage("Duplicate prometheus metric name: " ++ name)
59
59
  } else {
60
60
  metricNames->Utils.Set.add(name)->ignore
61
61
  let metric = M.make({
@@ -67,7 +67,7 @@ module MakeSafePromMetric = (
67
67
  {metric, labelSchema}
68
68
  }
69
69
 
70
- | Error(error) => Js.Exn.raiseError(error)
70
+ | Error(error) => JsError.throwWithMessage(error)
71
71
  }
72
72
 
73
73
  let handleFloat = ({metric, labelSchema}: t<'a>, ~labels: 'a, ~value) =>
@@ -117,7 +117,6 @@ module SafeGauge = MakeSafePromMetric({
117
117
  let handleFloat = PromClient.Gauge.setFloat
118
118
  })
119
119
 
120
-
121
120
  module ProcessingBatch = {
122
121
  let loadTimeCounter = PromClient.Counter.makeCounter({
123
122
  "name": "envio_preload_seconds",
@@ -129,21 +128,9 @@ module ProcessingBatch = {
129
128
  "help": "Cumulative time spent executing event handlers during batch processing.",
130
129
  })
131
130
 
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.",
140
- })
141
-
142
- let registerMetrics = (~loadDuration, ~handlerDuration, ~dbWriteDuration) => {
131
+ let registerMetrics = (~loadDuration, ~handlerDuration) => {
143
132
  loadTimeCounter->PromClient.Counter.incMany(loadDuration->(Utils.magic: float => int))
144
133
  handlerTimeCounter->PromClient.Counter.incMany(handlerDuration->(Utils.magic: float => int))
145
- writeTimeCounter->PromClient.Counter.incMany(dbWriteDuration->(Utils.magic: float => int))
146
- writeCount->PromClient.Counter.inc
147
134
  }
148
135
  }
149
136
 
@@ -227,7 +214,7 @@ module PreloadHandler = {
227
214
  mutable pendingCount: int,
228
215
  timerRef: Hrtime.timeRef,
229
216
  }
230
- let operations: Js.Dict.t<operationRef> = Js.Dict.empty()
217
+ let operations: dict<operationRef> = Dict.make()
231
218
 
232
219
  let makeKey = (~contract, ~event) => contract ++ ":" ++ event
233
220
 
@@ -236,7 +223,7 @@ module PreloadHandler = {
236
223
  switch operations->Utils.Dict.dangerouslyGetNonOption(key) {
237
224
  | Some(operationRef) => operationRef.pendingCount = operationRef.pendingCount + 1
238
225
  | None =>
239
- operations->Js.Dict.set(
226
+ operations->Dict.set(
240
227
  key,
241
228
  {
242
229
  pendingCount: 1,
@@ -250,7 +237,7 @@ module PreloadHandler = {
250
237
  let endOperation = (timerRef, ~contract, ~event) => {
251
238
  let key = makeKey(~contract, ~event)
252
239
  let labels = {"contract": contract, "event": event}
253
- let operationRef = operations->Js.Dict.unsafeGet(key)
240
+ let operationRef = operations->Dict.getUnsafe(key)
254
241
  operationRef.pendingCount = operationRef.pendingCount - 1
255
242
  if operationRef.pendingCount === 0 {
256
243
  timeCounter->SafeCounter.handleFloat(
@@ -348,7 +335,7 @@ module ProcessStartTimeSeconds = {
348
335
  })
349
336
 
350
337
  let set = () => {
351
- gauge->PromClient.Gauge.setFloat(Js.Date.now() /. 1000.0)
338
+ gauge->PromClient.Gauge.setFloat(Date.now() /. 1000.0)
352
339
  }
353
340
  }
354
341
 
@@ -593,9 +580,7 @@ module RollbackSuccess = {
593
580
  let increment = (~timeSeconds: float, ~rollbackedProcessedEvents: float) => {
594
581
  timeCounter->PromClient.Counter.incMany(timeSeconds->(Utils.magic: float => int))
595
582
  counter->PromClient.Counter.inc
596
- eventsCounter->PromClient.Counter.incMany(
597
- rollbackedProcessedEvents->Utils.floatToInt,
598
- )
583
+ eventsCounter->PromClient.Counter.incMany(rollbackedProcessedEvents->Utils.floatToInt)
599
584
  }
600
585
  }
601
586
 
@@ -663,10 +648,7 @@ module ProgressEventsCount = {
663
648
  )
664
649
 
665
650
  let set = (~processedCount: float, ~chainId) => {
666
- gauge->SafeGauge.handleFloat(
667
- ~labels=chainId,
668
- ~value=processedCount,
669
- )
651
+ gauge->SafeGauge.handleFloat(~labels=chainId, ~value=processedCount)
670
652
  }
671
653
  }
672
654
 
@@ -755,50 +737,58 @@ module EffectQueueCount = {
755
737
  }
756
738
 
757
739
  module StorageLoad = {
758
- let operationLabelsSchema = S.object(s => s.field("operation", S.string))
740
+ let loadLabelsSchema = S.schema(s =>
741
+ {
742
+ "operation": s.matches(S.string),
743
+ "storage": s.matches(S.string),
744
+ }
745
+ )
759
746
 
760
747
  let timeCounter = SafeCounter.makeOrThrow(
761
748
  ~name="envio_storage_load_seconds",
762
749
  ~help="Processing time taken to load data from storage.",
763
- ~labelSchema=operationLabelsSchema,
750
+ ~labelSchema=loadLabelsSchema,
764
751
  )
765
752
 
766
753
  let sumTimeCounter = SafeCounter.makeOrThrow(
767
754
  ~name="envio_storage_load_seconds_total",
768
755
  ~help="Cumulative time spent loading data from storage during the indexing process.",
769
- ~labelSchema=operationLabelsSchema,
756
+ ~labelSchema=loadLabelsSchema,
770
757
  )
771
758
 
772
759
  let counter = SafeCounter.makeOrThrow(
773
760
  ~name="envio_storage_load_total",
774
761
  ~help="Cumulative number of successful storage load operations during the indexing process.",
775
- ~labelSchema=operationLabelsSchema,
762
+ ~labelSchema=loadLabelsSchema,
776
763
  )
777
764
 
778
765
  let whereSizeCounter = SafeCounter.makeOrThrow(
779
766
  ~name="envio_storage_load_where_size",
780
767
  ~help="Cumulative number of filter conditions ('where' items) used in storage load operations during the indexing process.",
781
- ~labelSchema=operationLabelsSchema,
768
+ ~labelSchema=loadLabelsSchema,
782
769
  )
783
770
 
784
771
  let sizeCounter = SafeCounter.makeOrThrow(
785
772
  ~name="envio_storage_load_size",
786
773
  ~help="Cumulative number of records loaded from storage during the indexing process.",
787
- ~labelSchema=operationLabelsSchema,
774
+ ~labelSchema=loadLabelsSchema,
788
775
  )
789
776
 
790
777
  type operationRef = {
791
778
  mutable pendingCount: int,
792
779
  timerRef: Hrtime.timeRef,
793
780
  }
794
- let operations = Js.Dict.empty()
781
+ let operations = Dict.make()
782
+
783
+ let makeKey = (~storage, ~operation) => storage ++ ":" ++ operation
795
784
 
796
- let startOperation = (~operation) => {
797
- switch operations->Utils.Dict.dangerouslyGetNonOption(operation) {
785
+ let startOperation = (~storage, ~operation) => {
786
+ let key = makeKey(~storage, ~operation)
787
+ switch operations->Utils.Dict.dangerouslyGetNonOption(key) {
798
788
  | Some(operationRef) => operationRef.pendingCount = operationRef.pendingCount + 1
799
789
  | None =>
800
- operations->Js.Dict.set(
801
- operation,
790
+ operations->Dict.set(
791
+ key,
802
792
  (
803
793
  {
804
794
  pendingCount: 1,
@@ -810,43 +800,45 @@ module StorageLoad = {
810
800
  Hrtime.makeTimer()
811
801
  }
812
802
 
813
- let endOperation = (timerRef, ~operation, ~whereSize, ~size) => {
814
- let operationRef = operations->Js.Dict.unsafeGet(operation)
803
+ let endOperation = (timerRef, ~storage, ~operation, ~whereSize, ~size) => {
804
+ let key = makeKey(~storage, ~operation)
805
+ let labels = {"operation": operation, "storage": storage}
806
+ let operationRef = operations->Dict.getUnsafe(key)
815
807
  operationRef.pendingCount = operationRef.pendingCount - 1
816
808
  if operationRef.pendingCount === 0 {
817
809
  timeCounter->SafeCounter.handleFloat(
818
- ~labels={operation},
810
+ ~labels,
819
811
  ~value=operationRef.timerRef->Hrtime.timeSince->Hrtime.toSecondsFloat,
820
812
  )
821
- operations->Utils.Dict.deleteInPlace(operation)
813
+ operations->Utils.Dict.deleteInPlace(key)
822
814
  }
823
815
  sumTimeCounter->SafeCounter.handleFloat(
824
- ~labels={operation},
816
+ ~labels,
825
817
  ~value=timerRef->Hrtime.timeSince->Hrtime.toSecondsFloat,
826
818
  )
827
- counter->SafeCounter.increment(~labels={operation})
828
- whereSizeCounter->SafeCounter.handleInt(~labels={operation}, ~value=whereSize)
829
- sizeCounter->SafeCounter.handleInt(~labels={operation}, ~value=size)
819
+ counter->SafeCounter.increment(~labels)
820
+ whereSizeCounter->SafeCounter.handleInt(~labels, ~value=whereSize)
821
+ sizeCounter->SafeCounter.handleInt(~labels, ~value=size)
830
822
  }
831
823
  }
832
824
 
833
- module SinkWrite = {
834
- let sinkLabelsSchema = S.object(s => s.field("sink", S.string))
825
+ module StorageWrite = {
826
+ let storageLabelsSchema = S.object(s => s.field("storage", S.string))
835
827
 
836
828
  let timeCounter = SafeCounter.makeOrThrow(
837
- ~name="envio_sink_write_seconds",
838
- ~help="Processing time taken to write data to sink.",
839
- ~labelSchema=sinkLabelsSchema,
829
+ ~name="envio_storage_write_seconds",
830
+ ~help="Cumulative time spent writing batch data to storage.",
831
+ ~labelSchema=storageLabelsSchema,
840
832
  )
841
833
 
842
834
  let counter = SafeCounter.makeOrThrow(
843
- ~name="envio_sink_write_total",
844
- ~help="Cumulative number of successful sink write operations during the indexing process.",
845
- ~labelSchema=sinkLabelsSchema,
835
+ ~name="envio_storage_write_total",
836
+ ~help="Cumulative number of successful storage write operations during the indexing process.",
837
+ ~labelSchema=storageLabelsSchema,
846
838
  )
847
839
 
848
- let increment = (~sinkName, ~timeSeconds) => {
849
- timeCounter->SafeCounter.handleFloat(~labels={sinkName}, ~value=timeSeconds)
850
- counter->SafeCounter.increment(~labels={sinkName})
840
+ let increment = (~storage, ~timeSeconds) => {
841
+ timeCounter->SafeCounter.handleFloat(~labels={storage}, ~value=timeSeconds)
842
+ counter->SafeCounter.increment(~labels={storage})
851
843
  }
852
844
  }