Skip to content

Commit d626304

Browse files
committed
FsCodec a14
1 parent ef85bc6 commit d626304

File tree

28 files changed

+61
-70
lines changed

28 files changed

+61
-70
lines changed

src/Propulsion.CosmosStore/CosmosStoreSink.fs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ module private Impl =
1515
type EventBody = byte[] // V4 defines one directly, here we shim it
1616
module StreamSpan =
1717

18-
let toNativeEventBody (xs: Propulsion.Sinks.EventBody): byte[] = xs.ToArray()
18+
let toNativeEventBody (x: Propulsion.Sinks.EventBody): EventBody = FsCodec.Encoding.ToBlob(x).ToArray()
19+
1920
// Trimmed edition of what V4 exposes
2021
module internal Equinox =
2122
module CosmosStore =
@@ -31,11 +32,7 @@ module private Impl =
3132
#else
3233
module StreamSpan =
3334

34-
// v4 and later use JsonElement, but Propulsion is using ReadOnlyMemory<byte> rather than assuming and/or offering optimization for JSON bodies
35-
open System.Text.Json
36-
let toNativeEventBody (x: EventBody): JsonElement =
37-
if x.IsEmpty then JsonElement()
38-
else JsonSerializer.Deserialize<JsonElement>(x.Span)
35+
let toNativeEventBody (x: EventBody): Equinox.CosmosStore.Core.EncodedBody = FsCodec.SystemTextJson.Encoding.OfEncodedUtf8 x
3936
#endif
4037

4138
module Internal =
@@ -65,7 +62,7 @@ module Internal =
6562
let write (log: ILogger) (ctx: EventsContext) stream (span: Event[]) ct = task {
6663
let i = StreamSpan.index span
6764
let n = StreamSpan.next span
68-
let mapData = FsCodec.Core.EventData.Map StreamSpan.toNativeEventBody
65+
let mapData = FsCodec.Core.EventData.mapBodies StreamSpan.toNativeEventBody
6966
#if COSMOSV3
7067
span |> Seq.iter (fun x -> if x.IsUnfold then invalidOp "CosmosStore3 does not [yet] support ingesting unfolds")
7168
log.Debug("Writing {s}@{i}x{n}", stream, i, span.Length)

src/Propulsion.CosmosStore/EquinoxSystemTextJsonParser.fs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module EquinoxSystemTextJsonParser =
1212

1313
type System.Text.Json.JsonElement with
1414
member x.Cast<'T>() = System.Text.Json.JsonSerializer.Deserialize<'T>(x)
15-
member x.ToSinkEventBody() = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes x |> System.ReadOnlyMemory
1615

1716
type System.Text.Json.JsonDocument with member x.Cast<'T>() = x.RootElement.Cast<'T>()
1817
let timestamp (doc: System.Text.Json.JsonDocument) =
@@ -38,12 +37,13 @@ module EquinoxSystemTextJsonParser =
3837
/// Enumerates the Events and/or Unfolds represented within an Equinox.CosmosStore Batch or Tip Item
3938
let enumEquinoxCosmosBatchOrTip (u: System.Text.Json.JsonElement voption) (batch: Batch): Event seq =
4039
let inline gen isUnfold i (x: Equinox.CosmosStore.Core.Event) =
41-
let d = x.d.ToSinkEventBody()
42-
let m = x.m.ToSinkEventBody()
40+
let d = EncodedBody.ofUnfoldBody (x.D, x.d) |> FsCodec.SystemTextJson.Encoding.ToEncodedUtf8
41+
let m = EncodedBody.ofUnfoldBody (x.M, x.m) |> FsCodec.SystemTextJson.Encoding.ToEncodedUtf8
4342
let inline len s = if isNull s then 0 else String.length s
43+
let size = x.c.Length + FsCodec.Encoding.ByteCount d + FsCodec.Encoding.ByteCount m
44+
+ len x.correlationId + len x.causationId + 80
4445
FsCodec.Core.TimelineEvent.Create(i, x.c, d, m, timestamp = x.t,
45-
size = x.c.Length + d.Length + m.Length + len x.correlationId + len x.causationId + 80,
46-
correlationId = x.correlationId, causationId = x.causationId, isUnfold = isUnfold)
46+
size = size, correlationId = x.correlationId, causationId = x.causationId, isUnfold = isUnfold)
4747
let events = batch.e |> Seq.mapi (fun offset -> gen false (batch.i + int64 offset))
4848
// an Unfold won't have a corr/cause id, but that's OK - can't use Tip type as don't want to expand compressed form etc
4949
match u |> ValueOption.map (fun u -> u.Cast<Equinox.CosmosStore.Core.Event[]>()) with
@@ -87,8 +87,6 @@ module EquinoxNewtonsoftParser =
8787
type Newtonsoft.Json.Linq.JObject with
8888
member document.Cast<'T>() =
8989
document.ToObject<'T>()
90-
type Batch with
91-
member _.MapData x = x
9290

