Skip to content

Commit c86f703

Browse files
committed
Review diffs
1 parent d5748af commit c86f703

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ The components within this repository are delivered as multi-targeted Nuget pack
136136
- `Equinox.Core` [![NuGet](https://img.shields.io/nuget/v/Equinox.Core.svg)](https://www.nuget.org/packages/Equinox.Core/): Interfaces and helpers used in the concrete Store implementations, together with the default [`System.Runtime.Caching.Cache`-based] `Cache` implementation. Hosts generic utility types frequently useful alongside Equinox: [`AsyncCacheCell`](https://github.com/jet/equinox/blob/master/src/Equinox.Core/AsyncCacheCell.fs#L36), [`AsyncBatchingGate`](https://github.com/jet/equinox/blob/master/src/Equinox.Core/AsyncBatchingGate.fs#L41). ([depends](https://www.fuget.org/packages/Equinox.Core) on `Equinox`, `System.Runtime.Caching`)
137137
- `Equinox.MemoryStore` [![MemoryStore NuGet](https://img.shields.io/nuget/v/Equinox.MemoryStore.svg)](https://www.nuget.org/packages/Equinox.MemoryStore/): In-memory store for integration testing/performance base-lining/providing out-of-the-box zero dependency storage for examples. ([depends](https://www.fuget.org/packages/Equinox.MemoryStore) on `Equinox.Core`, `FsCodec`)
138138
- `Equinox.EventStore` [![EventStore NuGet](https://img.shields.io/nuget/v/Equinox.EventStore.svg)](https://www.nuget.org/packages/Equinox.EventStore/): [EventStoreDB](https://eventstore.org/) Adapter designed to meet Jet's production monitoring requirements. ([depends](https://www.fuget.org/packages/Equinox.EventStore) on `Equinox.Core`, `EventStore.Client >= 20.6`, `FSharp.Control.AsyncSeq >= 2.0.23`)
139-
- `Equinox.CosmosStore` [![CosmosStore NuGet](https://img.shields.io/nuget/v/Equinox.CosmosStore.svg)](https://www.nuget.org/packages/Equinox.CosmosStore/): Azure CosmosDB Adapter with integrated 'unfolds' feature, facilitating optimal read performance in terms of latency and RU costs, instrumented to meet Jet's production monitoring requirements. ([depends](https://www.fuget.org/packages/Equinox.CosmosStore) on `Equinox.Core`, `Microsoft.Azure.Cosmos >= 3.17`, `FsCodec >= 2.3.0`, `System.Text.Json >= 6.0.1`, `FSharp.Control.AsyncSeq >= 2.0.23`)
139+
- `Equinox.CosmosStore` [![CosmosStore NuGet](https://img.shields.io/nuget/v/Equinox.CosmosStore.svg)](https://www.nuget.org/packages/Equinox.CosmosStore/): Azure CosmosDB Adapter with integrated 'unfolds' feature, facilitating optimal read performance in terms of latency and RU costs, instrumented to meet Jet's production monitoring requirements. ([depends](https://www.fuget.org/packages/Equinox.CosmosStore) on `Equinox.Core`, `Microsoft.Azure.Cosmos >= 3.25`, `FsCodec >= 2.3.1`, `System.Text.Json >= 6.0.1`, `FSharp.Control.AsyncSeq >= 2.0.23`)
140140
- `Equinox.CosmosStore.Prometheus` [![CosmosStore.Prometheus NuGet](https://img.shields.io/nuget/v/Equinox.CosmosStore.Prometheus.svg)](https://www.nuget.org/packages/Equinox.CosmosStore.Prometheus/): Integration package providing a `Serilog.Core.ILogEventSink` that extracts detailed metrics information attached to the `LogEvent`s and feeds them to the `prometheus-net`'s `Prometheus.Metrics` static instance. ([depends](https://www.fuget.org/packages/Equinox.CosmosStore.Prometheus) on `Equinox.CosmosStore`, `prometheus-net >= 3.6.0`)
141141
- `Equinox.SqlStreamStore` [![SqlStreamStore NuGet](https://img.shields.io/nuget/v/Equinox.SqlStreamStore.svg)](https://www.nuget.org/packages/Equinox.SqlStreamStore/): [SqlStreamStore](https://github.com/SQLStreamStore/SQLStreamStore) Adapter derived from `Equinox.EventStore` - provides core facilities (but does not connect to a specific database; see sibling `SqlStreamStore`.* packages). ([depends](https://www.fuget.org/packages/Equinox.SqlStreamStore) on `Equinox.Core`, `FsCodec`, `SqlStreamStore >= 1.2.0-beta.8`, `FSharp.Control.AsyncSeq`)
142142
- `Equinox.SqlStreamStore.MsSql` [![MsSql NuGet](https://img.shields.io/nuget/v/Equinox.SqlStreamStore.MsSql.svg)](https://www.nuget.org/packages/Equinox.SqlStreamStore.MsSql/): [SqlStreamStore.MsSql](https://sqlstreamstore.readthedocs.io/en/latest/sqlserver) Sql Server `Connector` implementation for `Equinox.SqlStreamStore` package). ([depends](https://www.fuget.org/packages/Equinox.SqlStreamStore.MsSql) on `Equinox.SqlStreamStore`, `SqlStreamStore.MsSql >= 1.2.0-beta.8`)

src/Equinox.CosmosStore/CosmosStore.fs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ type EventBody = JsonElement
1212

1313
/// A single Domain Event from the array held in a Batch
1414
[<NoEquality; NoComparison>]
15-
type Event = // TODO for STJ v5: All fields required unless explicitly optional
15+
type Event = // TODO for a future STJ version: All fields required unless explicitly optional
1616
{ /// Creation datetime (as opposed to system-defined _lastUpdated which is touched by triggers, replication etc.)
1717
t: DateTimeOffset // ISO 8601
1818

1919
/// The Case (Event Type); used to drive deserialization
2020
c: string // required
2121

2222
/// Event body, as UTF-8 encoded json ready to be injected into the Json being rendered for CosmosDB
23-
d: EventBody // TODO for STJ v5: Required, but can be null so Nullary cases can work
23+
d: EventBody // TODO for a future STJ version: Required, but can be null so Nullary cases can work
2424

2525
/// Optional metadata, as UTF-8 encoded json, ready to emit directly
26-
m: EventBody // TODO for STJ v5: Optional, not serialized if missing
26+
m: EventBody // TODO for a future STJ version: Optional, not serialized if missing
2727

2828
/// Optional correlationId
29-
correlationId : string // TODO for STJ v5: Optional, not serialized if missing
29+
correlationId : string // TODO for a future STJ version: Optional, not serialized if missing
3030

3131
/// Optional causationId
32-
causationId : string // TODO for STJ v5: Optional, not serialized if missing
32+
causationId : string // TODO for a future STJ version: Optional, not serialized if missing
3333
}
3434

3535
interface IEventData<EventBody> with
@@ -43,10 +43,10 @@ type Event = // TODO for STJ v5: All fields required unless explicitly optional
4343

4444
/// A 'normal' (frozen, not Tip) Batch of Events (without any Unfolds)
4545
[<NoEquality; NoComparison>]
46-
type Batch = // TODO for STJ v5: All fields required unless explicitly optional
46+
type Batch = // TODO for a future STJ version: All fields required unless explicitly optional
4747
{ /// CosmosDB-mandated Partition Key, must be maintained within the document
4848
/// Not actually required if running in single partition mode, but for simplicity, we always write it
49-
p: string // "{streamName}" TODO for STJ v5: Optional, not requested in queries
49+
p: string // "{streamName}" TODO for a future STJ version: Optional, not requested in queries
5050

5151
/// CosmosDB-mandated unique row key; needs to be unique within any partition it is maintained; must be string
5252
/// At the present time, one can't perform an ORDER BY on this field, hence we also have i shadowing it
@@ -56,7 +56,7 @@ type Batch = // TODO for STJ v5: All fields required unless explicitly optional
5656
/// When we read, we need to capture the value so we can retain it for caching purposes
5757
/// NB this is not relevant to fill in when we pass it to the writing stored procedure
5858
/// as it will do: 1. read 2. merge 3. write merged version contingent on the _etag not having changed
59-
_etag: string // TODO for STJ v5: Optional, not serialized if missing
59+
_etag: string // TODO for a future STJ version: Optional, not serialized if missing
6060

6161
/// base 'i' value for the Events held herein
6262
i: int64 // {index}
@@ -66,7 +66,7 @@ type Batch = // TODO for STJ v5: All fields required unless explicitly optional
6666

6767
/// The Domain Events (as opposed to Unfolded Events, see Tip) at this offset in the stream
6868
e: Event[] }
69-
/// Unless running in single partition mode (which would restrict us to 10GB per collection)
69+
/// Unless running in single partition mode (which would restrict us to 10GB per container)
7070
/// we need to nominate a partition key that will be in every document
7171
static member internal PartitionKeyField = "p"
7272
/// As one cannot sort by the implicit `id` field, we have an indexed `i` field for sort and range query use
@@ -90,25 +90,25 @@ type Unfold =
9090

9191
/// Optional metadata, same encoding as `d` (can be null; not written if missing)
9292
[<Serialization.JsonConverter(typeof<JsonCompressedBase64Converter>)>]
93-
m: EventBody // TODO for STJ v5: Optional, not serialized if missing
93+
m: EventBody // TODO for a future STJ version: Optional, not serialized if missing
9494
}
9595

9696
/// The special-case 'Pending' Batch Format used to read the currently active (and mutable) document
9797
/// Stored representation has the following diffs vs a 'normal' (frozen/completed) Batch: a) `id` = `-1` b) contains unfolds (`u`)
9898
/// NB the type does double duty as a) model for when we read it b) encoding a batch being sent to the stored proc
9999
[<NoEquality; NoComparison>]
100-
type Tip = // TODO for STJ v5: All fields required unless explicitly optional
100+
type Tip = // TODO for a future STJ version: All fields required unless explicitly optional
101101
{
102102
/// Partition key, as per Batch
103-
p: string // "{streamName}" TODO for STJ v5: Optional, not requested in queries
103+
p: string // "{streamName}" TODO for a future STJ version: Optional, not requested in queries
104104

105105
/// Document Id within partition, as per Batch
106106
id: string // "{-1}" - Well known IdConstant used while this remains the pending batch
107107

108108
/// When we read, we need to capture the value so we can retain it for caching purposes
109109
/// NB this is not relevant to fill in when we pass it to the writing stored procedure
110110
/// as it will do: 1. read 2. merge 3. write merged version contingent on the _etag not having changed
111-
_etag: string // TODO for STJ v5: Optional, not serialized if missing
111+
_etag: string // TODO for a future STJ version: Optional, not serialized if missing
112112

113113
/// base 'i' value for the Events held herein
114114
i: int64

src/Equinox.CosmosStore/Equinox.CosmosStore.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<PackageReference Include="FSharp.Core" Version="4.3.4" />
2626

27-
<PackageReference Include="FsCodec" Version="2.3.0" />
27+
<PackageReference Include="FsCodec" Version="2.3.1" />
2828
<PackageReference Include="System.Text.Json" Version="6.0.1" />
2929
<PackageReference Include="FSharp.Control.AsyncSeq" Version="2.0.23" />
3030
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.25.0" />

tests/Equinox.CosmosStore.Integration/CosmosIntegration.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ type Tests(testOutputHelper) =
9898
test <@ addRemoveCount = match state with { items = [{ quantity = quantity }] } -> quantity | _ -> failwith "nope" @>
9999

100100
test <@ List.replicate (expectedResponses transactions) EqxAct.ResponseBackward @ [EqxAct.QueryBackward] = capture.ExternalCalls @>
101-
if eventsInTip then verifyRequestChargesMax 9 // 8.05
101+
if eventsInTip then verifyRequestChargesMax 8 // 7.46
102102
else verifyRequestChargesMax 15 // 14.01
103103
}
104104

0 commit comments

Comments
 (0)