Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eqx dump cosmos #177

Merged
merged 12 commits into from
Nov 8, 2019
Prev Previous commit
Next Next commit
Diff reduction
  • Loading branch information
bartelink committed Nov 8, 2019
commit f049b1af50fda82e04caf388b1a9cd2c862af391
2 changes: 1 addition & 1 deletion samples/Infrastructure/Storage.fs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module Cosmos =
let private createGateway connection maxItems = Gateway(connection, BatchingPolicy(defaultMaxItems=maxItems))
let connection (log: ILogger, storeLog: ILogger) (a : Info) =
let (Discovery.UriAndKey (endpointUri,_)) as discovery = a.Connection|> Discovery.FromConnectionString
log.Information("CosmosDb {mode:l} {connection} Database {database:l} Container {container:l}",
log.Information("CosmosDb {mode} {connection} Database {database} Container {container}",
a.Mode, endpointUri, a.Database, a.Container)
log.Information("CosmosDb timeout {timeout}s; Throttling retries {retries}, max wait {maxRetryWaitTime}s",
(let t = a.Timeout in t.TotalSeconds), a.Retries, let x = a.MaxRetryWaitTime in x.TotalSeconds)
Expand Down
2 changes: 1 addition & 1 deletion tools/Equinox.Tool/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ module CosmosStats =
ops |> Seq.map (fun (name,sql) -> async {
log.Debug("Running query: {sql}", sql)
let res = container.QueryValue<int>(sql, Microsoft.Azure.Documents.Client.FeedOptions(EnableCrossPartitionQuery=true))
log.Information("{Stat:l}: {result:N0}", name, res)})
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
|> Async.Ignore
|> Async.RunSynchronously
Expand Down