9391
let timestamp (doc: Newtonsoft.Json.Linq.JObject) =
9492
let unixEpoch = System.DateTime.UnixEpoch
@@ -101,7 +99,7 @@ module EquinoxNewtonsoftParser =
10199
/// Enumerates the events represented within a batch
102100
let enumEquinoxCosmosEvents (batch: Batch): StreamEvent seq =
103101
let streamName = FsCodec.StreamName.parse batch.p // we expect all Equinox data to adhere to "{category}-{streamId}" form (or we'll throw)
104-
batch.e |> Seq.mapi (fun offset x -> streamName, FsCodec.Core.TimelineEvent.Create(batch.i + int64 offset, x.c, batch.MapData x.d, batch.MapData x.m, timestamp=x.t))
102+
batch.e |> Seq.mapi (fun offset x -> streamName, FsCodec.Core.TimelineEvent.Create(batch.i + int64 offset, x.c, FsCodec.Encoding.OfBlob x.d, FsCodec.Encoding.OfBlob x.m, timestamp = x.t))
105103

106104
/// Collects all events with a Document [typically obtained via the CosmosDb ChangeFeed] that potentially represents an Equinox.Cosmos event-batch
107105
let enumStreamEvents d: StreamEvent seq =

src/Propulsion.CosmosStore/Propulsion.CosmosStore.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
<ItemGroup>
2222
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
2323

24-
<PackageReference Include="Equinox.CosmosStore" Version="4.1.0-alpha.15" />
25-
<PackageReference Include="FsCodec.SystemTextJson" Version="3.0.2" />
24+
<PackageReference Include="Equinox.CosmosStore" Version="4.1.0-alpha.19" />
25+
<PackageReference Include="FsCodec.SystemTextJson" Version="3.0.4-alpha.0.14" />
2626
</ItemGroup>
2727

2828
<ItemGroup>

src/Propulsion.CosmosStore/ReaderCheckpoint.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module Events =
4343
let codec = FsCodec.Box.Codec.Create<Event>()
4444
#else
4545
#if DYNAMOSTORE
46-
let codec = FsCodec.SystemTextJson.Codec.Create<Event>() |> FsCodec.Compression.EncodeUncompressed
46+
let codec = FsCodec.SystemTextJson.Codec.Create<Event>() |> FsCodec.Encoder.Uncompressed
4747
#else
4848
#if !COSMOSV3
4949
let codec = FsCodec.SystemTextJson.CodecJsonElement.Create<Event>()
@@ -193,7 +193,7 @@ module CosmosStore =
193193

194194
let accessStrategy = AccessStrategy.Custom (Fold.isOrigin, Fold.transmute)
195195
let create log (consumerGroupName, defaultCheckpointFrequency) (context, cache) =
196-
let cat = CosmosStoreCategory(context, Stream.Category, Events.codec, Fold.fold, Fold.initial, accessStrategy, cacheStrategy cache)
196+
let cat = CosmosStoreCategory(context, Stream.Category, FsCodec.SystemTextJson.Encoder.Compressed Events.codec, Fold.fold, Fold.initial, accessStrategy, cacheStrategy cache)
197197
let resolve = Equinox.Decider.forStream log cat
198198
Service(Stream.id >> resolve, consumerGroupName, defaultCheckpointFrequency)
199199
#else

