effect 4.0.0-beta.65 → 4.0.0-beta.67
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/dist/Array.d.ts +113 -67
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +28 -18
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +404 -337
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +190 -146
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +167 -97
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +87 -47
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +62 -31
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +30 -15
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +20 -1
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +16 -0
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +236 -132
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +133 -57
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +77 -65
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +43 -36
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +1518 -575
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +661 -287
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +119 -10
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +45 -6
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +548 -379
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +238 -170
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +15 -8
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +8 -4
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +2 -4
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +2 -4
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +5 -4
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +9 -8
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/ConfigProvider.js +1 -1
- package/dist/Console.d.ts +76 -50
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +69 -46
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +386 -138
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +144 -62
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +69 -48
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +96 -36
- package/dist/Cron.js.map +1 -1
- package/dist/Data.d.ts +3 -2
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +875 -444
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +376 -217
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +367 -174
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +145 -71
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +42 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Differ.js +36 -0
- package/dist/Duration.d.ts +329 -185
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +174 -106
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2445 -2356
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +906 -758
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +38 -3
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -3
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +78 -28
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +75 -27
- package/dist/Encoding.js.map +1 -1
- package/dist/Equivalence.d.ts +14 -19
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +14 -19
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +66 -82
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +38 -29
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +96 -12
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +21 -6
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +7 -5
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +72 -40
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +39 -21
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +119 -58
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +122 -40
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +288 -160
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +176 -74
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +93 -52
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +97 -34
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +104 -73
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +53 -39
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +166 -88
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +68 -42
- package/dist/Filter.js.map +1 -1
- package/dist/Function.d.ts +154 -86
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +53 -37
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +682 -365
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +308 -157
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +29 -13
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +31 -18
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +25 -15
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +444 -256
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +223 -105
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +36 -17
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +75 -8
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +194 -104
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +93 -38
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +20 -9
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +16 -6
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +309 -149
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +129 -65
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +4 -3
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +4 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/Latch.d.ts +98 -15
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +41 -10
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +412 -309
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +262 -181
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +95 -21
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +58 -14
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +92 -131
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +25 -15
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +155 -99
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +211 -184
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +75 -17
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +22 -16
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +133 -157
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +85 -76
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +325 -284
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +217 -212
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +117 -58
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +52 -29
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +52 -30
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +94 -38
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +92 -49
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +123 -71
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +99 -62
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +79 -60
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +3 -0
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +36 -39
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +34 -20
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +116 -64
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +54 -30
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +1 -2
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +0 -1
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +38 -53
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +87 -11
- package/dist/Option.js.map +1 -1
- package/dist/Ordering.d.ts +43 -28
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +4 -2
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +225 -40
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +113 -17
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +77 -13
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +48 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +71 -15
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +59 -12
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +74 -6
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +68 -5
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +66 -31
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +26 -24
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +16 -21
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +9 -14
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +9 -2
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +7 -1
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +364 -262
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +245 -174
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +94 -25
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +61 -13
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +284 -150
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +216 -113
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +54 -35
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +36 -24
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +151 -141
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +66 -20
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +69 -32
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +33 -16
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +273 -129
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +117 -57
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +3 -3
- package/dist/Redactable.js +2 -2
- package/dist/Redacted.d.ts +63 -33
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +30 -14
- package/dist/Redacted.js.map +1 -1
- package/dist/Ref.d.ts +81 -52
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +54 -35
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +73 -31
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +66 -30
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +11 -5
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +11 -5
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +158 -34
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +67 -12
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +261 -116
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +77 -41
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +13 -7
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +44 -6
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +26 -16
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +6 -6
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +43 -18
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +35 -16
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +545 -576
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +261 -247
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +43 -6
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +33 -4
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +815 -294
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +287 -193
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +24 -15
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +13 -9
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +26 -13
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +24 -11
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +1 -8
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +194 -25
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +220 -26
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +2 -2
- package/dist/SchemaTransformation.d.ts +61 -41
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +56 -33
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +7 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +23 -0
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +102 -43
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +57 -23
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +138 -46
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +80 -19
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +28 -8
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +25 -5
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +64 -28
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +22 -13
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +458 -200
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +240 -89
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +43 -6
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +33 -4
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +1899 -1186
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +868 -525
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +171 -95
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +125 -67
- package/dist/String.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +308 -203
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +125 -76
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +13 -5
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +13 -5
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +278 -62
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +116 -23
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +26 -2
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +4 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +39 -7
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +10 -4
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +229 -55
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +94 -18
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +213 -142
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +88 -60
- package/dist/Trie.js.map +1 -1
- package/dist/TxChunk.d.ts +182 -146
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +73 -56
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +43 -29
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +22 -15
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +362 -222
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +171 -98
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +178 -104
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +84 -43
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +93 -62
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +54 -36
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +77 -49
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +60 -37
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +279 -241
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +147 -101
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +69 -46
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +48 -32
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +69 -40
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +35 -20
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +101 -54
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +76 -34
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +72 -48
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +33 -22
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +34 -34
- package/dist/UndefinedOr.d.ts +48 -25
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +28 -25
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +71 -116
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +20 -6
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +4 -0
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +4 -0
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +81 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -32
- package/dist/index.js.map +1 -1
- package/dist/internal/concurrency.js +2 -2
- package/dist/internal/concurrency.js.map +1 -1
- package/dist/internal/core.js +8 -20
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/effect.js +20 -19
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/executionPlan.js +2 -2
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/option.js +5 -8
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/result.js +5 -8
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +6 -3
- package/dist/testing/FastCheck.d.ts.map +1 -1
- package/dist/testing/FastCheck.js +6 -3
- package/dist/testing/FastCheck.js.map +1 -1
- package/dist/testing/TestClock.d.ts +39 -34
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +42 -12
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +39 -30
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +25 -10
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.js +7 -7
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +197 -130
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +166 -102
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
- package/dist/unstable/ai/Chat.d.ts +65 -41
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +51 -33
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +9 -8
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +28 -18
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +18 -11
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +36 -30
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +21 -15
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +339 -119
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +264 -98
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +53 -19
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +65 -17
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +13 -7
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +11 -9
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
- package/dist/unstable/ai/Prompt.d.ts +194 -168
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +75 -66
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +153 -140
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +43 -48
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +27 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +42 -32
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +14 -10
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +13 -8
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +10 -6
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +153 -84
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +97 -44
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +33 -42
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +35 -36
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +42 -24
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +42 -24
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +226 -134
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +101 -65
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +72 -26
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +86 -23
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +43 -13
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +30 -6
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +218 -117
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +45 -31
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +7 -7
- package/dist/unstable/cli/Completions.js +1 -1
- package/dist/unstable/cli/Flag.d.ts +235 -142
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +111 -71
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +42 -14
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +30 -7
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +35 -10
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/HelpDoc.js +21 -0
- package/dist/unstable/cli/Param.d.ts +79 -31
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +161 -99
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +79 -42
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +66 -35
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +178 -47
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +111 -31
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
- package/dist/unstable/cli/internal/ansi.js +13 -0
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +7 -7
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +12 -10
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/config.d.ts +3 -0
- package/dist/unstable/cli/internal/config.d.ts.map +1 -1
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/lexer.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +35 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +56 -7
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +56 -7
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +39 -5
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +61 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +36 -3
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +11 -3
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +75 -16
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +78 -13
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +30 -2
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +18 -3
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +15 -2
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +34 -2
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +24 -2
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +17 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +40 -8
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +43 -6
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +11 -4
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +27 -3
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +24 -2
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +105 -23
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +88 -14
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +88 -13
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +31 -6
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +24 -3
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +21 -2
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +102 -13
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +86 -10
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +127 -21
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +71 -11
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +101 -12
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +64 -8
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +47 -17
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +47 -17
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +34 -2
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +40 -12
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +31 -4
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +38 -4
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +73 -10
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +70 -9
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +51 -5
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +47 -4
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +10 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +35 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +67 -10
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +23 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +15 -1
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +15 -1
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +21 -1
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +89 -19
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +48 -13
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +29 -2
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +18 -1
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +18 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/internal/hash.js +12 -0
- package/dist/unstable/cluster/internal/hash.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +26 -3
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +26 -3
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +32 -5
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +102 -20
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +21 -1
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +81 -12
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +75 -9
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +149 -21
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +97 -13
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +109 -18
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +69 -13
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +115 -30
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +22 -2
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +24 -6
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +108 -16
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +151 -31
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +111 -20
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +96 -22
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +72 -16
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +54 -8
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +17 -3
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +156 -77
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +93 -39
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +40 -7
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +27 -4
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +33 -4
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/FindMyWay.d.ts +1 -1
- package/dist/unstable/http/FindMyWay.js +1 -1
- package/dist/unstable/http/Headers.d.ts +182 -36
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +86 -16
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +114 -26
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +100 -22
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +205 -96
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +85 -39
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +68 -12
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +71 -9
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +153 -47
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +44 -11
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +42 -16
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +33 -13
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +47 -7
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +44 -6
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +35 -5
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +23 -1
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +37 -11
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +70 -31
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +34 -3
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +35 -4
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +194 -45
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +122 -28
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +151 -22
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +77 -12
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +90 -10
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +82 -8
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +112 -31
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +43 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +390 -67
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +209 -38
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +22 -4
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +22 -4
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +47 -5
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +178 -28
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +130 -20
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
- package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Node.js +1 -1
- package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Search.js +1 -1
- package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Web.js +1 -1
- package/dist/unstable/http/Multipasta.d.ts +1 -1
- package/dist/unstable/http/Multipasta.js +1 -1
- package/dist/unstable/http/Template.d.ts +53 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +26 -0
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +56 -42
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +29 -15
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +233 -49
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +116 -23
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +14 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +55 -16
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +47 -9
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +58 -15
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +43 -7
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +98 -1
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +113 -22
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -6
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +67 -30
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +48 -27
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +74 -17
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +5 -2
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +24 -2
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +9 -2
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +28 -3
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +73 -15
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +33 -3
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js +14 -3
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +32 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +14 -2
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +29 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +15 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +32 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +49 -12
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +47 -5
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +28 -3
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +16 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +32 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +32 -12
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +7 -5
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/index.d.ts +2 -1
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +2 -1
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +81 -21
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +76 -15
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +22 -5
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +24 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +60 -13
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +97 -16
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +90 -14
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +97 -21
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +82 -17
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +26 -5
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +36 -4
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +89 -109
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +74 -23
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +22 -11
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +11 -6
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +2 -1
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +2 -1
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +196 -59
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +121 -36
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +539 -130
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +256 -62
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +29 -3
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +69 -10
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +29 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +28 -5
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +35 -3
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +95 -13
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +61 -7
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +255 -56
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +44 -11
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +81 -19
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +53 -13
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +26 -2
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +3 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +23 -7
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +39 -3
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +34 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +56 -12
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +73 -23
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +70 -23
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +20 -1
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +20 -1
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +40 -6
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +17 -5
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +8 -0
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +8 -0
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +130 -52
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +79 -34
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +104 -24
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +22 -6
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +167 -34
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +124 -29
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +58 -10
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +43 -5
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +35 -4
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +45 -5
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +34 -2
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +38 -1
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +31 -0
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +22 -0
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +99 -0
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +114 -0
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +26 -5
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +8 -4
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +56 -13
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +44 -10
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +29 -8
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +29 -8
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/SqlStream.d.ts +3 -0
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.js +23 -0
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +124 -0
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +82 -0
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +1 -1
- package/dist/unstable/sql/index.js +1 -1
- package/dist/unstable/workers/Transferable.d.ts +65 -13
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +53 -10
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +60 -8
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +43 -4
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +31 -9
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +44 -7
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +24 -1
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +1 -1
- package/dist/unstable/workers/index.js +1 -1
- package/dist/unstable/workflow/Activity.d.ts +61 -10
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +21 -6
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +12 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +22 -2
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +126 -31
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +76 -13
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +145 -0
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -0
- package/dist/unstable/workflow/DurableQueue.js +200 -0
- package/dist/unstable/workflow/DurableQueue.js.map +1 -0
- package/dist/unstable/workflow/Workflow.d.ts +100 -31
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +76 -20
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +16 -4
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +32 -2
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +2 -2
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts +36 -2
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +4 -0
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +4 -0
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +11 -11
- package/src/Array.ts +113 -67
- package/src/BigDecimal.ts +404 -337
- package/src/BigInt.ts +167 -97
- package/src/Boolean.ts +62 -31
- package/src/Brand.ts +20 -1
- package/src/Cache.ts +331 -164
- package/src/Cause.ts +77 -65
- package/src/Channel.ts +1585 -607
- package/src/ChannelSchema.ts +137 -12
- package/src/Chunk.ts +549 -380
- package/src/Clock.ts +15 -8
- package/src/Combiner.ts +2 -4
- package/src/Config.ts +12 -10
- package/src/ConfigProvider.ts +1 -1
- package/src/Console.ts +88 -58
- package/src/Context.ts +397 -149
- package/src/Cron.ts +111 -48
- package/src/Data.ts +3 -2
- package/src/DateTime.ts +876 -445
- package/src/Deferred.ts +367 -174
- package/src/Differ.ts +42 -0
- package/src/Duration.ts +329 -185
- package/src/Effect.ts +2474 -2395
- package/src/Effectable.ts +39 -4
- package/src/Encoding.ts +78 -28
- package/src/Equivalence.ts +14 -19
- package/src/ErrorReporter.ts +66 -82
- package/src/ExecutionPlan.ts +97 -13
- package/src/Exit.ts +7 -5
- package/src/Fiber.ts +72 -40
- package/src/FiberHandle.ts +158 -58
- package/src/FiberMap.ts +329 -164
- package/src/FiberSet.ts +130 -52
- package/src/FileSystem.ts +106 -74
- package/src/Filter.ts +166 -88
- package/src/Function.ts +154 -86
- package/src/Graph.ts +682 -365
- package/src/HKT.ts +29 -13
- package/src/Hash.ts +31 -18
- package/src/HashMap.ts +444 -256
- package/src/HashRing.ts +94 -17
- package/src/HashSet.ts +194 -104
- package/src/Inspectable.ts +22 -10
- package/src/Iterable.ts +309 -149
- package/src/JsonPatch.ts +4 -3
- package/src/Latch.ts +98 -15
- package/src/Layer.ts +488 -345
- package/src/LayerMap.ts +98 -25
- package/src/LogLevel.ts +92 -131
- package/src/Logger.ts +357 -288
- package/src/ManagedRuntime.ts +75 -17
- package/src/Match.ts +133 -157
- package/src/Metric.ts +355 -304
- package/src/MutableHashMap.ts +161 -84
- package/src/MutableHashSet.ts +122 -52
- package/src/MutableList.ts +141 -81
- package/src/MutableRef.ts +130 -90
- package/src/Newtype.ts +3 -0
- package/src/NonEmptyIterable.ts +36 -39
- package/src/Number.ts +116 -64
- package/src/Optic.ts +1 -2
- package/src/Option.ts +41 -53
- package/src/Ordering.ts +43 -28
- package/src/PartitionedSemaphore.ts +225 -40
- package/src/Path.ts +77 -13
- package/src/Pipeable.ts +76 -21
- package/src/PlatformError.ts +74 -6
- package/src/Pool.ts +94 -31
- package/src/Predicate.ts +16 -21
- package/src/PrimaryKey.ts +9 -2
- package/src/PubSub.ts +364 -262
- package/src/Pull.ts +94 -25
- package/src/Queue.ts +284 -150
- package/src/Random.ts +54 -35
- package/src/RcMap.ts +151 -141
- package/src/RcRef.ts +69 -32
- package/src/Record.ts +273 -129
- package/src/Redactable.ts +3 -3
- package/src/Redacted.ts +63 -33
- package/src/Ref.ts +161 -104
- package/src/References.ts +73 -31
- package/src/RegExp.ts +11 -5
- package/src/Request.ts +158 -34
- package/src/RequestResolver.ts +277 -119
- package/src/Resource.ts +45 -7
- package/src/Result.ts +31 -18
- package/src/Runtime.ts +45 -19
- package/src/Schedule.ts +575 -600
- package/src/Scheduler.ts +43 -6
- package/src/Schema.ts +845 -319
- package/src/SchemaAST.ts +25 -16
- package/src/SchemaGetter.ts +32 -17
- package/src/SchemaIssue.ts +1 -8
- package/src/SchemaParser.ts +262 -38
- package/src/SchemaTransformation.ts +61 -41
- package/src/SchemaUtils.ts +23 -0
- package/src/Scope.ts +102 -43
- package/src/ScopedCache.ts +192 -56
- package/src/ScopedRef.ts +28 -8
- package/src/Semaphore.ts +64 -28
- package/src/Sink.ts +458 -200
- package/src/Stdio.ts +43 -6
- package/src/Stream.ts +2043 -1256
- package/src/String.ts +171 -95
- package/src/SubscriptionRef.ts +308 -203
- package/src/Symbol.ts +13 -5
- package/src/SynchronizedRef.ts +278 -62
- package/src/Take.ts +26 -2
- package/src/Terminal.ts +40 -7
- package/src/Tracer.ts +229 -55
- package/src/Trie.ts +213 -142
- package/src/TxChunk.ts +182 -146
- package/src/TxDeferred.ts +43 -29
- package/src/TxHashMap.ts +370 -230
- package/src/TxHashSet.ts +250 -152
- package/src/TxPriorityQueue.ts +96 -64
- package/src/TxPubSub.ts +77 -49
- package/src/TxQueue.ts +279 -241
- package/src/TxReentrantLock.ts +70 -47
- package/src/TxRef.ts +70 -41
- package/src/TxSemaphore.ts +101 -54
- package/src/TxSubscriptionRef.ts +72 -48
- package/src/Types.ts +34 -34
- package/src/UndefinedOr.ts +48 -25
- package/src/Unify.ts +71 -116
- package/src/Utils.ts +4 -0
- package/src/index.ts +81 -32
- package/src/internal/concurrency.ts +2 -2
- package/src/internal/core.ts +12 -23
- package/src/internal/effect.ts +25 -29
- package/src/internal/executionPlan.ts +2 -2
- package/src/internal/option.ts +5 -8
- package/src/internal/result.ts +5 -8
- package/src/internal/schema/schema.ts +1 -1
- package/src/testing/FastCheck.ts +6 -3
- package/src/testing/TestClock.ts +63 -34
- package/src/testing/TestConsole.ts +49 -30
- package/src/testing/TestSchema.ts +8 -8
- package/src/unstable/ai/AiError.ts +187 -120
- package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
- package/src/unstable/ai/Chat.ts +69 -43
- package/src/unstable/ai/EmbeddingModel.ts +12 -11
- package/src/unstable/ai/IdGenerator.ts +28 -18
- package/src/unstable/ai/LanguageModel.ts +47 -46
- package/src/unstable/ai/McpSchema.ts +339 -119
- package/src/unstable/ai/McpServer.ts +78 -21
- package/src/unstable/ai/Model.ts +23 -18
- package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
- package/src/unstable/ai/Prompt.ts +210 -184
- package/src/unstable/ai/Response.ts +159 -147
- package/src/unstable/ai/ResponseIdTracker.ts +43 -4
- package/src/unstable/ai/Telemetry.ts +42 -32
- package/src/unstable/ai/Tokenizer.ts +13 -8
- package/src/unstable/ai/Tool.ts +154 -85
- package/src/unstable/ai/Toolkit.ts +81 -84
- package/src/unstable/ai/index.ts +42 -24
- package/src/unstable/cli/Argument.ts +226 -134
- package/src/unstable/cli/CliError.ts +96 -26
- package/src/unstable/cli/CliOutput.ts +43 -13
- package/src/unstable/cli/Command.ts +225 -125
- package/src/unstable/cli/Completions.ts +7 -7
- package/src/unstable/cli/Flag.ts +235 -142
- package/src/unstable/cli/GlobalFlag.ts +42 -14
- package/src/unstable/cli/HelpDoc.ts +35 -10
- package/src/unstable/cli/Param.ts +328 -190
- package/src/unstable/cli/Primitive.ts +79 -42
- package/src/unstable/cli/Prompt.ts +210 -58
- package/src/unstable/cli/internal/ansi.ts +13 -0
- package/src/unstable/cli/internal/command.ts +17 -15
- package/src/unstable/cli/internal/config.ts +3 -0
- package/src/unstable/cli/internal/lexer.ts +11 -0
- package/src/unstable/cluster/ClusterCron.ts +35 -1
- package/src/unstable/cluster/ClusterError.ts +56 -7
- package/src/unstable/cluster/ClusterMetrics.ts +39 -5
- package/src/unstable/cluster/ClusterSchema.ts +61 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +36 -3
- package/src/unstable/cluster/DeliverAt.ts +39 -4
- package/src/unstable/cluster/Entity.ts +110 -19
- package/src/unstable/cluster/EntityAddress.ts +30 -2
- package/src/unstable/cluster/EntityId.ts +18 -3
- package/src/unstable/cluster/EntityProxy.ts +34 -2
- package/src/unstable/cluster/EntityProxyServer.ts +44 -8
- package/src/unstable/cluster/EntityResource.ts +43 -6
- package/src/unstable/cluster/EntityType.ts +27 -3
- package/src/unstable/cluster/Envelope.ts +128 -23
- package/src/unstable/cluster/HttpRunner.ts +88 -13
- package/src/unstable/cluster/K8sHttpClient.ts +49 -6
- package/src/unstable/cluster/MachineId.ts +24 -3
- package/src/unstable/cluster/Message.ts +102 -13
- package/src/unstable/cluster/MessageStorage.ts +128 -22
- package/src/unstable/cluster/Reply.ts +101 -12
- package/src/unstable/cluster/Runner.ts +47 -17
- package/src/unstable/cluster/RunnerAddress.ts +34 -2
- package/src/unstable/cluster/RunnerHealth.ts +40 -12
- package/src/unstable/cluster/RunnerServer.ts +31 -4
- package/src/unstable/cluster/RunnerStorage.ts +42 -5
- package/src/unstable/cluster/Runners.ts +73 -10
- package/src/unstable/cluster/ShardId.ts +51 -5
- package/src/unstable/cluster/Sharding.ts +35 -4
- package/src/unstable/cluster/ShardingConfig.ts +76 -11
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
- package/src/unstable/cluster/SingleRunner.ts +23 -1
- package/src/unstable/cluster/Singleton.ts +15 -1
- package/src/unstable/cluster/SingletonAddress.ts +21 -1
- package/src/unstable/cluster/Snowflake.ts +89 -19
- package/src/unstable/cluster/SocketRunner.ts +29 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
- package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
- package/src/unstable/cluster/TestRunner.ts +18 -1
- package/src/unstable/cluster/internal/hash.ts +12 -0
- package/src/unstable/devtools/DevTools.ts +26 -3
- package/src/unstable/devtools/DevToolsClient.ts +32 -5
- package/src/unstable/devtools/DevToolsSchema.ts +201 -44
- package/src/unstable/devtools/DevToolsServer.ts +27 -2
- package/src/unstable/encoding/Msgpack.ts +97 -12
- package/src/unstable/encoding/Ndjson.ts +149 -21
- package/src/unstable/encoding/Sse.ts +109 -18
- package/src/unstable/eventlog/Event.ts +131 -30
- package/src/unstable/eventlog/EventGroup.ts +50 -17
- package/src/unstable/eventlog/EventJournal.ts +120 -20
- package/src/unstable/eventlog/EventLog.ts +151 -31
- package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
- package/src/unstable/eventlog/EventLogMessage.ts +92 -18
- package/src/unstable/eventlog/EventLogRemote.ts +54 -8
- package/src/unstable/eventlog/EventLogServer.ts +33 -3
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
- package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
- package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
- package/src/unstable/http/Cookies.ts +156 -77
- package/src/unstable/http/Etag.ts +40 -7
- package/src/unstable/http/FetchHttpClient.ts +33 -4
- package/src/unstable/http/FindMyWay.ts +1 -1
- package/src/unstable/http/Headers.ts +252 -50
- package/src/unstable/http/HttpBody.ts +130 -28
- package/src/unstable/http/HttpClient.ts +206 -97
- package/src/unstable/http/HttpClientError.ts +80 -12
- package/src/unstable/http/HttpClientRequest.ts +320 -102
- package/src/unstable/http/HttpClientResponse.ts +59 -16
- package/src/unstable/http/HttpEffect.ts +66 -18
- package/src/unstable/http/HttpIncomingMessage.ts +47 -7
- package/src/unstable/http/HttpMethod.ts +35 -5
- package/src/unstable/http/HttpMiddleware.ts +63 -16
- package/src/unstable/http/HttpPlatform.ts +35 -4
- package/src/unstable/http/HttpRouter.ts +221 -57
- package/src/unstable/http/HttpServer.ts +152 -23
- package/src/unstable/http/HttpServerError.ts +90 -10
- package/src/unstable/http/HttpServerRequest.ts +136 -32
- package/src/unstable/http/HttpServerRespondable.ts +49 -6
- package/src/unstable/http/HttpServerResponse.ts +395 -72
- package/src/unstable/http/HttpStaticServer.ts +22 -4
- package/src/unstable/http/HttpTraceContext.ts +53 -6
- package/src/unstable/http/Multipart.ts +179 -29
- package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
- package/src/unstable/http/Multipasta/Node.ts +1 -1
- package/src/unstable/http/Multipasta/Search.ts +1 -1
- package/src/unstable/http/Multipasta/Web.ts +1 -1
- package/src/unstable/http/Multipasta.ts +1 -1
- package/src/unstable/http/Template.ts +53 -0
- package/src/unstable/http/Url.ts +56 -42
- package/src/unstable/http/UrlParams.ts +233 -49
- package/src/unstable/httpapi/HttpApi.ts +49 -14
- package/src/unstable/httpapi/HttpApiBuilder.ts +86 -20
- package/src/unstable/httpapi/HttpApiClient.ts +80 -16
- package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
- package/src/unstable/httpapi/HttpApiError.ts +100 -1
- package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
- package/src/unstable/httpapi/HttpApiMiddleware.ts +113 -23
- package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
- package/src/unstable/httpapi/HttpApiSchema.ts +67 -30
- package/src/unstable/httpapi/HttpApiSecurity.ts +74 -17
- package/src/unstable/httpapi/HttpApiSwagger.ts +24 -2
- package/src/unstable/httpapi/HttpApiTest.ts +31 -3
- package/src/unstable/httpapi/OpenApi.ts +115 -15
- package/src/unstable/observability/Otlp.ts +33 -3
- package/src/unstable/observability/OtlpExporter.ts +32 -1
- package/src/unstable/observability/OtlpLogger.ts +31 -2
- package/src/unstable/observability/OtlpMetrics.ts +37 -4
- package/src/unstable/observability/OtlpResource.ts +68 -12
- package/src/unstable/observability/OtlpSerialization.ts +28 -3
- package/src/unstable/observability/OtlpTracer.ts +38 -2
- package/src/unstable/observability/PrometheusMetrics.ts +32 -12
- package/src/unstable/observability/index.ts +2 -1
- package/src/unstable/persistence/KeyValueStore.ts +108 -28
- package/src/unstable/persistence/Persistable.ts +76 -15
- package/src/unstable/persistence/PersistedCache.ts +27 -2
- package/src/unstable/persistence/PersistedQueue.ts +98 -16
- package/src/unstable/persistence/Persistence.ts +97 -16
- package/src/unstable/persistence/RateLimiter.ts +98 -22
- package/src/unstable/persistence/Redis.ts +42 -5
- package/src/unstable/process/ChildProcess.ts +100 -79
- package/src/unstable/process/ChildProcessSpawner.ts +22 -11
- package/src/unstable/process/index.ts +2 -1
- package/src/unstable/reactivity/AsyncResult.ts +202 -61
- package/src/unstable/reactivity/Atom.ts +597 -143
- package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
- package/src/unstable/reactivity/AtomRef.ts +51 -7
- package/src/unstable/reactivity/AtomRegistry.ts +141 -22
- package/src/unstable/reactivity/AtomRpc.ts +36 -2
- package/src/unstable/reactivity/Hydration.ts +45 -5
- package/src/unstable/reactivity/Reactivity.ts +95 -13
- package/src/unstable/rpc/Rpc.ts +255 -56
- package/src/unstable/rpc/RpcClient.ts +108 -20
- package/src/unstable/rpc/RpcClientError.ts +26 -2
- package/src/unstable/rpc/RpcGroup.ts +51 -8
- package/src/unstable/rpc/RpcMessage.ts +128 -32
- package/src/unstable/rpc/RpcMiddleware.ts +100 -20
- package/src/unstable/rpc/RpcSchema.ts +38 -4
- package/src/unstable/rpc/RpcSerialization.ts +60 -13
- package/src/unstable/rpc/RpcServer.ts +108 -25
- package/src/unstable/rpc/RpcTest.ts +20 -1
- package/src/unstable/rpc/RpcWorker.ts +42 -8
- package/src/unstable/rpc/Utils.ts +31 -0
- package/src/unstable/schema/Model.ts +148 -52
- package/src/unstable/schema/VariantSchema.ts +104 -24
- package/src/unstable/socket/Socket.ts +168 -35
- package/src/unstable/socket/SocketServer.ts +58 -10
- package/src/unstable/sql/Migrator.ts +57 -5
- package/src/unstable/sql/SqlClient.ts +55 -2
- package/src/unstable/sql/SqlConnection.ts +31 -0
- package/src/unstable/sql/SqlError.ts +117 -0
- package/src/unstable/sql/SqlModel.ts +26 -5
- package/src/unstable/sql/SqlResolver.ts +56 -13
- package/src/unstable/sql/SqlSchema.ts +29 -8
- package/src/unstable/sql/SqlStream.ts +23 -0
- package/src/unstable/sql/Statement.ts +141 -0
- package/src/unstable/sql/index.ts +1 -1
- package/src/unstable/workers/Transferable.ts +65 -13
- package/src/unstable/workers/Worker.ts +60 -8
- package/src/unstable/workers/WorkerError.ts +50 -9
- package/src/unstable/workers/WorkerRunner.ts +32 -3
- package/src/unstable/workers/index.ts +1 -1
- package/src/unstable/workflow/Activity.ts +62 -11
- package/src/unstable/workflow/DurableClock.ts +26 -3
- package/src/unstable/workflow/DurableDeferred.ts +146 -31
- package/src/unstable/workflow/DurableQueue.ts +366 -0
- package/src/unstable/workflow/Workflow.ts +122 -32
- package/src/unstable/workflow/WorkflowEngine.ts +40 -5
- package/src/unstable/workflow/WorkflowProxy.ts +32 -2
- package/src/unstable/workflow/WorkflowProxyServer.ts +40 -6
- package/src/unstable/workflow/index.ts +5 -0
package/src/Metric.ts
CHANGED
|
@@ -1,47 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
2
|
+
* The `Metric` module provides tools for defining, updating, tagging, and
|
|
3
|
+
* reading application metrics from Effect programs. A `Metric<Input, State>`
|
|
4
|
+
* accepts typed input values and aggregates them into a typed state that can be
|
|
5
|
+
* read directly or exported from a snapshot.
|
|
6
|
+
*
|
|
7
|
+
* **Mental model**
|
|
8
|
+
*
|
|
9
|
+
* - A metric has an identifier, a type, an optional description, optional attributes, and mutable aggregate state
|
|
10
|
+
* - Use counters for cumulative values such as requests, errors, retries, or bytes processed
|
|
11
|
+
* - Use gauges for point-in-time values that can rise or fall, such as active connections or queue size
|
|
12
|
+
* - Use frequencies to count occurrences of discrete string values, such as status codes or action names
|
|
13
|
+
* - Use histograms to bucket numeric observations and inspect count, min, max, and sum
|
|
14
|
+
* - Use summaries to calculate quantiles over a bounded, time-based observation window
|
|
15
|
+
* - Metrics are updated from effects with {@link update} and {@link modify}, and read with {@link value}
|
|
16
|
+
* - Attributes tag metrics with key-value dimensions so the same logical metric can be grouped by service, endpoint, method, or other labels
|
|
17
|
+
* - Snapshots capture the currently registered metrics and their aggregate states for reporting or export
|
|
18
|
+
*
|
|
19
|
+
* **Common tasks**
|
|
20
|
+
*
|
|
21
|
+
* - Create counters: {@link counter}
|
|
22
|
+
* - Create gauges: {@link gauge}
|
|
23
|
+
* - Create frequencies: {@link frequency}
|
|
24
|
+
* - Create histograms: {@link histogram}, {@link linearBoundaries}, {@link exponentialBoundaries}
|
|
25
|
+
* - Create summaries: {@link summary}, {@link summaryWithTimestamp}
|
|
26
|
+
* - Measure effect duration: {@link timer}
|
|
27
|
+
* - Update a metric: {@link update}
|
|
28
|
+
* - Apply relative updates where supported: {@link modify}
|
|
29
|
+
* - Read one metric: {@link value}
|
|
30
|
+
* - Tag a metric: {@link withAttributes}
|
|
31
|
+
* - Transform accepted input values: {@link mapInput}
|
|
32
|
+
* - Record a constant input for repeated events: {@link withConstantInput}
|
|
33
|
+
* - Inspect all registered metrics: {@link snapshot}, {@link dump}
|
|
34
|
+
* - Enable fiber runtime metrics: {@link enableRuntimeMetrics}
|
|
35
|
+
*
|
|
36
|
+
* **Gotchas**
|
|
37
|
+
*
|
|
38
|
+
* - Counter and gauge metrics can use `number` inputs by default or `bigint` inputs with the `bigint` option
|
|
39
|
+
* - Incremental counters ignore negative updates; use non-incremental counters only when decreases are meaningful
|
|
40
|
+
* - {@link update} sets a gauge to an absolute value, while {@link modify} changes it relative to its current value
|
|
41
|
+
* - Histogram buckets are cumulative and depend on the boundaries supplied when the metric is created
|
|
42
|
+
* - Summary quantiles are calculated from the configured sliding window, so old observations expire
|
|
43
|
+
* - Prefer low-cardinality attributes; using unbounded values such as request IDs can create too many metric series
|
|
44
|
+
*
|
|
45
|
+
* **Quickstart**
|
|
46
|
+
*
|
|
47
|
+
* **Example** (Creating and updating metrics)
|
|
40
48
|
*
|
|
41
49
|
* ```ts
|
|
42
50
|
* import { Effect, Metric } from "effect"
|
|
43
51
|
*
|
|
44
|
-
* // Create metrics
|
|
45
52
|
* const requestCount = Metric.counter("http_requests_total", {
|
|
46
53
|
* description: "Total number of HTTP requests"
|
|
47
54
|
* })
|
|
@@ -51,31 +58,7 @@
|
|
|
51
58
|
* boundaries: Metric.linearBoundaries({ start: 0, width: 50, count: 20 })
|
|
52
59
|
* })
|
|
53
60
|
*
|
|
54
|
-
* // Use metrics in your application
|
|
55
61
|
* const handleRequest = Effect.gen(function*() {
|
|
56
|
-
* yield* Metric.update(requestCount, 1)
|
|
57
|
-
*
|
|
58
|
-
* const startTime = yield* Effect.clockWith((clock) => clock.currentTimeMillis)
|
|
59
|
-
*
|
|
60
|
-
* // Process request...
|
|
61
|
-
* yield* Effect.sleep("100 millis")
|
|
62
|
-
*
|
|
63
|
-
* const endTime = yield* Effect.clockWith((clock) => clock.currentTimeMillis)
|
|
64
|
-
* yield* Metric.update(responseTime, endTime - startTime)
|
|
65
|
-
* })
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* ## Attributes and Tagging
|
|
69
|
-
*
|
|
70
|
-
* ```ts
|
|
71
|
-
* import { Effect, Metric } from "effect"
|
|
72
|
-
*
|
|
73
|
-
* const requestCount = Metric.counter("requests", {
|
|
74
|
-
* description: "Number of requests by endpoint and method"
|
|
75
|
-
* })
|
|
76
|
-
*
|
|
77
|
-
* const program = Effect.gen(function*() {
|
|
78
|
-
* // Add attributes to metrics
|
|
79
62
|
* yield* Metric.update(
|
|
80
63
|
* Metric.withAttributes(requestCount, {
|
|
81
64
|
* endpoint: "/api/users",
|
|
@@ -84,57 +67,21 @@
|
|
|
84
67
|
* 1
|
|
85
68
|
* )
|
|
86
69
|
*
|
|
87
|
-
*
|
|
88
|
-
* const taggedCounter = Metric.withAttributes(requestCount, {
|
|
89
|
-
* endpoint: "/api/posts",
|
|
90
|
-
* method: "POST"
|
|
91
|
-
* })
|
|
92
|
-
* yield* Metric.update(taggedCounter, 1)
|
|
93
|
-
* })
|
|
94
|
-
* ```
|
|
95
|
-
*
|
|
96
|
-
* ## Advanced Examples
|
|
97
|
-
*
|
|
98
|
-
* ```ts
|
|
99
|
-
* import { Effect, Metric } from "effect"
|
|
100
|
-
*
|
|
101
|
-
* // Business metrics
|
|
102
|
-
* const userSignups = Metric.counter("user_signups_total")
|
|
103
|
-
* const activeUsers = Metric.gauge("active_users_current")
|
|
104
|
-
* const featureUsage = Metric.frequency("feature_usage")
|
|
70
|
+
* yield* Metric.update(responseTime, 125)
|
|
105
71
|
*
|
|
106
|
-
*
|
|
107
|
-
* const dbQueryTime = Metric.summary("db_query_duration", {
|
|
108
|
-
* maxAge: "5 minutes",
|
|
109
|
-
* maxSize: 1000,
|
|
110
|
-
* quantiles: [0.5, 0.9, 0.95, 0.99]
|
|
72
|
+
* return yield* Metric.value(requestCount)
|
|
111
73
|
* })
|
|
74
|
+
* ```
|
|
112
75
|
*
|
|
113
|
-
*
|
|
114
|
-
* // Track user signup
|
|
115
|
-
* yield* Metric.update(userSignups, 1)
|
|
116
|
-
*
|
|
117
|
-
* // Update active user count
|
|
118
|
-
* yield* Metric.update(activeUsers, 1250)
|
|
119
|
-
*
|
|
120
|
-
* // Record feature usage
|
|
121
|
-
* yield* Metric.update(featureUsage, "dashboard_view")
|
|
76
|
+
* **See also**
|
|
122
77
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* }
|
|
128
|
-
*
|
|
129
|
-
* // Get metric snapshots
|
|
130
|
-
* const getMetrics = Effect.gen(function*() {
|
|
131
|
-
* const snapshots = yield* Metric.snapshot
|
|
78
|
+
* - {@link counter} / {@link gauge} / {@link frequency} for common metric types
|
|
79
|
+
* - {@link histogram} / {@link summary} for distribution metrics
|
|
80
|
+
* - {@link update} / {@link modify} / {@link value} for working with metric state
|
|
81
|
+
* - {@link withAttributes} for adding dimensions
|
|
82
|
+
* - {@link snapshot} for exporting all registered metric values
|
|
132
83
|
*
|
|
133
|
-
*
|
|
134
|
-
* console.log(`${metric.id}: ${JSON.stringify(metric.state)}`)
|
|
135
|
-
* }
|
|
136
|
-
* })
|
|
137
|
-
* ```
|
|
84
|
+
* @since 2.0.0
|
|
138
85
|
*/
|
|
139
86
|
|
|
140
87
|
import * as Arr from "./Array.ts"
|
|
@@ -170,7 +117,8 @@ import type { Contravariant, Covariant } from "./Types.ts"
|
|
|
170
117
|
* - Histograms
|
|
171
118
|
* - Summaries
|
|
172
119
|
*
|
|
173
|
-
*
|
|
120
|
+
* **Example** (Using multiple metric types)
|
|
121
|
+
*
|
|
174
122
|
* ```ts
|
|
175
123
|
* import { Data, Effect, Metric } from "effect"
|
|
176
124
|
*
|
|
@@ -224,8 +172,8 @@ import type { Contravariant, Covariant } from "./Types.ts"
|
|
|
224
172
|
* })
|
|
225
173
|
* ```
|
|
226
174
|
*
|
|
227
|
-
* @since 2.0.0
|
|
228
175
|
* @category Models
|
|
176
|
+
* @since 2.0.0
|
|
229
177
|
*/
|
|
230
178
|
export interface Metric<in Input, out State> extends Pipeable {
|
|
231
179
|
readonly [TypeId]: typeof TypeId
|
|
@@ -246,7 +194,8 @@ export interface Metric<in Input, out State> extends Pipeable {
|
|
|
246
194
|
* Counters are useful for tracking monotonically increasing values like request counts,
|
|
247
195
|
* bytes processed, errors encountered, or any value that accumulates over time.
|
|
248
196
|
*
|
|
249
|
-
*
|
|
197
|
+
* **Example** (Using counter metrics)
|
|
198
|
+
*
|
|
250
199
|
* ```ts
|
|
251
200
|
* import { Data, Effect, Metric } from "effect"
|
|
252
201
|
*
|
|
@@ -300,15 +249,16 @@ export interface Metric<in Input, out State> extends Pipeable {
|
|
|
300
249
|
* })
|
|
301
250
|
* ```
|
|
302
251
|
*
|
|
303
|
-
* @since 2.0.0
|
|
304
252
|
* @category Metrics
|
|
253
|
+
* @since 2.0.0
|
|
305
254
|
*/
|
|
306
255
|
export interface Counter<in Input extends number | bigint> extends Metric<Input, CounterState<Input>> {}
|
|
307
256
|
|
|
308
257
|
/**
|
|
309
258
|
* State interface for Counter metrics containing the current count and increment mode.
|
|
310
259
|
*
|
|
311
|
-
*
|
|
260
|
+
* **Example** (Reading counter state)
|
|
261
|
+
*
|
|
312
262
|
* ```ts
|
|
313
263
|
* import { Data, Effect, Metric } from "effect"
|
|
314
264
|
*
|
|
@@ -361,8 +311,8 @@ export interface Counter<in Input extends number | bigint> extends Metric<Input,
|
|
|
361
311
|
* })
|
|
362
312
|
* ```
|
|
363
313
|
*
|
|
364
|
-
* @since 2.0.0
|
|
365
314
|
* @category Counter
|
|
315
|
+
* @since 2.0.0
|
|
366
316
|
*/
|
|
367
317
|
export interface CounterState<in Input extends number | bigint> {
|
|
368
318
|
readonly count: Input extends bigint ? bigint : number
|
|
@@ -376,7 +326,8 @@ export interface CounterState<in Input extends number | bigint> {
|
|
|
376
326
|
* how many times specific string values occur, such as HTTP status codes, user actions,
|
|
377
327
|
* error types, or any discrete string-based events.
|
|
378
328
|
*
|
|
379
|
-
*
|
|
329
|
+
* **Example** (Using frequency metrics)
|
|
330
|
+
*
|
|
380
331
|
* ```ts
|
|
381
332
|
* import { Data, Effect, Metric } from "effect"
|
|
382
333
|
*
|
|
@@ -446,15 +397,16 @@ export interface CounterState<in Input extends number | bigint> {
|
|
|
446
397
|
* })
|
|
447
398
|
* ```
|
|
448
399
|
*
|
|
449
|
-
* @since 2.0.0
|
|
450
400
|
* @category Metrics
|
|
401
|
+
* @since 2.0.0
|
|
451
402
|
*/
|
|
452
403
|
export interface Frequency extends Metric<string, FrequencyState> {}
|
|
453
404
|
|
|
454
405
|
/**
|
|
455
406
|
* State interface for Frequency metrics containing occurrence counts for discrete string values.
|
|
456
407
|
*
|
|
457
|
-
*
|
|
408
|
+
* **Example** (Reading frequency state)
|
|
409
|
+
*
|
|
458
410
|
* ```ts
|
|
459
411
|
* import { Data, Effect, Metric } from "effect"
|
|
460
412
|
*
|
|
@@ -530,8 +482,8 @@ export interface Frequency extends Metric<string, FrequencyState> {}
|
|
|
530
482
|
* })
|
|
531
483
|
* ```
|
|
532
484
|
*
|
|
533
|
-
* @since 2.0.0
|
|
534
485
|
* @category Metrics
|
|
486
|
+
* @since 2.0.0
|
|
535
487
|
*/
|
|
536
488
|
export interface FrequencyState {
|
|
537
489
|
readonly occurrences: ReadonlyMap<string, number>
|
|
@@ -543,7 +495,8 @@ export interface FrequencyState {
|
|
|
543
495
|
* Gauges are useful for tracking current state values like memory usage, CPU load,
|
|
544
496
|
* active connections, queue sizes, or any value that represents a current level.
|
|
545
497
|
*
|
|
546
|
-
*
|
|
498
|
+
* **Example** (Using gauge metrics)
|
|
499
|
+
*
|
|
547
500
|
* ```ts
|
|
548
501
|
* import { Data, Effect, Metric } from "effect"
|
|
549
502
|
*
|
|
@@ -590,15 +543,16 @@ export interface FrequencyState {
|
|
|
590
543
|
* })
|
|
591
544
|
* ```
|
|
592
545
|
*
|
|
593
|
-
* @since 2.0.0
|
|
594
546
|
* @category Metrics
|
|
547
|
+
* @since 2.0.0
|
|
595
548
|
*/
|
|
596
549
|
export interface Gauge<in Input extends number | bigint> extends Metric<Input, GaugeState<Input>> {}
|
|
597
550
|
|
|
598
551
|
/**
|
|
599
552
|
* State interface for Gauge metrics containing the current instantaneous value.
|
|
600
553
|
*
|
|
601
|
-
*
|
|
554
|
+
* **Example** (Reading gauge state)
|
|
555
|
+
*
|
|
602
556
|
* ```ts
|
|
603
557
|
* import { Data, Effect, Metric } from "effect"
|
|
604
558
|
*
|
|
@@ -658,8 +612,8 @@ export interface Gauge<in Input extends number | bigint> extends Metric<Input, G
|
|
|
658
612
|
* })
|
|
659
613
|
* ```
|
|
660
614
|
*
|
|
661
|
-
* @since 2.0.0
|
|
662
615
|
* @category Metrics
|
|
616
|
+
* @since 2.0.0
|
|
663
617
|
*/
|
|
664
618
|
export interface GaugeState<in Input extends number | bigint> {
|
|
665
619
|
readonly value: Input extends bigint ? bigint : number
|
|
@@ -671,7 +625,8 @@ export interface GaugeState<in Input extends number | bigint> {
|
|
|
671
625
|
* Histograms are ideal for measuring request durations, response sizes, and other continuous values
|
|
672
626
|
* where you need to understand the distribution of values rather than just aggregates.
|
|
673
627
|
*
|
|
674
|
-
*
|
|
628
|
+
* **Example** (Using histogram metrics)
|
|
629
|
+
*
|
|
675
630
|
* ```ts
|
|
676
631
|
* import { Data, Effect, Metric } from "effect"
|
|
677
632
|
*
|
|
@@ -746,15 +701,16 @@ export interface GaugeState<in Input extends number | bigint> {
|
|
|
746
701
|
* })
|
|
747
702
|
* ```
|
|
748
703
|
*
|
|
749
|
-
* @since 2.0.0
|
|
750
704
|
* @category Metrics
|
|
705
|
+
* @since 2.0.0
|
|
751
706
|
*/
|
|
752
707
|
export interface Histogram<Input> extends Metric<Input, HistogramState> {}
|
|
753
708
|
|
|
754
709
|
/**
|
|
755
710
|
* State interface for Histogram metrics containing bucket distributions and aggregate statistics.
|
|
756
711
|
*
|
|
757
|
-
*
|
|
712
|
+
* **Example** (Reading histogram state)
|
|
713
|
+
*
|
|
758
714
|
* ```ts
|
|
759
715
|
* import { Data, Effect, Metric } from "effect"
|
|
760
716
|
*
|
|
@@ -832,8 +788,8 @@ export interface Histogram<Input> extends Metric<Input, HistogramState> {}
|
|
|
832
788
|
* })
|
|
833
789
|
* ```
|
|
834
790
|
*
|
|
835
|
-
* @since 2.0.0
|
|
836
791
|
* @category Metrics
|
|
792
|
+
* @since 2.0.0
|
|
837
793
|
*/
|
|
838
794
|
export interface HistogramState {
|
|
839
795
|
readonly buckets: ReadonlyArray<[number, number]>
|
|
@@ -850,7 +806,8 @@ export interface HistogramState {
|
|
|
850
806
|
* (percentiles) such as median (50th), 95th percentile, 99th percentile, etc. They're ideal for
|
|
851
807
|
* understanding performance characteristics like response time distributions.
|
|
852
808
|
*
|
|
853
|
-
*
|
|
809
|
+
* **Example** (Using summary metrics)
|
|
810
|
+
*
|
|
854
811
|
* ```ts
|
|
855
812
|
* import { Data, Effect, Metric } from "effect"
|
|
856
813
|
*
|
|
@@ -935,15 +892,16 @@ export interface HistogramState {
|
|
|
935
892
|
* })
|
|
936
893
|
* ```
|
|
937
894
|
*
|
|
938
|
-
* @since 2.0.0
|
|
939
895
|
* @category Metrics
|
|
896
|
+
* @since 2.0.0
|
|
940
897
|
*/
|
|
941
898
|
export interface Summary<Input> extends Metric<Input, SummaryState> {}
|
|
942
899
|
|
|
943
900
|
/**
|
|
944
901
|
* State interface for Summary metrics containing quantile calculations and aggregate statistics.
|
|
945
902
|
*
|
|
946
|
-
*
|
|
903
|
+
* **Example** (Reading summary state)
|
|
904
|
+
*
|
|
947
905
|
* ```ts
|
|
948
906
|
* import { Data, Effect, Metric } from "effect"
|
|
949
907
|
*
|
|
@@ -1016,8 +974,8 @@ export interface Summary<Input> extends Metric<Input, SummaryState> {}
|
|
|
1016
974
|
* })
|
|
1017
975
|
* ```
|
|
1018
976
|
*
|
|
1019
|
-
* @since 2.0.0
|
|
1020
977
|
* @category Metrics
|
|
978
|
+
* @since 2.0.0
|
|
1021
979
|
*/
|
|
1022
980
|
export interface SummaryState {
|
|
1023
981
|
readonly quantiles: ReadonlyArray<readonly [number, number | undefined]>
|
|
@@ -1031,7 +989,8 @@ export interface SummaryState {
|
|
|
1031
989
|
* The `Metric` namespace provides a comprehensive system for collecting, aggregating, and observing
|
|
1032
990
|
* application metrics in Effect applications.
|
|
1033
991
|
*
|
|
1034
|
-
*
|
|
992
|
+
* **Example** (Collecting application metrics)
|
|
993
|
+
*
|
|
1035
994
|
* ```ts
|
|
1036
995
|
* import { Data, Effect, Metric } from "effect"
|
|
1037
996
|
*
|
|
@@ -1069,14 +1028,15 @@ export interface SummaryState {
|
|
|
1069
1028
|
* })
|
|
1070
1029
|
* ```
|
|
1071
1030
|
*
|
|
1072
|
-
* @since 2.0.0
|
|
1073
1031
|
* @category models
|
|
1032
|
+
* @since 2.0.0
|
|
1074
1033
|
*/
|
|
1075
1034
|
export declare namespace Metric {
|
|
1076
1035
|
/**
|
|
1077
1036
|
* Union type representing all available metric types in the Effect metrics system.
|
|
1078
1037
|
*
|
|
1079
|
-
*
|
|
1038
|
+
* **Example** (Inspecting metric types)
|
|
1039
|
+
*
|
|
1080
1040
|
* ```ts
|
|
1081
1041
|
* import { Data, Effect, Metric } from "effect"
|
|
1082
1042
|
*
|
|
@@ -1148,15 +1108,16 @@ export declare namespace Metric {
|
|
|
1148
1108
|
* })
|
|
1149
1109
|
* ```
|
|
1150
1110
|
*
|
|
1151
|
-
* @since 2.0.0
|
|
1152
1111
|
* @category types
|
|
1112
|
+
* @since 2.0.0
|
|
1153
1113
|
*/
|
|
1154
1114
|
export type Type = "Counter" | "Frequency" | "Gauge" | "Histogram" | "Summary"
|
|
1155
1115
|
|
|
1156
1116
|
/**
|
|
1157
1117
|
* Union type for metric attributes that can be provided as either an object or array of tuples.
|
|
1158
1118
|
*
|
|
1159
|
-
*
|
|
1119
|
+
* **Example** (Providing attributes in different formats)
|
|
1120
|
+
*
|
|
1160
1121
|
* ```ts
|
|
1161
1122
|
* import { Data, Effect, Metric } from "effect"
|
|
1162
1123
|
*
|
|
@@ -1223,15 +1184,16 @@ export declare namespace Metric {
|
|
|
1223
1184
|
* })
|
|
1224
1185
|
* ```
|
|
1225
1186
|
*
|
|
1226
|
-
* @since 2.0.0
|
|
1227
1187
|
* @category types
|
|
1188
|
+
* @since 2.0.0
|
|
1228
1189
|
*/
|
|
1229
1190
|
export type Attributes = AttributeSet | ReadonlyArray<[string, string]>
|
|
1230
1191
|
|
|
1231
1192
|
/**
|
|
1232
1193
|
* Type for metric attributes as a readonly record of string key-value pairs.
|
|
1233
1194
|
*
|
|
1234
|
-
*
|
|
1195
|
+
* **Example** (Combining metric attribute sets)
|
|
1196
|
+
*
|
|
1235
1197
|
* ```ts
|
|
1236
1198
|
* import { Data, Effect, Metric } from "effect"
|
|
1237
1199
|
*
|
|
@@ -1300,15 +1262,16 @@ export declare namespace Metric {
|
|
|
1300
1262
|
* })
|
|
1301
1263
|
* ```
|
|
1302
1264
|
*
|
|
1303
|
-
* @since 2.0.0
|
|
1304
1265
|
* @category types
|
|
1266
|
+
* @since 2.0.0
|
|
1305
1267
|
*/
|
|
1306
1268
|
export type AttributeSet = Readonly<Record<string, string>>
|
|
1307
1269
|
|
|
1308
1270
|
/**
|
|
1309
1271
|
* Utility type to extract the Input type from a Metric type.
|
|
1310
1272
|
*
|
|
1311
|
-
*
|
|
1273
|
+
* **Example** (Extracting metric input types)
|
|
1274
|
+
*
|
|
1312
1275
|
* ```ts
|
|
1313
1276
|
* import { Metric } from "effect"
|
|
1314
1277
|
*
|
|
@@ -1349,8 +1312,8 @@ export declare namespace Metric {
|
|
|
1349
1312
|
* // Metric.update(stringFrequency, 404) // ✗ Type error
|
|
1350
1313
|
* ```
|
|
1351
1314
|
*
|
|
1352
|
-
* @since 2.0.0
|
|
1353
1315
|
* @category types
|
|
1316
|
+
* @since 2.0.0
|
|
1354
1317
|
*/
|
|
1355
1318
|
export type Input<A> = A extends Metric<infer _Input, infer _State> ? _Input
|
|
1356
1319
|
: never
|
|
@@ -1358,7 +1321,8 @@ export declare namespace Metric {
|
|
|
1358
1321
|
/**
|
|
1359
1322
|
* Utility type to extract the State type from a Metric type.
|
|
1360
1323
|
*
|
|
1361
|
-
*
|
|
1324
|
+
* **Example** (Extracting metric state types)
|
|
1325
|
+
*
|
|
1362
1326
|
* ```ts
|
|
1363
1327
|
* import { Effect, Metric } from "effect"
|
|
1364
1328
|
*
|
|
@@ -1408,8 +1372,8 @@ export declare namespace Metric {
|
|
|
1408
1372
|
* })
|
|
1409
1373
|
* ```
|
|
1410
1374
|
*
|
|
1411
|
-
* @since 2.0.0
|
|
1412
1375
|
* @category types
|
|
1376
|
+
* @since 2.0.0
|
|
1413
1377
|
*/
|
|
1414
1378
|
export type State<A> = A extends Metric<infer _Input, infer _State> ? _State
|
|
1415
1379
|
: never
|
|
@@ -1417,7 +1381,8 @@ export declare namespace Metric {
|
|
|
1417
1381
|
/**
|
|
1418
1382
|
* Interface defining the core hooks for metric operations: get, update, and modify.
|
|
1419
1383
|
*
|
|
1420
|
-
*
|
|
1384
|
+
* **Example** (Using metric hooks)
|
|
1385
|
+
*
|
|
1421
1386
|
* ```ts
|
|
1422
1387
|
* import { Data, Effect, Metric } from "effect"
|
|
1423
1388
|
*
|
|
@@ -1453,8 +1418,8 @@ export declare namespace Metric {
|
|
|
1453
1418
|
* })
|
|
1454
1419
|
* ```
|
|
1455
1420
|
*
|
|
1456
|
-
* @since 2.0.0
|
|
1457
1421
|
* @category interfaces
|
|
1422
|
+
* @since 2.0.0
|
|
1458
1423
|
*/
|
|
1459
1424
|
export interface Hooks<in Input, out State> {
|
|
1460
1425
|
readonly get: (context: Context.Context<never>) => State
|
|
@@ -1465,7 +1430,8 @@ export declare namespace Metric {
|
|
|
1465
1430
|
/**
|
|
1466
1431
|
* Interface containing complete metadata information about a metric.
|
|
1467
1432
|
*
|
|
1468
|
-
*
|
|
1433
|
+
* **Example** (Inspecting metric metadata)
|
|
1434
|
+
*
|
|
1469
1435
|
* ```ts
|
|
1470
1436
|
* import { Data, Effect, Metric } from "effect"
|
|
1471
1437
|
*
|
|
@@ -1518,8 +1484,8 @@ export declare namespace Metric {
|
|
|
1518
1484
|
* })
|
|
1519
1485
|
* ```
|
|
1520
1486
|
*
|
|
1521
|
-
* @since 4.0.0
|
|
1522
1487
|
* @category interfaces
|
|
1488
|
+
* @since 4.0.0
|
|
1523
1489
|
*/
|
|
1524
1490
|
export interface Metadata<in Input, out State> {
|
|
1525
1491
|
readonly id: string
|
|
@@ -1532,7 +1498,8 @@ export declare namespace Metric {
|
|
|
1532
1498
|
/**
|
|
1533
1499
|
* Protocol interface for metric snapshots containing metadata and current state.
|
|
1534
1500
|
*
|
|
1535
|
-
*
|
|
1501
|
+
* **Example** (Inspecting metric snapshot protocols)
|
|
1502
|
+
*
|
|
1536
1503
|
* ```ts
|
|
1537
1504
|
* import { Data, Effect, Metric } from "effect"
|
|
1538
1505
|
*
|
|
@@ -1590,8 +1557,8 @@ export declare namespace Metric {
|
|
|
1590
1557
|
* })
|
|
1591
1558
|
* ```
|
|
1592
1559
|
*
|
|
1593
|
-
* @since 4.0.0
|
|
1594
1560
|
* @category interfaces
|
|
1561
|
+
* @since 4.0.0
|
|
1595
1562
|
*/
|
|
1596
1563
|
export interface SnapshotProto<T extends Type, State> {
|
|
1597
1564
|
readonly id: string
|
|
@@ -1604,7 +1571,8 @@ export declare namespace Metric {
|
|
|
1604
1571
|
/**
|
|
1605
1572
|
* Union type representing all possible metric snapshot types with their corresponding states.
|
|
1606
1573
|
*
|
|
1607
|
-
*
|
|
1574
|
+
* **Example** (Analyzing metric snapshots)
|
|
1575
|
+
*
|
|
1608
1576
|
* ```ts
|
|
1609
1577
|
* import { Data, Effect, Metric } from "effect"
|
|
1610
1578
|
*
|
|
@@ -1666,8 +1634,8 @@ export declare namespace Metric {
|
|
|
1666
1634
|
* })
|
|
1667
1635
|
* ```
|
|
1668
1636
|
*
|
|
1669
|
-
* @since 4.0.0
|
|
1670
1637
|
* @category types
|
|
1638
|
+
* @since 4.0.0
|
|
1671
1639
|
*/
|
|
1672
1640
|
export type Snapshot =
|
|
1673
1641
|
| SnapshotProto<"Counter", CounterState<number | bigint>>
|
|
@@ -1680,7 +1648,8 @@ export declare namespace Metric {
|
|
|
1680
1648
|
/**
|
|
1681
1649
|
* Service key for the current metric attributes context.
|
|
1682
1650
|
*
|
|
1683
|
-
*
|
|
1651
|
+
* **Example** (Using the current attributes key)
|
|
1652
|
+
*
|
|
1684
1653
|
* ```ts
|
|
1685
1654
|
* import { Data, Effect, Metric } from "effect"
|
|
1686
1655
|
*
|
|
@@ -1722,15 +1691,22 @@ export declare namespace Metric {
|
|
|
1722
1691
|
* })
|
|
1723
1692
|
* ```
|
|
1724
1693
|
*
|
|
1725
|
-
* @since 4.0.0
|
|
1726
1694
|
* @category References
|
|
1695
|
+
* @since 4.0.0
|
|
1727
1696
|
*/
|
|
1728
1697
|
export const CurrentMetricAttributesKey = "effect/Metric/CurrentMetricAttributes" as const
|
|
1729
1698
|
|
|
1730
1699
|
/**
|
|
1731
|
-
*
|
|
1700
|
+
* `Context.Reference` for metric attributes applied from the current Effect
|
|
1701
|
+
* context.
|
|
1702
|
+
*
|
|
1703
|
+
* **Details**
|
|
1704
|
+
* The default value is an empty attribute set. Metric reads and updates merge
|
|
1705
|
+
* these contextual attributes with the metric's own attributes to select the
|
|
1706
|
+
* metric series being accessed.
|
|
1707
|
+
*
|
|
1708
|
+
* **Example** (Providing current metric attributes)
|
|
1732
1709
|
*
|
|
1733
|
-
* @example
|
|
1734
1710
|
* ```ts
|
|
1735
1711
|
* import { Data, Effect, Metric } from "effect"
|
|
1736
1712
|
*
|
|
@@ -1758,8 +1734,8 @@ export const CurrentMetricAttributesKey = "effect/Metric/CurrentMetricAttributes
|
|
|
1758
1734
|
* })
|
|
1759
1735
|
* ```
|
|
1760
1736
|
*
|
|
1761
|
-
* @since 4.0.0
|
|
1762
1737
|
* @category References
|
|
1738
|
+
* @since 4.0.0
|
|
1763
1739
|
*/
|
|
1764
1740
|
export const CurrentMetricAttributes = Context.Reference<Metric.AttributeSet>(CurrentMetricAttributesKey, {
|
|
1765
1741
|
defaultValue: () => ({})
|
|
@@ -1768,10 +1744,14 @@ export const CurrentMetricAttributes = Context.Reference<Metric.AttributeSet>(Cu
|
|
|
1768
1744
|
const MetricRegistryKey = "~effect/observability/Metric/MetricRegistryKey"
|
|
1769
1745
|
|
|
1770
1746
|
/**
|
|
1771
|
-
*
|
|
1747
|
+
* `Context.Reference` for the metric registry in the current context.
|
|
1748
|
+
*
|
|
1749
|
+
* **Details**
|
|
1750
|
+
* The default registry is an empty `Map`. Metrics register their metadata and
|
|
1751
|
+
* hooks lazily in this map when they are read or updated.
|
|
1772
1752
|
*
|
|
1773
|
-
* @since 4.0.0
|
|
1774
1753
|
* @category References
|
|
1754
|
+
* @since 4.0.0
|
|
1775
1755
|
*/
|
|
1776
1756
|
export const MetricRegistry = Context.Reference<Map<string, Metric.Metadata<any, any>>>(
|
|
1777
1757
|
MetricRegistryKey,
|
|
@@ -2150,7 +2130,8 @@ class MetricTransform<in Input, out State, in Input2> extends Metric$<Input2, St
|
|
|
2150
2130
|
* This function is useful for runtime type checking and ensuring that a value
|
|
2151
2131
|
* conforms to the Metric interface before performing metric operations.
|
|
2152
2132
|
*
|
|
2153
|
-
*
|
|
2133
|
+
* **Example** (Checking metric values)
|
|
2134
|
+
*
|
|
2154
2135
|
* ```ts
|
|
2155
2136
|
* import { Metric } from "effect"
|
|
2156
2137
|
*
|
|
@@ -2164,8 +2145,8 @@ class MetricTransform<in Input, out State, in Input2> extends Metric$<Input2, St
|
|
|
2164
2145
|
* console.log(Metric.isMetric(null)) // false
|
|
2165
2146
|
* ```
|
|
2166
2147
|
*
|
|
2167
|
-
* @since 4.0.0
|
|
2168
2148
|
* @category Guards
|
|
2149
|
+
* @since 4.0.0
|
|
2169
2150
|
*/
|
|
2170
2151
|
export const isMetric = (u: unknown): u is Metric<unknown, never> =>
|
|
2171
2152
|
Predicate.hasProperty(u, "~effect/Metric") && u["~effect/Metric"] === "~effect/Metric"
|
|
@@ -2183,7 +2164,8 @@ export const isMetric = (u: unknown): u is Metric<unknown, never> =>
|
|
|
2183
2164
|
* - `incremental` - Set to `true` to create a `Counter` that can only ever be
|
|
2184
2165
|
* incremented.
|
|
2185
2166
|
*
|
|
2186
|
-
*
|
|
2167
|
+
* **Example** (Creating counter metrics)
|
|
2168
|
+
*
|
|
2187
2169
|
* ```ts
|
|
2188
2170
|
* import { Data, Effect, Metric } from "effect"
|
|
2189
2171
|
*
|
|
@@ -2225,8 +2207,8 @@ export const isMetric = (u: unknown): u is Metric<unknown, never> =>
|
|
|
2225
2207
|
* })
|
|
2226
2208
|
* ```
|
|
2227
2209
|
*
|
|
2228
|
-
* @since 2.0.0
|
|
2229
2210
|
* @category Constructors
|
|
2211
|
+
* @since 2.0.0
|
|
2230
2212
|
*/
|
|
2231
2213
|
export const counter: {
|
|
2232
2214
|
/**
|
|
@@ -2242,7 +2224,8 @@ export const counter: {
|
|
|
2242
2224
|
* - `incremental` - Set to `true` to create a `Counter` that can only ever be
|
|
2243
2225
|
* incremented.
|
|
2244
2226
|
*
|
|
2245
|
-
*
|
|
2227
|
+
* **Example** (Creating counter metrics)
|
|
2228
|
+
*
|
|
2246
2229
|
* ```ts
|
|
2247
2230
|
* import { Data, Effect, Metric } from "effect"
|
|
2248
2231
|
*
|
|
@@ -2284,8 +2267,8 @@ export const counter: {
|
|
|
2284
2267
|
* })
|
|
2285
2268
|
* ```
|
|
2286
2269
|
*
|
|
2287
|
-
* @since 2.0.0
|
|
2288
2270
|
* @category Constructors
|
|
2271
|
+
* @since 2.0.0
|
|
2289
2272
|
*/
|
|
2290
2273
|
(
|
|
2291
2274
|
name: string,
|
|
@@ -2309,7 +2292,8 @@ export const counter: {
|
|
|
2309
2292
|
* - `incremental` - Set to `true` to create a `Counter` that can only ever be
|
|
2310
2293
|
* incremented.
|
|
2311
2294
|
*
|
|
2312
|
-
*
|
|
2295
|
+
* **Example** (Creating counter metrics)
|
|
2296
|
+
*
|
|
2313
2297
|
* ```ts
|
|
2314
2298
|
* import { Data, Effect, Metric } from "effect"
|
|
2315
2299
|
*
|
|
@@ -2351,8 +2335,8 @@ export const counter: {
|
|
|
2351
2335
|
* })
|
|
2352
2336
|
* ```
|
|
2353
2337
|
*
|
|
2354
|
-
* @since 2.0.0
|
|
2355
2338
|
* @category Constructors
|
|
2339
|
+
* @since 2.0.0
|
|
2356
2340
|
*/
|
|
2357
2341
|
(
|
|
2358
2342
|
name: string,
|
|
@@ -2378,7 +2362,8 @@ export const counter: {
|
|
|
2378
2362
|
* - `attributes` - The attributes to associate with the `Gauge`.
|
|
2379
2363
|
* - `bigint` - Indicates if the `Gauge` should use the `bigint` type.
|
|
2380
2364
|
*
|
|
2381
|
-
*
|
|
2365
|
+
* **Example** (Creating gauge metrics)
|
|
2366
|
+
*
|
|
2382
2367
|
* ```ts
|
|
2383
2368
|
* import { Data, Effect, Metric } from "effect"
|
|
2384
2369
|
*
|
|
@@ -2425,8 +2410,8 @@ export const counter: {
|
|
|
2425
2410
|
* })
|
|
2426
2411
|
* ```
|
|
2427
2412
|
*
|
|
2428
|
-
* @since 2.0.0
|
|
2429
2413
|
* @category Constructors
|
|
2414
|
+
* @since 2.0.0
|
|
2430
2415
|
*/
|
|
2431
2416
|
export const gauge: {
|
|
2432
2417
|
/**
|
|
@@ -2442,7 +2427,8 @@ export const gauge: {
|
|
|
2442
2427
|
* - `attributes` - The attributes to associate with the `Gauge`.
|
|
2443
2428
|
* - `bigint` - Indicates if the `Gauge` should use the `bigint` type.
|
|
2444
2429
|
*
|
|
2445
|
-
*
|
|
2430
|
+
* **Example** (Creating gauge metrics)
|
|
2431
|
+
*
|
|
2446
2432
|
* ```ts
|
|
2447
2433
|
* import { Data, Effect, Metric } from "effect"
|
|
2448
2434
|
*
|
|
@@ -2489,8 +2475,8 @@ export const gauge: {
|
|
|
2489
2475
|
* })
|
|
2490
2476
|
* ```
|
|
2491
2477
|
*
|
|
2492
|
-
* @since 2.0.0
|
|
2493
2478
|
* @category Constructors
|
|
2479
|
+
* @since 2.0.0
|
|
2494
2480
|
*/
|
|
2495
2481
|
(
|
|
2496
2482
|
name: string,
|
|
@@ -2513,7 +2499,8 @@ export const gauge: {
|
|
|
2513
2499
|
* - `attributes` - The attributes to associate with the `Gauge`.
|
|
2514
2500
|
* - `bigint` - Indicates if the `Gauge` should use the `bigint` type.
|
|
2515
2501
|
*
|
|
2516
|
-
*
|
|
2502
|
+
* **Example** (Creating gauge metrics)
|
|
2503
|
+
*
|
|
2517
2504
|
* ```ts
|
|
2518
2505
|
* import { Data, Effect, Metric } from "effect"
|
|
2519
2506
|
*
|
|
@@ -2560,8 +2547,8 @@ export const gauge: {
|
|
|
2560
2547
|
* })
|
|
2561
2548
|
* ```
|
|
2562
2549
|
*
|
|
2563
|
-
* @since 2.0.0
|
|
2564
2550
|
* @category Constructors
|
|
2551
|
+
* @since 2.0.0
|
|
2565
2552
|
*/
|
|
2566
2553
|
(
|
|
2567
2554
|
name: string,
|
|
@@ -2587,7 +2574,8 @@ export const gauge: {
|
|
|
2587
2574
|
* - `preregisteredWords` - Occurrences which are pre-registered with the
|
|
2588
2575
|
* `Frequency` metric occurrences.
|
|
2589
2576
|
*
|
|
2590
|
-
*
|
|
2577
|
+
* **Example** (Creating frequency metrics)
|
|
2578
|
+
*
|
|
2591
2579
|
* ```ts
|
|
2592
2580
|
* import { Data, Effect, Metric } from "effect"
|
|
2593
2581
|
*
|
|
@@ -2645,8 +2633,8 @@ export const gauge: {
|
|
|
2645
2633
|
* })
|
|
2646
2634
|
* ```
|
|
2647
2635
|
*
|
|
2648
|
-
* @since 2.0.0
|
|
2649
2636
|
* @category Constructors
|
|
2637
|
+
* @since 2.0.0
|
|
2650
2638
|
*/
|
|
2651
2639
|
export const frequency = (name: string, options?: {
|
|
2652
2640
|
readonly description?: string | undefined
|
|
@@ -2666,7 +2654,8 @@ export const frequency = (name: string, options?: {
|
|
|
2666
2654
|
* - `attributes` - The attributes to associate with the `Histogram`.
|
|
2667
2655
|
* - `boundaries` - The bucket boundaries of the `Histogram`
|
|
2668
2656
|
*
|
|
2669
|
-
*
|
|
2657
|
+
* **Example** (Creating histogram metrics)
|
|
2658
|
+
*
|
|
2670
2659
|
* ```ts
|
|
2671
2660
|
* import { Data, Effect, Metric } from "effect"
|
|
2672
2661
|
*
|
|
@@ -2721,8 +2710,8 @@ export const frequency = (name: string, options?: {
|
|
|
2721
2710
|
* })
|
|
2722
2711
|
* ```
|
|
2723
2712
|
*
|
|
2724
|
-
* @since 2.0.0
|
|
2725
2713
|
* @category Constructors
|
|
2714
|
+
* @since 2.0.0
|
|
2726
2715
|
*/
|
|
2727
2716
|
export const histogram = (name: string, options: {
|
|
2728
2717
|
readonly description?: string | undefined
|
|
@@ -2745,7 +2734,8 @@ export const histogram = (name: string, options: {
|
|
|
2745
2734
|
* - `maxSize` - The maximum number of observations to keep.
|
|
2746
2735
|
* - `quantiles` - An array of quantiles to calculate (e.g., [0.5, 0.9]).
|
|
2747
2736
|
*
|
|
2748
|
-
*
|
|
2737
|
+
* **Example** (Creating summary metrics)
|
|
2738
|
+
*
|
|
2749
2739
|
* ```ts
|
|
2750
2740
|
* import { Data, Duration, Effect, Metric } from "effect"
|
|
2751
2741
|
*
|
|
@@ -2771,13 +2761,10 @@ export const histogram = (name: string, options: {
|
|
|
2771
2761
|
* attributes: { service: "upload-service" }
|
|
2772
2762
|
* })
|
|
2773
2763
|
*
|
|
2774
|
-
* //
|
|
2775
|
-
*
|
|
2776
|
-
*
|
|
2764
|
+
* // Record deterministic response times
|
|
2765
|
+
* const responseTimes = [82, 96, 104, 118, 135, 170, 210, 240]
|
|
2766
|
+
* for (const responseTime of responseTimes) {
|
|
2777
2767
|
* yield* Metric.update(responseTimeSummary, responseTime)
|
|
2778
|
-
*
|
|
2779
|
-
* // Wait a bit to simulate different timestamps
|
|
2780
|
-
* yield* Effect.sleep(Duration.millis(100))
|
|
2781
2768
|
* }
|
|
2782
2769
|
*
|
|
2783
2770
|
* // Record some payload sizes
|
|
@@ -2790,20 +2777,28 @@ export const histogram = (name: string, options: {
|
|
|
2790
2777
|
* const responseStats = yield* Metric.value(responseTimeSummary)
|
|
2791
2778
|
* const payloadStats = yield* Metric.value(payloadSizeSummary)
|
|
2792
2779
|
*
|
|
2793
|
-
*
|
|
2794
|
-
*
|
|
2795
|
-
*
|
|
2796
|
-
*
|
|
2780
|
+
* console.log({
|
|
2781
|
+
* count: responseStats.count,
|
|
2782
|
+
* min: responseStats.min,
|
|
2783
|
+
* max: responseStats.max,
|
|
2784
|
+
* sum: responseStats.sum
|
|
2785
|
+
* }) // { count: 8, min: 82, max: 240, sum: 1155 }
|
|
2797
2786
|
*
|
|
2798
|
-
*
|
|
2799
|
-
*
|
|
2787
|
+
* console.log({
|
|
2788
|
+
* count: payloadStats.count,
|
|
2789
|
+
* min: payloadStats.min,
|
|
2790
|
+
* max: payloadStats.max,
|
|
2791
|
+
* sum: payloadStats.sum
|
|
2792
|
+
* }) // { count: 4, min: 1.2, max: 15.6, sum: 26 }
|
|
2793
|
+
*
|
|
2794
|
+
* // Both summaries include quantile information for their configured windows.
|
|
2800
2795
|
*
|
|
2801
2796
|
* return { responseStats, payloadStats }
|
|
2802
2797
|
* })
|
|
2803
2798
|
* ```
|
|
2804
2799
|
*
|
|
2805
|
-
* @since 2.0.0
|
|
2806
2800
|
* @category Constructors
|
|
2801
|
+
* @since 2.0.0
|
|
2807
2802
|
*/
|
|
2808
2803
|
export const summary = (name: string, options: {
|
|
2809
2804
|
readonly description?: string | undefined
|
|
@@ -2819,11 +2814,12 @@ export const summary = (name: string, options: {
|
|
|
2819
2814
|
] as [number, number])
|
|
2820
2815
|
|
|
2821
2816
|
/**
|
|
2822
|
-
* Creates a `Summary` metric that records observations
|
|
2823
|
-
*
|
|
2817
|
+
* Creates a `Summary` metric that records observations with explicit
|
|
2818
|
+
* timestamps and calculates quantiles.
|
|
2824
2819
|
*
|
|
2825
|
-
* Summary metrics are most suitable for
|
|
2826
|
-
*
|
|
2820
|
+
* Summary metrics are most suitable for statistical information about a set of
|
|
2821
|
+
* values. Inputs to this metric are `[value, timestamp]` pairs; the current
|
|
2822
|
+
* clock is used when reading quantiles against the configured `maxAge`.
|
|
2827
2823
|
*
|
|
2828
2824
|
* **Options**
|
|
2829
2825
|
*
|
|
@@ -2833,7 +2829,8 @@ export const summary = (name: string, options: {
|
|
|
2833
2829
|
* - `maxSize` - The maximum number of observations to keep.
|
|
2834
2830
|
* - `quantiles` - An array of quantiles to calculate (e.g., [0.5, 0.9]).
|
|
2835
2831
|
*
|
|
2836
|
-
*
|
|
2832
|
+
* **Example** (Creating summaries with explicit timestamps)
|
|
2833
|
+
*
|
|
2837
2834
|
* ```ts
|
|
2838
2835
|
* import { Metric } from "effect"
|
|
2839
2836
|
*
|
|
@@ -2848,8 +2845,8 @@ export const summary = (name: string, options: {
|
|
|
2848
2845
|
* )
|
|
2849
2846
|
* ```
|
|
2850
2847
|
*
|
|
2851
|
-
* @since 2.0.0
|
|
2852
2848
|
* @category Constructors
|
|
2849
|
+
* @since 2.0.0
|
|
2853
2850
|
*/
|
|
2854
2851
|
export const summaryWithTimestamp = (name: string, options: {
|
|
2855
2852
|
readonly description?: string | undefined
|
|
@@ -2869,7 +2866,8 @@ export const summaryWithTimestamp = (name: string, options: {
|
|
|
2869
2866
|
* If `options.boundaries` is not provided, the boundaries will be computed
|
|
2870
2867
|
* using `Metric.exponentialBoundaries({ start: 0.5, factor: 2, count: 35 })`.
|
|
2871
2868
|
*
|
|
2872
|
-
*
|
|
2869
|
+
* **Example** (Recording durations with a timer)
|
|
2870
|
+
*
|
|
2873
2871
|
* ```ts
|
|
2874
2872
|
* import { Data, Duration, Effect, Metric } from "effect"
|
|
2875
2873
|
*
|
|
@@ -2883,19 +2881,23 @@ export const summaryWithTimestamp = (name: string, options: {
|
|
|
2883
2881
|
* attributes: { service: "user-api" }
|
|
2884
2882
|
* })
|
|
2885
2883
|
*
|
|
2886
|
-
* //
|
|
2884
|
+
* // Record a measured API operation duration
|
|
2887
2885
|
* const apiOperation = Effect.gen(function*() {
|
|
2888
|
-
* const
|
|
2889
|
-
* yield* Effect.sleep(Duration.millis(100)) // Simulate work
|
|
2890
|
-
* const duration = Duration.millis(Date.now() - start)
|
|
2891
|
-
*
|
|
2892
|
-
* // Update the timer with the measured duration
|
|
2886
|
+
* const duration = Duration.millis(120)
|
|
2893
2887
|
* yield* Metric.update(apiRequestTimer, duration)
|
|
2888
|
+
*
|
|
2889
|
+
* const state = yield* Metric.value(apiRequestTimer)
|
|
2890
|
+
* console.log({
|
|
2891
|
+
* count: state.count,
|
|
2892
|
+
* min: state.min,
|
|
2893
|
+
* max: state.max,
|
|
2894
|
+
* sum: state.sum
|
|
2895
|
+
* }) // { count: 1, min: 120, max: 120, sum: 120 }
|
|
2894
2896
|
* })
|
|
2895
2897
|
* ```
|
|
2896
2898
|
*
|
|
2897
|
-
* @since 2.0.0
|
|
2898
2899
|
* @category Constructors
|
|
2900
|
+
* @since 2.0.0
|
|
2899
2901
|
*/
|
|
2900
2902
|
export const timer = (name: string, options?: {
|
|
2901
2903
|
readonly description?: string | undefined
|
|
@@ -2913,15 +2915,17 @@ export const timer = (name: string, options?: {
|
|
|
2913
2915
|
/**
|
|
2914
2916
|
* Retrieves the current state of the specified `Metric`.
|
|
2915
2917
|
*
|
|
2916
|
-
*
|
|
2917
|
-
*
|
|
2918
|
-
*
|
|
2919
|
-
* -
|
|
2920
|
-
* -
|
|
2921
|
-
* -
|
|
2922
|
-
* -
|
|
2918
|
+
* **Details**
|
|
2919
|
+
* The returned state depends on the metric type:
|
|
2920
|
+
*
|
|
2921
|
+
* - Counter: `CounterState<number | bigint>` with `count` and `incremental`
|
|
2922
|
+
* - Gauge: `GaugeState<number | bigint>` with `value`
|
|
2923
|
+
* - Frequency: `FrequencyState` with `occurrences`
|
|
2924
|
+
* - Histogram: `HistogramState` with buckets, count, min, max, and sum
|
|
2925
|
+
* - Summary: `SummaryState` with quantiles, count, min, max, and sum
|
|
2926
|
+
*
|
|
2927
|
+
* **Example** (Reading metric state)
|
|
2923
2928
|
*
|
|
2924
|
-
* @example
|
|
2925
2929
|
* ```ts
|
|
2926
2930
|
* import { Effect, Metric } from "effect"
|
|
2927
2931
|
*
|
|
@@ -2949,8 +2953,8 @@ export const timer = (name: string, options?: {
|
|
|
2949
2953
|
* })
|
|
2950
2954
|
* ```
|
|
2951
2955
|
*
|
|
2952
|
-
* @since 2.0.0
|
|
2953
2956
|
* @category Utilities
|
|
2957
|
+
* @since 2.0.0
|
|
2954
2958
|
*/
|
|
2955
2959
|
export const value = <Input, State>(
|
|
2956
2960
|
self: Metric<Input, State>
|
|
@@ -2970,7 +2974,8 @@ export const value = <Input, State>(
|
|
|
2970
2974
|
* - **Histogram**: Same as `update` - records the input value in the appropriate bucket
|
|
2971
2975
|
* - **Summary**: Same as `update` - records the input observation
|
|
2972
2976
|
*
|
|
2973
|
-
*
|
|
2977
|
+
* **Example** (Modifying metric values)
|
|
2978
|
+
*
|
|
2974
2979
|
* ```ts
|
|
2975
2980
|
* import { Effect, Metric } from "effect"
|
|
2976
2981
|
*
|
|
@@ -2997,8 +3002,8 @@ export const value = <Input, State>(
|
|
|
2997
3002
|
* })
|
|
2998
3003
|
* ```
|
|
2999
3004
|
*
|
|
3000
|
-
* @since 2.0.0
|
|
3001
3005
|
* @category Utilities
|
|
3006
|
+
* @since 2.0.0
|
|
3002
3007
|
*/
|
|
3003
3008
|
export const modify: {
|
|
3004
3009
|
/**
|
|
@@ -3011,7 +3016,8 @@ export const modify: {
|
|
|
3011
3016
|
* - **Histogram**: Same as `update` - records the input value in the appropriate bucket
|
|
3012
3017
|
* - **Summary**: Same as `update` - records the input observation
|
|
3013
3018
|
*
|
|
3014
|
-
*
|
|
3019
|
+
* **Example** (Modifying metric values)
|
|
3020
|
+
*
|
|
3015
3021
|
* ```ts
|
|
3016
3022
|
* import { Effect, Metric } from "effect"
|
|
3017
3023
|
*
|
|
@@ -3038,8 +3044,8 @@ export const modify: {
|
|
|
3038
3044
|
* })
|
|
3039
3045
|
* ```
|
|
3040
3046
|
*
|
|
3041
|
-
* @since 2.0.0
|
|
3042
3047
|
* @category Utilities
|
|
3048
|
+
* @since 2.0.0
|
|
3043
3049
|
*/
|
|
3044
3050
|
<Input>(input: Input): <State>(self: Metric<Input, State>) => Effect<void>
|
|
3045
3051
|
/**
|
|
@@ -3052,7 +3058,8 @@ export const modify: {
|
|
|
3052
3058
|
* - **Histogram**: Same as `update` - records the input value in the appropriate bucket
|
|
3053
3059
|
* - **Summary**: Same as `update` - records the input observation
|
|
3054
3060
|
*
|
|
3055
|
-
*
|
|
3061
|
+
* **Example** (Modifying metric values)
|
|
3062
|
+
*
|
|
3056
3063
|
* ```ts
|
|
3057
3064
|
* import { Effect, Metric } from "effect"
|
|
3058
3065
|
*
|
|
@@ -3079,8 +3086,8 @@ export const modify: {
|
|
|
3079
3086
|
* })
|
|
3080
3087
|
* ```
|
|
3081
3088
|
*
|
|
3082
|
-
* @since 2.0.0
|
|
3083
3089
|
* @category Utilities
|
|
3090
|
+
* @since 2.0.0
|
|
3084
3091
|
*/
|
|
3085
3092
|
<Input, State>(self: Metric<Input, State>, input: Input): Effect<void>
|
|
3086
3093
|
} = dual<
|
|
@@ -3094,7 +3101,8 @@ export const modify: {
|
|
|
3094
3101
|
* - **Histogram**: Same as `update` - records the input value in the appropriate bucket
|
|
3095
3102
|
* - **Summary**: Same as `update` - records the input observation
|
|
3096
3103
|
*
|
|
3097
|
-
*
|
|
3104
|
+
* **Example** (Modifying metric values)
|
|
3105
|
+
*
|
|
3098
3106
|
* ```ts
|
|
3099
3107
|
* import { Effect, Metric } from "effect"
|
|
3100
3108
|
*
|
|
@@ -3121,8 +3129,8 @@ export const modify: {
|
|
|
3121
3129
|
* })
|
|
3122
3130
|
* ```
|
|
3123
3131
|
*
|
|
3124
|
-
* @since 2.0.0
|
|
3125
3132
|
* @category Utilities
|
|
3133
|
+
* @since 2.0.0
|
|
3126
3134
|
*/
|
|
3127
3135
|
<Input>(input: Input) => <State>(self: Metric<Input, State>) => Effect<void>,
|
|
3128
3136
|
/**
|
|
@@ -3135,7 +3143,8 @@ export const modify: {
|
|
|
3135
3143
|
* - **Histogram**: Same as `update` - records the input value in the appropriate bucket
|
|
3136
3144
|
* - **Summary**: Same as `update` - records the input observation
|
|
3137
3145
|
*
|
|
3138
|
-
*
|
|
3146
|
+
* **Example** (Modifying metric values)
|
|
3147
|
+
*
|
|
3139
3148
|
* ```ts
|
|
3140
3149
|
* import { Effect, Metric } from "effect"
|
|
3141
3150
|
*
|
|
@@ -3162,8 +3171,8 @@ export const modify: {
|
|
|
3162
3171
|
* })
|
|
3163
3172
|
* ```
|
|
3164
3173
|
*
|
|
3165
|
-
* @since 2.0.0
|
|
3166
3174
|
* @category Utilities
|
|
3175
|
+
* @since 2.0.0
|
|
3167
3176
|
*/
|
|
3168
3177
|
<Input, State>(self: Metric<Input, State>, input: Input) => Effect<void>
|
|
3169
3178
|
>(2, (self, input) =>
|
|
@@ -3182,7 +3191,8 @@ export const modify: {
|
|
|
3182
3191
|
* - **Histogram**: Records the input value in the appropriate bucket
|
|
3183
3192
|
* - **Summary**: Records the input value as a new observation
|
|
3184
3193
|
*
|
|
3185
|
-
*
|
|
3194
|
+
* **Example** (Updating metric values)
|
|
3195
|
+
*
|
|
3186
3196
|
* ```ts
|
|
3187
3197
|
* import { Effect, Metric } from "effect"
|
|
3188
3198
|
*
|
|
@@ -3218,8 +3228,8 @@ export const modify: {
|
|
|
3218
3228
|
* })
|
|
3219
3229
|
* ```
|
|
3220
3230
|
*
|
|
3221
|
-
* @since 2.0.0
|
|
3222
3231
|
* @category Utilities
|
|
3232
|
+
* @since 2.0.0
|
|
3223
3233
|
*/
|
|
3224
3234
|
export const update: {
|
|
3225
3235
|
/**
|
|
@@ -3232,7 +3242,8 @@ export const update: {
|
|
|
3232
3242
|
* - **Histogram**: Records the input value in the appropriate bucket
|
|
3233
3243
|
* - **Summary**: Records the input value as a new observation
|
|
3234
3244
|
*
|
|
3235
|
-
*
|
|
3245
|
+
* **Example** (Updating metric values)
|
|
3246
|
+
*
|
|
3236
3247
|
* ```ts
|
|
3237
3248
|
* import { Effect, Metric } from "effect"
|
|
3238
3249
|
*
|
|
@@ -3268,8 +3279,8 @@ export const update: {
|
|
|
3268
3279
|
* })
|
|
3269
3280
|
* ```
|
|
3270
3281
|
*
|
|
3271
|
-
* @since 2.0.0
|
|
3272
3282
|
* @category Utilities
|
|
3283
|
+
* @since 2.0.0
|
|
3273
3284
|
*/
|
|
3274
3285
|
<Input>(input: Input): <State>(self: Metric<Input, State>) => Effect<void>
|
|
3275
3286
|
/**
|
|
@@ -3282,7 +3293,8 @@ export const update: {
|
|
|
3282
3293
|
* - **Histogram**: Records the input value in the appropriate bucket
|
|
3283
3294
|
* - **Summary**: Records the input value as a new observation
|
|
3284
3295
|
*
|
|
3285
|
-
*
|
|
3296
|
+
* **Example** (Updating metric values)
|
|
3297
|
+
*
|
|
3286
3298
|
* ```ts
|
|
3287
3299
|
* import { Effect, Metric } from "effect"
|
|
3288
3300
|
*
|
|
@@ -3318,8 +3330,8 @@ export const update: {
|
|
|
3318
3330
|
* })
|
|
3319
3331
|
* ```
|
|
3320
3332
|
*
|
|
3321
|
-
* @since 2.0.0
|
|
3322
3333
|
* @category Utilities
|
|
3334
|
+
* @since 2.0.0
|
|
3323
3335
|
*/
|
|
3324
3336
|
<Input, State>(self: Metric<Input, State>, input: Input): Effect<void>
|
|
3325
3337
|
} = dual<
|
|
@@ -3333,7 +3345,8 @@ export const update: {
|
|
|
3333
3345
|
* - **Histogram**: Records the input value in the appropriate bucket
|
|
3334
3346
|
* - **Summary**: Records the input value as a new observation
|
|
3335
3347
|
*
|
|
3336
|
-
*
|
|
3348
|
+
* **Example** (Updating metric values)
|
|
3349
|
+
*
|
|
3337
3350
|
* ```ts
|
|
3338
3351
|
* import { Effect, Metric } from "effect"
|
|
3339
3352
|
*
|
|
@@ -3369,8 +3382,8 @@ export const update: {
|
|
|
3369
3382
|
* })
|
|
3370
3383
|
* ```
|
|
3371
3384
|
*
|
|
3372
|
-
* @since 2.0.0
|
|
3373
3385
|
* @category Utilities
|
|
3386
|
+
* @since 2.0.0
|
|
3374
3387
|
*/
|
|
3375
3388
|
<Input>(input: Input) => <State>(self: Metric<Input, State>) => Effect<void>,
|
|
3376
3389
|
/**
|
|
@@ -3383,7 +3396,8 @@ export const update: {
|
|
|
3383
3396
|
* - **Histogram**: Records the input value in the appropriate bucket
|
|
3384
3397
|
* - **Summary**: Records the input value as a new observation
|
|
3385
3398
|
*
|
|
3386
|
-
*
|
|
3399
|
+
* **Example** (Updating metric values)
|
|
3400
|
+
*
|
|
3387
3401
|
* ```ts
|
|
3388
3402
|
* import { Effect, Metric } from "effect"
|
|
3389
3403
|
*
|
|
@@ -3419,8 +3433,8 @@ export const update: {
|
|
|
3419
3433
|
* })
|
|
3420
3434
|
* ```
|
|
3421
3435
|
*
|
|
3422
|
-
* @since 2.0.0
|
|
3423
3436
|
* @category Utilities
|
|
3437
|
+
* @since 2.0.0
|
|
3424
3438
|
*/
|
|
3425
3439
|
<Input, State>(self: Metric<Input, State>, input: Input) => Effect<void>
|
|
3426
3440
|
>(
|
|
@@ -3434,7 +3448,8 @@ export const update: {
|
|
|
3434
3448
|
* of the specified new type, which must be transformable to the input type of
|
|
3435
3449
|
* this metric.
|
|
3436
3450
|
*
|
|
3437
|
-
*
|
|
3451
|
+
* **Example** (Mapping metric inputs)
|
|
3452
|
+
*
|
|
3438
3453
|
* ```ts
|
|
3439
3454
|
* import { Data, Effect, Metric } from "effect"
|
|
3440
3455
|
*
|
|
@@ -3464,8 +3479,8 @@ export const update: {
|
|
|
3464
3479
|
* })
|
|
3465
3480
|
* ```
|
|
3466
3481
|
*
|
|
3467
|
-
* @since 2.0.0
|
|
3468
3482
|
* @category Mapping
|
|
3483
|
+
* @since 2.0.0
|
|
3469
3484
|
*/
|
|
3470
3485
|
export const mapInput: {
|
|
3471
3486
|
/**
|
|
@@ -3473,7 +3488,8 @@ export const mapInput: {
|
|
|
3473
3488
|
* of the specified new type, which must be transformable to the input type of
|
|
3474
3489
|
* this metric.
|
|
3475
3490
|
*
|
|
3476
|
-
*
|
|
3491
|
+
* **Example** (Mapping metric inputs)
|
|
3492
|
+
*
|
|
3477
3493
|
* ```ts
|
|
3478
3494
|
* import { Data, Effect, Metric } from "effect"
|
|
3479
3495
|
*
|
|
@@ -3503,8 +3519,8 @@ export const mapInput: {
|
|
|
3503
3519
|
* })
|
|
3504
3520
|
* ```
|
|
3505
3521
|
*
|
|
3506
|
-
* @since 2.0.0
|
|
3507
3522
|
* @category Mapping
|
|
3523
|
+
* @since 2.0.0
|
|
3508
3524
|
*/
|
|
3509
3525
|
<Input, Input2 extends Input>(f: (input: Input2, context: Context.Context<never>) => Input): <State>(self: Metric<Input, State>) => Metric<Input2, State>
|
|
3510
3526
|
/**
|
|
@@ -3512,7 +3528,8 @@ export const mapInput: {
|
|
|
3512
3528
|
* of the specified new type, which must be transformable to the input type of
|
|
3513
3529
|
* this metric.
|
|
3514
3530
|
*
|
|
3515
|
-
*
|
|
3531
|
+
* **Example** (Mapping metric inputs)
|
|
3532
|
+
*
|
|
3516
3533
|
* ```ts
|
|
3517
3534
|
* import { Data, Effect, Metric } from "effect"
|
|
3518
3535
|
*
|
|
@@ -3542,8 +3559,8 @@ export const mapInput: {
|
|
|
3542
3559
|
* })
|
|
3543
3560
|
* ```
|
|
3544
3561
|
*
|
|
3545
|
-
* @since 2.0.0
|
|
3546
3562
|
* @category Mapping
|
|
3563
|
+
* @since 2.0.0
|
|
3547
3564
|
*/
|
|
3548
3565
|
<Input, State, Input2>(
|
|
3549
3566
|
self: Metric<Input, State>,
|
|
@@ -3555,7 +3572,8 @@ export const mapInput: {
|
|
|
3555
3572
|
* of the specified new type, which must be transformable to the input type of
|
|
3556
3573
|
* this metric.
|
|
3557
3574
|
*
|
|
3558
|
-
*
|
|
3575
|
+
* **Example** (Mapping metric inputs)
|
|
3576
|
+
*
|
|
3559
3577
|
* ```ts
|
|
3560
3578
|
* import { Data, Effect, Metric } from "effect"
|
|
3561
3579
|
*
|
|
@@ -3585,8 +3603,8 @@ export const mapInput: {
|
|
|
3585
3603
|
* })
|
|
3586
3604
|
* ```
|
|
3587
3605
|
*
|
|
3588
|
-
* @since 2.0.0
|
|
3589
3606
|
* @category Mapping
|
|
3607
|
+
* @since 2.0.0
|
|
3590
3608
|
*/
|
|
3591
3609
|
<Input, Input2 extends Input>(f: (input: Input2, context: Context.Context<never>) => Input) => <State>(self: Metric<Input, State>) => Metric<Input2, State>,
|
|
3592
3610
|
/**
|
|
@@ -3594,7 +3612,8 @@ export const mapInput: {
|
|
|
3594
3612
|
* of the specified new type, which must be transformable to the input type of
|
|
3595
3613
|
* this metric.
|
|
3596
3614
|
*
|
|
3597
|
-
*
|
|
3615
|
+
* **Example** (Mapping metric inputs)
|
|
3616
|
+
*
|
|
3598
3617
|
* ```ts
|
|
3599
3618
|
* import { Data, Effect, Metric } from "effect"
|
|
3600
3619
|
*
|
|
@@ -3624,8 +3643,8 @@ export const mapInput: {
|
|
|
3624
3643
|
* })
|
|
3625
3644
|
* ```
|
|
3626
3645
|
*
|
|
3627
|
-
* @since 2.0.0
|
|
3628
3646
|
* @category Mapping
|
|
3647
|
+
* @since 2.0.0
|
|
3629
3648
|
*/
|
|
3630
3649
|
<Input, State, Input2>(
|
|
3631
3650
|
self: Metric<Input, State>,
|
|
@@ -3647,7 +3666,8 @@ export const mapInput: {
|
|
|
3647
3666
|
* of any type, and translates them to updates with the specified constant
|
|
3648
3667
|
* update value.
|
|
3649
3668
|
*
|
|
3650
|
-
*
|
|
3669
|
+
* **Example** (Ignoring inputs with a constant value)
|
|
3670
|
+
*
|
|
3651
3671
|
* ```ts
|
|
3652
3672
|
* import { Data, Effect, Metric } from "effect"
|
|
3653
3673
|
*
|
|
@@ -3674,8 +3694,8 @@ export const mapInput: {
|
|
|
3674
3694
|
* })
|
|
3675
3695
|
* ```
|
|
3676
3696
|
*
|
|
3677
|
-
* @since 2.0.0
|
|
3678
3697
|
* @category Input
|
|
3698
|
+
* @since 2.0.0
|
|
3679
3699
|
*/
|
|
3680
3700
|
export const withConstantInput: {
|
|
3681
3701
|
/**
|
|
@@ -3683,7 +3703,8 @@ export const withConstantInput: {
|
|
|
3683
3703
|
* of any type, and translates them to updates with the specified constant
|
|
3684
3704
|
* update value.
|
|
3685
3705
|
*
|
|
3686
|
-
*
|
|
3706
|
+
* **Example** (Ignoring inputs with a constant value)
|
|
3707
|
+
*
|
|
3687
3708
|
* ```ts
|
|
3688
3709
|
* import { Data, Effect, Metric } from "effect"
|
|
3689
3710
|
*
|
|
@@ -3710,8 +3731,8 @@ export const withConstantInput: {
|
|
|
3710
3731
|
* })
|
|
3711
3732
|
* ```
|
|
3712
3733
|
*
|
|
3713
|
-
* @since 2.0.0
|
|
3714
3734
|
* @category Input
|
|
3735
|
+
* @since 2.0.0
|
|
3715
3736
|
*/
|
|
3716
3737
|
<Input>(input: Input): <State>(self: Metric<Input, State>) => Metric<unknown, State>
|
|
3717
3738
|
/**
|
|
@@ -3719,7 +3740,8 @@ export const withConstantInput: {
|
|
|
3719
3740
|
* of any type, and translates them to updates with the specified constant
|
|
3720
3741
|
* update value.
|
|
3721
3742
|
*
|
|
3722
|
-
*
|
|
3743
|
+
* **Example** (Ignoring inputs with a constant value)
|
|
3744
|
+
*
|
|
3723
3745
|
* ```ts
|
|
3724
3746
|
* import { Data, Effect, Metric } from "effect"
|
|
3725
3747
|
*
|
|
@@ -3746,8 +3768,8 @@ export const withConstantInput: {
|
|
|
3746
3768
|
* })
|
|
3747
3769
|
* ```
|
|
3748
3770
|
*
|
|
3749
|
-
* @since 2.0.0
|
|
3750
3771
|
* @category Input
|
|
3772
|
+
* @since 2.0.0
|
|
3751
3773
|
*/
|
|
3752
3774
|
<Input, State>(self: Metric<Input, State>, input: Input): Metric<unknown, State>
|
|
3753
3775
|
} = dual<
|
|
@@ -3756,7 +3778,8 @@ export const withConstantInput: {
|
|
|
3756
3778
|
* of any type, and translates them to updates with the specified constant
|
|
3757
3779
|
* update value.
|
|
3758
3780
|
*
|
|
3759
|
-
*
|
|
3781
|
+
* **Example** (Ignoring inputs with a constant value)
|
|
3782
|
+
*
|
|
3760
3783
|
* ```ts
|
|
3761
3784
|
* import { Data, Effect, Metric } from "effect"
|
|
3762
3785
|
*
|
|
@@ -3783,8 +3806,8 @@ export const withConstantInput: {
|
|
|
3783
3806
|
* })
|
|
3784
3807
|
* ```
|
|
3785
3808
|
*
|
|
3786
|
-
* @since 2.0.0
|
|
3787
3809
|
* @category Input
|
|
3810
|
+
* @since 2.0.0
|
|
3788
3811
|
*/
|
|
3789
3812
|
<Input>(input: Input) => <State>(self: Metric<Input, State>) => Metric<unknown, State>,
|
|
3790
3813
|
/**
|
|
@@ -3792,7 +3815,8 @@ export const withConstantInput: {
|
|
|
3792
3815
|
* of any type, and translates them to updates with the specified constant
|
|
3793
3816
|
* update value.
|
|
3794
3817
|
*
|
|
3795
|
-
*
|
|
3818
|
+
* **Example** (Ignoring inputs with a constant value)
|
|
3819
|
+
*
|
|
3796
3820
|
* ```ts
|
|
3797
3821
|
* import { Data, Effect, Metric } from "effect"
|
|
3798
3822
|
*
|
|
@@ -3819,8 +3843,8 @@ export const withConstantInput: {
|
|
|
3819
3843
|
* })
|
|
3820
3844
|
* ```
|
|
3821
3845
|
*
|
|
3822
|
-
* @since 2.0.0
|
|
3823
3846
|
* @category Input
|
|
3847
|
+
* @since 2.0.0
|
|
3824
3848
|
*/
|
|
3825
3849
|
<Input, State>(self: Metric<Input, State>, input: Input) => Metric<unknown, State>
|
|
3826
3850
|
>(2, (self, input) => mapInput(self, () => input))
|
|
@@ -3832,7 +3856,8 @@ export const withConstantInput: {
|
|
|
3832
3856
|
* enabling filtering, grouping, and more detailed analysis. Each combination
|
|
3833
3857
|
* of attribute values creates a separate metric series.
|
|
3834
3858
|
*
|
|
3835
|
-
*
|
|
3859
|
+
* **Example** (Applying metric attributes)
|
|
3860
|
+
*
|
|
3836
3861
|
* ```ts
|
|
3837
3862
|
* import { Effect, Metric } from "effect"
|
|
3838
3863
|
*
|
|
@@ -3877,8 +3902,8 @@ export const withConstantInput: {
|
|
|
3877
3902
|
* })
|
|
3878
3903
|
* ```
|
|
3879
3904
|
*
|
|
3880
|
-
* @since 4.0.0
|
|
3881
3905
|
* @category Attributes
|
|
3906
|
+
* @since 4.0.0
|
|
3882
3907
|
*/
|
|
3883
3908
|
export const withAttributes: {
|
|
3884
3909
|
/**
|
|
@@ -3888,7 +3913,8 @@ export const withAttributes: {
|
|
|
3888
3913
|
* enabling filtering, grouping, and more detailed analysis. Each combination
|
|
3889
3914
|
* of attribute values creates a separate metric series.
|
|
3890
3915
|
*
|
|
3891
|
-
*
|
|
3916
|
+
* **Example** (Applying metric attributes)
|
|
3917
|
+
*
|
|
3892
3918
|
* ```ts
|
|
3893
3919
|
* import { Effect, Metric } from "effect"
|
|
3894
3920
|
*
|
|
@@ -3933,8 +3959,8 @@ export const withAttributes: {
|
|
|
3933
3959
|
* })
|
|
3934
3960
|
* ```
|
|
3935
3961
|
*
|
|
3936
|
-
* @since 4.0.0
|
|
3937
3962
|
* @category Attributes
|
|
3963
|
+
* @since 4.0.0
|
|
3938
3964
|
*/
|
|
3939
3965
|
(attributes: Metric.Attributes): <Input, State>(self: Metric<Input, State>) => Metric<Input, State>
|
|
3940
3966
|
/**
|
|
@@ -3944,7 +3970,8 @@ export const withAttributes: {
|
|
|
3944
3970
|
* enabling filtering, grouping, and more detailed analysis. Each combination
|
|
3945
3971
|
* of attribute values creates a separate metric series.
|
|
3946
3972
|
*
|
|
3947
|
-
*
|
|
3973
|
+
* **Example** (Applying metric attributes)
|
|
3974
|
+
*
|
|
3948
3975
|
* ```ts
|
|
3949
3976
|
* import { Effect, Metric } from "effect"
|
|
3950
3977
|
*
|
|
@@ -3989,8 +4016,8 @@ export const withAttributes: {
|
|
|
3989
4016
|
* })
|
|
3990
4017
|
* ```
|
|
3991
4018
|
*
|
|
3992
|
-
* @since 4.0.0
|
|
3993
4019
|
* @category Attributes
|
|
4020
|
+
* @since 4.0.0
|
|
3994
4021
|
*/
|
|
3995
4022
|
<Input, State>(self: Metric<Input, State>, attributes: Metric.Attributes): Metric<Input, State>
|
|
3996
4023
|
} = dual<
|
|
@@ -4001,7 +4028,8 @@ export const withAttributes: {
|
|
|
4001
4028
|
* enabling filtering, grouping, and more detailed analysis. Each combination
|
|
4002
4029
|
* of attribute values creates a separate metric series.
|
|
4003
4030
|
*
|
|
4004
|
-
*
|
|
4031
|
+
* **Example** (Applying metric attributes)
|
|
4032
|
+
*
|
|
4005
4033
|
* ```ts
|
|
4006
4034
|
* import { Effect, Metric } from "effect"
|
|
4007
4035
|
*
|
|
@@ -4046,8 +4074,8 @@ export const withAttributes: {
|
|
|
4046
4074
|
* })
|
|
4047
4075
|
* ```
|
|
4048
4076
|
*
|
|
4049
|
-
* @since 4.0.0
|
|
4050
4077
|
* @category Attributes
|
|
4078
|
+
* @since 4.0.0
|
|
4051
4079
|
*/
|
|
4052
4080
|
(attributes: Metric.Attributes) => <Input, State>(self: Metric<Input, State>) => Metric<Input, State>,
|
|
4053
4081
|
/**
|
|
@@ -4057,7 +4085,8 @@ export const withAttributes: {
|
|
|
4057
4085
|
* enabling filtering, grouping, and more detailed analysis. Each combination
|
|
4058
4086
|
* of attribute values creates a separate metric series.
|
|
4059
4087
|
*
|
|
4060
|
-
*
|
|
4088
|
+
* **Example** (Applying metric attributes)
|
|
4089
|
+
*
|
|
4061
4090
|
* ```ts
|
|
4062
4091
|
* import { Effect, Metric } from "effect"
|
|
4063
4092
|
*
|
|
@@ -4102,8 +4131,8 @@ export const withAttributes: {
|
|
|
4102
4131
|
* })
|
|
4103
4132
|
* ```
|
|
4104
4133
|
*
|
|
4105
|
-
* @since 4.0.0
|
|
4106
4134
|
* @category Attributes
|
|
4135
|
+
* @since 4.0.0
|
|
4107
4136
|
*/
|
|
4108
4137
|
<Input, State>(self: Metric<Input, State>, attributes: Metric.Attributes) => Metric<Input, State>
|
|
4109
4138
|
>(2, <Input, State>(
|
|
@@ -4125,7 +4154,8 @@ export const withAttributes: {
|
|
|
4125
4154
|
* Returns an array of metric snapshots, each containing the metric's metadata
|
|
4126
4155
|
* (name, description, type) and current state (values, counts, etc.).
|
|
4127
4156
|
*
|
|
4128
|
-
*
|
|
4157
|
+
* **Example** (Capturing metric snapshots)
|
|
4158
|
+
*
|
|
4129
4159
|
* ```ts
|
|
4130
4160
|
* import { Console, Data, Effect, Metric } from "effect"
|
|
4131
4161
|
*
|
|
@@ -4164,8 +4194,8 @@ export const withAttributes: {
|
|
|
4164
4194
|
* })
|
|
4165
4195
|
* ```
|
|
4166
4196
|
*
|
|
4167
|
-
* @since 2.0.0
|
|
4168
4197
|
* @category Snapshotting
|
|
4198
|
+
* @since 2.0.0
|
|
4169
4199
|
*/
|
|
4170
4200
|
export const snapshot: Effect<ReadonlyArray<Metric.Snapshot>> = InternalEffect.map(
|
|
4171
4201
|
InternalEffect.context(),
|
|
@@ -4180,7 +4210,8 @@ export const snapshot: Effect<ReadonlyArray<Metric.Snapshot>> = InternalEffect.m
|
|
|
4180
4210
|
* in an easy-to-read table showing names, descriptions, types, attributes,
|
|
4181
4211
|
* and current state values.
|
|
4182
4212
|
*
|
|
4183
|
-
*
|
|
4213
|
+
* **Example** (Dumping metrics as text)
|
|
4214
|
+
*
|
|
4184
4215
|
* ```ts
|
|
4185
4216
|
* import { Console, Data, Effect, Metric } from "effect"
|
|
4186
4217
|
*
|
|
@@ -4223,8 +4254,8 @@ export const snapshot: Effect<ReadonlyArray<Metric.Snapshot>> = InternalEffect.m
|
|
|
4223
4254
|
* })
|
|
4224
4255
|
* ```
|
|
4225
4256
|
*
|
|
4226
|
-
* @since 2.0.0
|
|
4227
4257
|
* @category Debugging
|
|
4258
|
+
* @since 2.0.0
|
|
4228
4259
|
*/
|
|
4229
4260
|
export const dump: Effect<string> = InternalEffect.flatMap(InternalEffect.context(), (context) => {
|
|
4230
4261
|
const metrics = snapshotUnsafe(context)
|
|
@@ -4269,7 +4300,8 @@ export const dump: Effect<string> = InternalEffect.flatMap(InternalEffect.contex
|
|
|
4269
4300
|
* manual handling of the services context. Use the safe `snapshot` function for normal
|
|
4270
4301
|
* application code.
|
|
4271
4302
|
*
|
|
4272
|
-
*
|
|
4303
|
+
* **Example** (Capturing snapshots from a context)
|
|
4304
|
+
*
|
|
4273
4305
|
* ```ts
|
|
4274
4306
|
* import { Data, Effect, Metric } from "effect"
|
|
4275
4307
|
*
|
|
@@ -4296,13 +4328,14 @@ export const dump: Effect<string> = InternalEffect.flatMap(InternalEffect.contex
|
|
|
4296
4328
|
*
|
|
4297
4329
|
* // Use snapshotUnsafe for direct, synchronous access
|
|
4298
4330
|
* const snapshots = Metric.snapshotUnsafe(services)
|
|
4331
|
+
* const exportBatchCreatedAt = 1_700_000_000_000
|
|
4299
4332
|
*
|
|
4300
4333
|
* // Process snapshots immediately (useful for exporters, debugging tools)
|
|
4301
4334
|
* const exportData = snapshots.map((snapshot) => ({
|
|
4302
4335
|
* name: snapshot.id,
|
|
4303
4336
|
* type: snapshot.type,
|
|
4304
4337
|
* value: snapshot.state,
|
|
4305
|
-
* timestamp:
|
|
4338
|
+
* timestamp: exportBatchCreatedAt
|
|
4306
4339
|
* }))
|
|
4307
4340
|
*
|
|
4308
4341
|
* // This is synchronous and doesn't involve Effect overhead
|
|
@@ -4318,8 +4351,8 @@ export const dump: Effect<string> = InternalEffect.flatMap(InternalEffect.contex
|
|
|
4318
4351
|
* })
|
|
4319
4352
|
* ```
|
|
4320
4353
|
*
|
|
4321
|
-
* @since 2.0.0
|
|
4322
4354
|
* @category Snapshotting
|
|
4355
|
+
* @since 2.0.0
|
|
4323
4356
|
*/
|
|
4324
4357
|
export const snapshotUnsafe = (context: Context.Context<never>): ReadonlyArray<Metric.Snapshot> => {
|
|
4325
4358
|
const registry = Context.get(context, MetricRegistry)
|
|
@@ -4398,7 +4431,8 @@ const attributesToString = (attributes: Metric.AttributeSet): string => {
|
|
|
4398
4431
|
* non-positive values, and automatically appending positive infinity as the
|
|
4399
4432
|
* final boundary.
|
|
4400
4433
|
*
|
|
4401
|
-
*
|
|
4434
|
+
* **Example** (Creating boundaries from values)
|
|
4435
|
+
*
|
|
4402
4436
|
* ```ts
|
|
4403
4437
|
* import { Data, Effect, Metric } from "effect"
|
|
4404
4438
|
*
|
|
@@ -4452,20 +4486,24 @@ const attributesToString = (attributes: Metric.AttributeSet): string => {
|
|
|
4452
4486
|
* })
|
|
4453
4487
|
* ```
|
|
4454
4488
|
*
|
|
4455
|
-
* @since 2.0.0
|
|
4456
4489
|
* @category Boundaries
|
|
4490
|
+
* @since 2.0.0
|
|
4457
4491
|
*/
|
|
4458
4492
|
export const boundariesFromIterable = (iterable: Iterable<number>): ReadonlyArray<number> =>
|
|
4459
4493
|
Arr.append(Arr.filter(new Set(iterable), (n) => n > 0), Number.POSITIVE_INFINITY)
|
|
4460
4494
|
|
|
4461
4495
|
/**
|
|
4462
|
-
*
|
|
4463
|
-
*
|
|
4496
|
+
* Creates histogram bucket boundaries from a linear sequence and appends
|
|
4497
|
+
* positive infinity.
|
|
4498
|
+
*
|
|
4499
|
+
* **Details**
|
|
4500
|
+
* Generates `count - 1` finite boundaries using `start + width + index` for
|
|
4501
|
+
* each zero-based index, then applies the same normalization as
|
|
4502
|
+
* `boundariesFromIterable`: non-positive values are removed, duplicates are
|
|
4503
|
+
* collapsed, and `Infinity` is appended.
|
|
4464
4504
|
*
|
|
4465
|
-
*
|
|
4466
|
-
* by a fixed width. Automatically adds positive infinity as the final boundary.
|
|
4505
|
+
* **Example** (Creating linear boundaries)
|
|
4467
4506
|
*
|
|
4468
|
-
* @example
|
|
4469
4507
|
* ```ts
|
|
4470
4508
|
* import { Data, Effect, Metric } from "effect"
|
|
4471
4509
|
*
|
|
@@ -4474,13 +4512,12 @@ export const boundariesFromIterable = (iterable: Iterable<number>): ReadonlyArra
|
|
|
4474
4512
|
* }> {}
|
|
4475
4513
|
*
|
|
4476
4514
|
* // Create boundaries for response time histogram
|
|
4477
|
-
* // Buckets: 0-100ms, 100-200ms, 200-300ms, 300-400ms, 400ms+
|
|
4478
4515
|
* const responseBoundaries = Metric.linearBoundaries({
|
|
4479
4516
|
* start: 0, // Starting point
|
|
4480
|
-
* width: 100, //
|
|
4517
|
+
* width: 100, // Offset used for the first boundary
|
|
4481
4518
|
* count: 5 // Creates 4 boundaries + infinity
|
|
4482
4519
|
* })
|
|
4483
|
-
* console.log(responseBoundaries) // [100,
|
|
4520
|
+
* console.log(responseBoundaries) // [100, 101, 102, 103, Infinity]
|
|
4484
4521
|
*
|
|
4485
4522
|
* // Create a histogram using these boundaries
|
|
4486
4523
|
* const responseTimeHistogram = Metric.histogram("api_response_time", {
|
|
@@ -4490,17 +4527,17 @@ export const boundariesFromIterable = (iterable: Iterable<number>): ReadonlyArra
|
|
|
4490
4527
|
*
|
|
4491
4528
|
* const program = Effect.gen(function*() {
|
|
4492
4529
|
* // Record some response times
|
|
4493
|
-
* yield* Metric.update(responseTimeHistogram, 85)
|
|
4494
|
-
* yield* Metric.update(responseTimeHistogram,
|
|
4495
|
-
* yield* Metric.update(responseTimeHistogram, 450)
|
|
4530
|
+
* yield* Metric.update(responseTimeHistogram, 85)
|
|
4531
|
+
* yield* Metric.update(responseTimeHistogram, 101)
|
|
4532
|
+
* yield* Metric.update(responseTimeHistogram, 450)
|
|
4496
4533
|
*
|
|
4497
4534
|
* const value = yield* Metric.value(responseTimeHistogram)
|
|
4498
4535
|
* return value
|
|
4499
4536
|
* })
|
|
4500
4537
|
* ```
|
|
4501
4538
|
*
|
|
4502
|
-
* @since 2.0.0
|
|
4503
4539
|
* @category Boundaries
|
|
4540
|
+
* @since 2.0.0
|
|
4504
4541
|
*/
|
|
4505
4542
|
export const linearBoundaries = (options: {
|
|
4506
4543
|
readonly start: number
|
|
@@ -4516,7 +4553,8 @@ export const linearBoundaries = (options: {
|
|
|
4516
4553
|
* Creates boundaries that grow exponentially, useful for metrics that span
|
|
4517
4554
|
* multiple orders of magnitude. Each boundary is calculated as start * factor^i.
|
|
4518
4555
|
*
|
|
4519
|
-
*
|
|
4556
|
+
* **Example** (Creating exponential boundaries)
|
|
4557
|
+
*
|
|
4520
4558
|
* ```ts
|
|
4521
4559
|
* import { Data, Effect, Metric } from "effect"
|
|
4522
4560
|
*
|
|
@@ -4557,8 +4595,8 @@ export const linearBoundaries = (options: {
|
|
|
4557
4595
|
* })
|
|
4558
4596
|
* ```
|
|
4559
4597
|
*
|
|
4560
|
-
* @since 2.0.0
|
|
4561
4598
|
* @category Boundaries
|
|
4599
|
+
* @since 2.0.0
|
|
4562
4600
|
*/
|
|
4563
4601
|
export const exponentialBoundaries = (options: {
|
|
4564
4602
|
readonly start: number
|
|
@@ -4588,7 +4626,8 @@ const fiberFailures = counter("child_fiber_failures", {
|
|
|
4588
4626
|
/**
|
|
4589
4627
|
* Service key for the fiber runtime metrics service.
|
|
4590
4628
|
*
|
|
4591
|
-
*
|
|
4629
|
+
* **Example** (Using the fiber runtime metrics key)
|
|
4630
|
+
*
|
|
4592
4631
|
* ```ts
|
|
4593
4632
|
* import { Data, Effect, Layer, Metric } from "effect"
|
|
4594
4633
|
*
|
|
@@ -4618,8 +4657,8 @@ const fiberFailures = counter("child_fiber_failures", {
|
|
|
4618
4657
|
* })
|
|
4619
4658
|
* ```
|
|
4620
4659
|
*
|
|
4621
|
-
* @since 4.0.0
|
|
4622
4660
|
* @category Runtime Metrics
|
|
4661
|
+
* @since 4.0.0
|
|
4623
4662
|
*/
|
|
4624
4663
|
export const FiberRuntimeMetricsKey: "effect/observability/Metric/FiberRuntimeMetricsKey" =
|
|
4625
4664
|
InternalMetric.FiberRuntimeMetricsKey
|
|
@@ -4627,7 +4666,8 @@ export const FiberRuntimeMetricsKey: "effect/observability/Metric/FiberRuntimeMe
|
|
|
4627
4666
|
/**
|
|
4628
4667
|
* Interface for the fiber runtime metrics service that tracks fiber lifecycle events.
|
|
4629
4668
|
*
|
|
4630
|
-
*
|
|
4669
|
+
* **Example** (Providing a custom fiber metrics service)
|
|
4670
|
+
*
|
|
4631
4671
|
* ```ts
|
|
4632
4672
|
* import type { Context } from "effect"
|
|
4633
4673
|
* import { Data, Effect, Layer, Metric } from "effect"
|
|
@@ -4660,8 +4700,8 @@ export const FiberRuntimeMetricsKey: "effect/observability/Metric/FiberRuntimeMe
|
|
|
4660
4700
|
* })
|
|
4661
4701
|
* ```
|
|
4662
4702
|
*
|
|
4663
|
-
* @since 4.0.0
|
|
4664
4703
|
* @category Runtime Metrics
|
|
4704
|
+
* @since 4.0.0
|
|
4665
4705
|
*/
|
|
4666
4706
|
export interface FiberRuntimeMetricsService {
|
|
4667
4707
|
readonly recordFiberStart: (context: Context.Context<never>) => void
|
|
@@ -4669,9 +4709,15 @@ export interface FiberRuntimeMetricsService {
|
|
|
4669
4709
|
}
|
|
4670
4710
|
|
|
4671
4711
|
/**
|
|
4672
|
-
*
|
|
4712
|
+
* `Context.Reference` for the optional fiber runtime metrics service.
|
|
4713
|
+
*
|
|
4714
|
+
* **Details**
|
|
4715
|
+
* When provided, the runtime can notify the service about child-fiber start and
|
|
4716
|
+
* end events. When the reference is `undefined`, automatic fiber runtime metric
|
|
4717
|
+
* collection is disabled.
|
|
4718
|
+
*
|
|
4719
|
+
* **Example** (Accessing the fiber runtime metrics service)
|
|
4673
4720
|
*
|
|
4674
|
-
* @example
|
|
4675
4721
|
* ```ts
|
|
4676
4722
|
* import { Data, Effect, Metric } from "effect"
|
|
4677
4723
|
*
|
|
@@ -4710,8 +4756,8 @@ export interface FiberRuntimeMetricsService {
|
|
|
4710
4756
|
* })
|
|
4711
4757
|
* ```
|
|
4712
4758
|
*
|
|
4713
|
-
* @since 4.0.0
|
|
4714
4759
|
* @category Runtime Metrics
|
|
4760
|
+
* @since 4.0.0
|
|
4715
4761
|
*/
|
|
4716
4762
|
export const FiberRuntimeMetrics = Context.Reference<FiberRuntimeMetricsService | undefined>(
|
|
4717
4763
|
InternalMetric.FiberRuntimeMetricsKey,
|
|
@@ -4721,7 +4767,8 @@ export const FiberRuntimeMetrics = Context.Reference<FiberRuntimeMetricsService
|
|
|
4721
4767
|
/**
|
|
4722
4768
|
* Default implementation of the fiber runtime metrics service.
|
|
4723
4769
|
*
|
|
4724
|
-
*
|
|
4770
|
+
* **Example** (Using the default fiber metrics implementation)
|
|
4771
|
+
*
|
|
4725
4772
|
* ```ts
|
|
4726
4773
|
* import { Data, Effect, Layer, Metric } from "effect"
|
|
4727
4774
|
*
|
|
@@ -4759,8 +4806,8 @@ export const FiberRuntimeMetrics = Context.Reference<FiberRuntimeMetricsService
|
|
|
4759
4806
|
* })
|
|
4760
4807
|
* ```
|
|
4761
4808
|
*
|
|
4762
|
-
* @since 4.0.0
|
|
4763
4809
|
* @category Runtime Metrics
|
|
4810
|
+
* @since 4.0.0
|
|
4764
4811
|
*/
|
|
4765
4812
|
export const FiberRuntimeMetricsImpl: FiberRuntimeMetricsService = {
|
|
4766
4813
|
recordFiberStart(context: Context.Context<never>) {
|
|
@@ -4786,7 +4833,8 @@ export const FiberRuntimeMetricsImpl: FiberRuntimeMetricsService = {
|
|
|
4786
4833
|
* the recommended approach for production applications that need comprehensive
|
|
4787
4834
|
* fiber monitoring.
|
|
4788
4835
|
*
|
|
4789
|
-
*
|
|
4836
|
+
* **Example** (Enabling runtime metrics with a layer)
|
|
4837
|
+
*
|
|
4790
4838
|
* ```ts
|
|
4791
4839
|
* import { Console, Data, Effect, Layer, Metric } from "effect"
|
|
4792
4840
|
*
|
|
@@ -4871,15 +4919,16 @@ export const FiberRuntimeMetricsImpl: FiberRuntimeMetricsService = {
|
|
|
4871
4919
|
* )
|
|
4872
4920
|
* ```
|
|
4873
4921
|
*
|
|
4874
|
-
* @since 4.0.0
|
|
4875
4922
|
* @category Runtime Metrics
|
|
4923
|
+
* @since 4.0.0
|
|
4876
4924
|
*/
|
|
4877
4925
|
export const enableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(FiberRuntimeMetricsImpl)
|
|
4878
4926
|
|
|
4879
4927
|
/**
|
|
4880
4928
|
* A Layer that disables automatic collection of fiber runtime metrics.
|
|
4881
4929
|
*
|
|
4882
|
-
*
|
|
4930
|
+
* **Example** (Disabling runtime metrics with a layer)
|
|
4931
|
+
*
|
|
4883
4932
|
* ```ts
|
|
4884
4933
|
* import { Data, Effect, Metric } from "effect"
|
|
4885
4934
|
*
|
|
@@ -4911,8 +4960,8 @@ export const enableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(Fibe
|
|
|
4911
4960
|
* })
|
|
4912
4961
|
* ```
|
|
4913
4962
|
*
|
|
4914
|
-
* @since 4.0.0
|
|
4915
4963
|
* @category Runtime Metrics
|
|
4964
|
+
* @since 4.0.0
|
|
4916
4965
|
*/
|
|
4917
4966
|
export const disableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(undefined)
|
|
4918
4967
|
|
|
@@ -4923,7 +4972,8 @@ export const disableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(und
|
|
|
4923
4972
|
* started fibers, successful completions, and failures. These metrics provide valuable
|
|
4924
4973
|
* insights into the concurrency patterns and health of your Effect application.
|
|
4925
4974
|
*
|
|
4926
|
-
*
|
|
4975
|
+
* **Example** (Enabling runtime metrics for an effect)
|
|
4976
|
+
*
|
|
4927
4977
|
* ```ts
|
|
4928
4978
|
* import { Console, Data, Effect, Layer, Metric } from "effect"
|
|
4929
4979
|
*
|
|
@@ -4992,8 +5042,8 @@ export const disableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(und
|
|
|
4992
5042
|
* )
|
|
4993
5043
|
* ```
|
|
4994
5044
|
*
|
|
4995
|
-
* @since 4.0.0
|
|
4996
5045
|
* @category Runtime Metrics
|
|
5046
|
+
* @since 4.0.0
|
|
4997
5047
|
*/
|
|
4998
5048
|
export const enableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R> = InternalEffect.provideService(
|
|
4999
5049
|
FiberRuntimeMetrics,
|
|
@@ -5007,7 +5057,8 @@ export const enableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A,
|
|
|
5007
5057
|
* parts of your application while keeping them enabled elsewhere, or when you need
|
|
5008
5058
|
* to avoid the overhead of metrics collection in performance-critical sections.
|
|
5009
5059
|
*
|
|
5010
|
-
*
|
|
5060
|
+
* **Example** (Disabling runtime metrics for an effect)
|
|
5061
|
+
*
|
|
5011
5062
|
* ```ts
|
|
5012
5063
|
* import { Console, Data, Effect, Layer, Metric } from "effect"
|
|
5013
5064
|
*
|
|
@@ -5035,7 +5086,7 @@ export const enableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A,
|
|
|
5035
5086
|
* (_, i) =>
|
|
5036
5087
|
* Effect.gen(function*() {
|
|
5037
5088
|
* // Simulate intensive computation
|
|
5038
|
-
* const result = i * i +
|
|
5089
|
+
* const result = i * i + (i % 10) / 10
|
|
5039
5090
|
* return result
|
|
5040
5091
|
* })
|
|
5041
5092
|
* )
|
|
@@ -5077,8 +5128,8 @@ export const enableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A,
|
|
|
5077
5128
|
* )
|
|
5078
5129
|
* ```
|
|
5079
5130
|
*
|
|
5080
|
-
* @since 4.0.0
|
|
5081
5131
|
* @category Runtime Metrics
|
|
5132
|
+
* @since 4.0.0
|
|
5082
5133
|
*/
|
|
5083
5134
|
export const disableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R> = InternalEffect.provideService(
|
|
5084
5135
|
FiberRuntimeMetrics,
|