Skip to content

Commit

Permalink
Add dump -b to enable overriding Cosmos MaxItems
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed May 21, 2020
1 parent eaf1ca3 commit 2d7e2cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ The `Unreleased` section name is replaced by the expected version of next releas
## [Unreleased]

### Added

- Add `eqx dump -b`, enabling overriding of Max Events per Batch

### Changed

- `MemoryStore`: Target `FsCodec` v `2.0.0` [#219](https://github.com/jet/equinox/pull/219)
Expand All @@ -26,7 +29,7 @@ The `Unreleased` section name is replaced by the expected version of next releas

### Fixed

- `SqlStreamStore.MsSql`: Initial Append when stream empty on MsSql was perpetually failing :pray: [#209](https://github.com/jet/equinox/pull/209) [@Kimserey](https://github.com/kimserey)
- `SqlStreamStore.MsSql`: Initial Append when stream empty on MsSql was perpetually failing [#209](https://github.com/jet/equinox/pull/209) :pray: [@Kimserey](https://github.com/kimserey)

<a name="2.0.0"></a>
## [2.0.0] - 2020-02-19
Expand Down
6 changes: 4 additions & 2 deletions tools/Equinox.Tool/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ and [<NoComparison; NoEquality>]DumpArguments =
| [<AltCommandLine "-T"; Unique>] TimeRegular
| [<AltCommandLine "-U"; Unique>] UnfoldsOnly
| [<AltCommandLine "-E"; Unique >] EventsOnly
| [<AltCommandLine "-b"; Unique >] BatchSize of int
| [<CliPrefix(CliPrefix.None)>] Cosmos of ParseResults<Storage.Cosmos.Arguments>
| [<CliPrefix(CliPrefix.None); Last>] Es of ParseResults<Storage.EventStore.Arguments>
| [<CliPrefix(CliPrefix.None); Last; AltCommandLine "ms">] MsSql of ParseResults<Storage.Sql.Ms.Arguments>
Expand All @@ -91,14 +92,15 @@ and [<NoComparison; NoEquality>]DumpArguments =
| TimeRegular -> "Don't humanize time intervals between events"
| UnfoldsOnly -> "Exclude Events. Default: show both Events and Unfolds"
| EventsOnly -> "Exclude Unfolds/Snapshots. Default: show both Events and Unfolds."
| BatchSize _ -> "Maximum number of documents to request per batch. Default 1000."
| Es _ -> "Parameters for EventStore."
| Cosmos _ -> "Parameters for CosmosDb."
| MsSql _ -> "Parameters for Sql Server."
| MySql _ -> "Parameters for MySql."
| Postgres _ -> "Parameters for Postgres."
and DumpInfo(args: ParseResults<DumpArguments>) =
member __.ConfigureStore(log : ILogger, createStoreLog) =
let storeConfig = None,true,1000
let storeConfig = None, true, args.GetResult(DumpArguments.BatchSize,1000)
match args.TryGetSubCommand() with
| Some (DumpArguments.Cosmos sargs) ->
let storeLog = createStoreLog <| sargs.Contains Storage.Cosmos.Arguments.VerboseStore
Expand Down Expand Up @@ -357,7 +359,7 @@ module CosmosStats =
log.Debug("Running query: {sql}", sql)
let res = container.QueryValue<int>(sql, Microsoft.Azure.Documents.Client.FeedOptions(EnableCrossPartitionQuery=true))
log.Information("{stat}: {result:N0}", name, res)})
|> if inParallel then Async.Parallel else Async.ParallelThrottled 1 // TOCONSIDER replace with Async.Sequence when using new enough FSharp.Core
|> if inParallel then Async.Parallel else Async.Sequential
|> Async.Ignore
|> Async.RunSynchronously
| _ -> failwith "please specify a `cosmos` endpoint" }
Expand Down

0 comments on commit 2d7e2cb

Please sign in to comment.