src/Propulsion.CosmosStore3/Propulsion.CosmosStore3.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
4040

4141
<PackageReference Include="Equinox.CosmosStore" Version="[3.0.7, 3.99.0]" />
42-
<PackageReference Include="FsCodec" Version="3.0.0" />
42+
<PackageReference Include="FsCodec" Version="3.0.4-alpha.0.14" />
4343
<PackageReference Include="FSharp.Control.TaskSeq" Version="0.4.0" />
4444
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.27.0" ExcludeAssets="contentfiles" />
4545
</ItemGroup>

src/Propulsion.DynamoStore/DynamoStoreSource.fs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module private Impl =
5050
sw.Stop()
5151
let totalStreams, chosenEvents, totalEvents, streamEvents =
5252
let all = state.changes |> Seq.collect (fun struct (_i, xs) -> xs) |> AppendsEpoch.flatten |> Array.ofSeq
53-
let totalEvents = all |> Array.sumBy (fun x -> x.c.Length)
53+
let totalEvents = all |> Array.sumBy _.c.Length
5454
let mutable chosenEvents = 0
5555
let chooseStream (span: AppendsEpoch.Events.StreamSpan) =
5656
match maybeLoad (IndexStreamId.toStreamName span.p) (span.i, span.c) with
@@ -84,7 +84,7 @@ module private Impl =
8484
| true, (items: FsCodec.ITimelineEvent<_>[]) ->
8585
// NOTE this could throw if a span has been indexed, but the stream read is from a replica that does not yet have it
8686
// the exception in that case will trigger a safe re-read from the last saved read position that a consumer has forwarded
87-
// TOCONSIDER revise logic to share session key etc to rule this out
87+
// TOCONSIDER revise logic to share session key etc. to rule this out
8888
let events = Array.sub items (span.i - items[0].Index |> int) span.c.Length
8989
for e in events -> struct (IndexStreamId.toStreamName span.p, e) |] }
9090
let mutable prevLoaded, batchIndex = 0L, 0
@@ -123,13 +123,12 @@ type EventLoadMode =
123123
* /// Defines the Context to use when loading the Event Data/Meta
124124
storeContext: DynamoStoreContext
125125
module internal EventLoadMode =
126-
let private mapTimelineEvent = FsCodec.Core.TimelineEvent.Map(Func<_, _> FsCodec.Compression.EncodedToUtf8)
127126
let private withData (eventsContext: Equinox.DynamoStore.Core.EventsContext) streamFilter =
128127
fun sn (i, cs: string[]) ->
129128
if streamFilter sn then
130129
ValueSome (fun ct -> task {
131130
let! events = eventsContext.Read(sn, ct, i, maxCount = cs.Length)
132-
return events |> Array.map mapTimelineEvent })
131+
return events })
133132
else ValueNone
134133
let private withoutData streamFilter =
135134
fun sn (i, cs) ->

src/Propulsion.DynamoStore/Propulsion.DynamoStore.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
2828

2929
<PackageReference Include="Equinox.DynamoStore" Version="4.0.0" />
30-
<PackageReference Include="FsCodec.SystemTextJson" Version="3.0.2" />
30+
<PackageReference Include="FsCodec.SystemTextJson" Version="3.0.4-alpha.0.14" />
3131
</ItemGroup>
3232

3333
<ItemGroup>

src/Propulsion.DynamoStore/Store.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ module Dynamo =
3131
module internal Codec =
3232

3333
let gen<'t when 't :> TypeShape.UnionContract.IUnionContract> =
34-
FsCodec.SystemTextJson.Codec.Create<'t>() |> FsCodec.Compression.EncodeTryCompress
34+
FsCodec.SystemTextJson.Codec.Create<'t>() |> FsCodec.Encoder.Compressed

src/Propulsion.DynamoStore/Types.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module Streams =
7575

7676
let private withUpconverter<'c, 'e when 'c :> TypeShape.UnionContract.IUnionContract> up: FsCodec.IEventCodec<'e, _, _> =
7777
let down (_: 'e) = failwith "Unexpected"
78-
FsCodec.SystemTextJson.Codec.Create<'e, 'c, _>(up, down) |> FsCodec.Compression.EncodeTryCompress
78+
FsCodec.SystemTextJson.Codec.Create<'e, 'c, _>(up, down) |> FsCodec.Encoder.Compressed
7979
let decWithIndex<'c when 'c :> TypeShape.UnionContract.IUnionContract> : FsCodec.IEventCodec<struct (int64 * 'c), _, _> =
8080
let up (raw: FsCodec.ITimelineEvent<_>) e = struct (raw.Index, e)
8181
withUpconverter<'c, struct (int64 * 'c)> up

src/Propulsion.EventStore/EventStoreSink.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ module Internal =
4040
let i = StreamSpan.index span
4141
log.Debug("Writing {s}@{i}x{n}", stream, i, span.Length)
4242
#if EVENTSTORE_LEGACY
43-
let! res = context.Sync(log, stream, i - 1L, span |> Array.map (fun span -> span :> _))
43+
let! res = context.Sync(log, stream, i - 1L, span |> Array.map (FsCodec.Core.EventData.mapBodies FsCodec.Encoding.ToBlob))
4444
#else
45-
let! res = context.Sync(log, stream, i - 1L, span |> Array.map (fun span -> span :> _), ct)
45+
let! res = context.Sync(log, stream, i - 1L, span |> Array.map (FsCodec.Core.EventData.mapBodies FsCodec.Encoding.ToBlob), ct)
4646
#endif
4747
let res' =
4848
match res with

src/Propulsion.EventStore/EventStoreSource.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ module Mapping =
3636
member x.Timestamp = DateTimeOffset.FromUnixTimeMilliseconds(x.CreatedEpoch)
3737

3838
let (|PropulsionTimelineEvent|) (x: RecordedEvent): Propulsion.Sinks.Event =
39-
let inline len0ToNull (x: _[]) = match x with null -> ReadOnlyMemory.Empty | x when x.Length = 0 -> ReadOnlyMemory.Empty | x -> ReadOnlyMemory x
40-
FsCodec.Core.TimelineEvent.Create(x.EventNumber, x.EventType, len0ToNull x.Data, len0ToNull x.Metadata, timestamp = x.Timestamp)
39+
FsCodec.Core.TimelineEvent.Create(x.EventNumber, x.EventType, FsCodec.Encoding.OfBlob x.Data, FsCodec.Encoding.OfBlob x.Metadata, timestamp = x.Timestamp)
4140

4241
let (|PropulsionStreamEvent|) (x: RecordedEvent): Propulsion.Sinks.StreamEvent =
4342
Propulsion.Streams.StreamName.internalParseSafe x.EventStreamId, (|PropulsionTimelineEvent|) x

src/Propulsion.EventStoreDb/EventStoreSource.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module private Impl =
99
for e in events do
1010
let sn = Propulsion.Streams.StreamName.internalParseSafe e.EventStreamId
1111
if streamFilter sn then
12-
yield sn, Equinox.EventStoreDb.ClientCodec.timelineEvent e |]
12+
yield sn, Equinox.EventStoreDb.ClientCodec.timelineEvent e |> FsCodec.Core.TimelineEvent.mapBodies FsCodec.Encoding.OfBlob |]
1313
let private checkpointPos (xs: EventRecord[]) =
1414
match Array.tryLast xs with Some e -> int64 e.Position.CommitPosition | None -> -1L
1515
|> Propulsion.Feed.Position.parse

src/Propulsion.Kafka/Codec.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ type [<NoEquality; NoComparison>] RenderedSpan =
6060
module RenderedSpan =
6161

6262
let ofStreamSpan streamName (span: Event[]): RenderedSpan =
63-
let ta (x: EventBody) = x.ToArray()
63+
let ta (x: EventBody) = FsCodec.Encoding.ToBlob(x).ToArray()
6464
{ s = FsCodec.StreamName.toString streamName
6565
i = span[0].Index
6666
e = span |> Array.map (fun x -> { c = x.EventType; t = x.Timestamp; d = ta x.Data; m = ta x.Meta }) }
6767

6868
let enum (span: RenderedSpan): StreamEvent seq =
6969
let streamName = Propulsion.Streams.StreamName.internalParseSafe span.s
70-
let td (x: byte[]): EventBody = System.ReadOnlyMemory x
71-
let inline mkEvent offset (e: RenderedEvent) = FsCodec.Core.TimelineEvent.Create(span.i+int64 offset, e.c, td e.d, td e.m, timestamp = e.t)
70+
let td (x: byte[]): EventBody = FsCodec.Encoding.OfBlob x
71+
let inline mkEvent offset (e: RenderedEvent) = FsCodec.Core.TimelineEvent.Create(span.i + int64 offset, e.c, td e.d, td e.m, timestamp = e.t)
7272
span.e |> Seq.mapi (fun i e -> streamName, mkEvent i e)
7373

7474
let parse (spanJson: string): StreamEvent seq =
@@ -92,7 +92,7 @@ type [<NoEquality; NoComparison>] RenderedSummary =
9292
module RenderedSummary =
9393

9494
let ofStreamEvents (streamName: FsCodec.StreamName) (index: int64) (events: FsCodec.IEventData<EventBody> seq): RenderedSummary =
95-
let ta (x: EventBody): byte[] = x.ToArray()
95+
let ta (x: EventBody): byte[] = FsCodec.Encoding.ToBlob(x).ToArray()
9696
{ s = FsCodec.StreamName.toString streamName
9797
i = index
9898
u = [| for x in events -> { c = x.EventType; t = x.Timestamp; d = ta x.Data; m = ta x.Meta } |] }
@@ -102,7 +102,7 @@ module RenderedSummary =
102102

103103
let enum (span: RenderedSummary): StreamEvent seq =
104104
let streamName = Propulsion.Streams.StreamName.internalParseSafe span.s
105-
seq { for e in span.u -> streamName, FsCodec.Core.TimelineEvent.Create(span.i, e.c, e.d, e.m, timestamp=e.t, isUnfold=true) }
105+
seq { for e in span.u -> streamName, FsCodec.Core.TimelineEvent.Create(span.i, e.c, FsCodec.Encoding.OfBlob e.d, FsCodec.Encoding.OfBlob e.m, timestamp = e.t, isUnfold = true) }
106106

107107
let parse (spanJson: string): StreamEvent seq =
108108
spanJson |> RenderedSummary.Parse |> enum

src/Propulsion.Kafka/Consumers.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ module private Impl =
3232

3333
/// guesstimate approximate message size in bytes
3434
let approximateMessageBytes (m: Message<string, string>) =
35-
let inline len (x: string) = match x with null -> 0 | x -> sizeof<char> * x.Length
36-
16 + len m.Key + len m.Value |> int64
35+
let inline stringLen (x: string) = match x with null -> 0 | x -> sizeof<char> * x.Length
36+
16 + stringLen m.Key + stringLen m.Value |> int64
3737

3838
module private Binding =
3939

@@ -259,7 +259,7 @@ module Core =
259259
if m = null then invalidOp "Cannot dereference null message"
260260
let data = System.Text.Encoding.UTF8.GetBytes m.Value
261261
let context = { topic = result.Topic; partition = Binding.partitionValue result.Partition; offset = Binding.offsetValue result.Offset }
262-
(ReadOnlyMemory data, box context)
262+
(FsCodec.Encoding.OfBlob data, box context)
263263

264264
/// StreamsSink buffers and deduplicates messages from a contiguous stream with each event bearing a monotonically incrementing `Index`.
265265
/// Where the messages we consume don't have such characteristics, we need to maintain a fake `Index` by keeping an int per stream in a dictionary
@@ -325,7 +325,7 @@ type StreamNameSequenceGenerator() =
325325
member x.KeyValueToStreamEvent(KeyValue (k, v: string), ?eventType, ?defaultCategory): StreamEvent seq =
326326
let sn = Core.parseMessageKey (defaultArg defaultCategory String.Empty) k
327327
let e = FsCodec.Core.TimelineEvent.Create(x.GenerateIndex sn, defaultArg eventType String.Empty, System.Text.Encoding.UTF8.GetBytes v |> ReadOnlyMemory)
328-
Seq.singleton (sn, e)
328+
Seq.singleton (sn, FsCodec.Core.TimelineEvent.mapBodies FsCodec.Encoding.OfBlob e)
329329

330330
[<AbstractClass; Sealed>]
331331
type Factory private () =

src/Propulsion.MemoryStore/MemoryStoreSource.fs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,9 @@ and MemoryStoreMonitor internal (log: Serilog.ILogger, positions: TranchePositio
123123
if sink.IsCompleted && not sink.RanToCompletion then
124124
return! sink.Wait() }
125125

126-
module TimelineEvent =
127-
128-
let mapEncoded = FsCodec.Core.TimelineEvent.Map(Func<_, _> FsCodec.Compression.EncodedToUtf8)
129-
130126
/// Coordinates forwarding of a VolatileStore's Committed events to a supplied Sink
131127
/// Supports awaiting the (asynchronous) handling by the Sink of all Committed events from a given point in time
132128
type MemoryStoreSource(log, store: Equinox.MemoryStore.VolatileStore<FsCodec.EncodedBody>, categoryFilter, sink) =
133-
inherit MemoryStoreSource<FsCodec.EncodedBody>(log, store, categoryFilter, TimelineEvent.mapEncoded, sink)
129+
inherit MemoryStoreSource<FsCodec.EncodedBody>(log, store, categoryFilter, id, sink)
134130
new(log, store, categories, sink) =
135131
MemoryStoreSource(log, store, (fun x -> Array.contains x categories), sink)

src/Propulsion.MessageDb/MessageDbSource.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ module Internal =
3232
do! conn.OpenAsync(ct)
3333
return conn }
3434

35-
let private jsonNull = ReadOnlyMemory(System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(null))
35+
let private jsonNull = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes null
3636

3737
type System.Data.Common.DbDataReader with
3838
member reader.GetJson idx =
3939
if reader.IsDBNull(idx) then jsonNull
40-
else reader.GetString(idx) |> Text.Encoding.UTF8.GetBytes |> ReadOnlyMemory
40+
else reader.GetString(idx) |> Text.Encoding.UTF8.GetBytes
4141

4242
type MessageDbCategoryClient(connectionString) =
4343
let connect = createConnectionAndOpen connectionString
4444
let parseRow (reader: System.Data.Common.DbDataReader) =
45-
let et, data, meta = reader.GetString(1), reader.GetJson 2, reader.GetJson 3
46-
let sz = data.Length + meta.Length + et.Length
45+
let et, data, meta = reader.GetString(1), reader.GetJson 2 |> FsCodec.Encoding.OfBlob, reader.GetJson 3 |> FsCodec.Encoding.OfBlob
46+
let sz = FsCodec.Encoding.ByteCount data + FsCodec.Encoding.ByteCount meta + et.Length
4747
let event = FsCodec.Core.TimelineEvent.Create(
4848
index = reader.GetInt64(0), // index within the stream, 0 based
4949
eventType = et, data = data, meta = meta, eventId = reader.GetGuid(4),

0 commit comments

Comments
 (0)