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
Polish eqx run log output
  • Loading branch information
bartelink committed Nov 8, 2019
commit 72b0d3e9aeecc91845db01f2756fd135d85d2f86
8 changes: 4 additions & 4 deletions tools/Equinox.Tool/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ module LoadTest =
| None, None -> invalidOp "impossible None, None"
let clients = Array.init (a.TestsPerSecond * 2) (fun _ -> % Guid.NewGuid())

log.Information( "Running {test} for {duration} @ {tps} hits/s across {clients} clients; Max errors: {errorCutOff}, reporting intervals: {ri}, report file: {report}",
log.ForContext("clientIds",if verboseConsole then Seq.ofArray clients else Seq.truncate 5 clients)
.Information("Running {test} for {duration} @ {tps} hits/s across {clients} clients; Max errors: {errorCutOff}, reporting intervals: {ri}, report file: {report}",
test, a.Duration, a.TestsPerSecond, clients.Length, a.ErrorCutoff, a.ReportingIntervals, reportFilename)
// Reset the start time based on which the shared global metrics will be computed
let _ = Equinox.Cosmos.Store.Log.InternalMetrics.Stats.LogSink.Restart()
Expand Down Expand Up @@ -283,7 +284,7 @@ let createDomainLog verbose verboseConsole maybeSeqEndpoint =
let c = c.WriteTo.Sink(Equinox.Cosmos.Store.Log.InternalMetrics.Stats.LogSink())
let c = c.WriteTo.Sink(Equinox.EventStore.Log.InternalMetrics.Stats.LogSink())
let c = c.WriteTo.Sink(Equinox.SqlStreamStore.Log.InternalMetrics.Stats.LogSink())
let outputTemplate = "{Timestamp:T} {Level:u1} {Message} {Properties}{NewLine}{Exception}"
let outputTemplate = "{Timestamp:T} {Level:u1} {Message:l} {Properties}{NewLine}{Exception}"
let c = c.WriteTo.Console((if verboseConsole then LogEventLevel.Debug else LogEventLevel.Information), outputTemplate, theme = Sinks.SystemConsole.Themes.AnsiConsoleTheme.Code)
let c = match maybeSeqEndpoint with None -> c | Some endpoint -> c.WriteTo.Seq(endpoint)
c.CreateLogger()
Expand Down Expand Up @@ -391,8 +392,7 @@ module Dump =
let main argv =
let programName = System.Reflection.Assembly.GetEntryAssembly().GetName().Name
let parser = ArgumentParser.Create<Arguments>(programName = programName)
try
let args = parser.ParseCommandLine argv
try let args = parser.ParseCommandLine argv
let verboseConsole = args.Contains VerboseConsole
let maybeSeq = if args.Contains LocalSeq then Some "http://localhost:5341" else None
let verbose = args.Contains Verbose
Expand Down
2 changes: 1 addition & 1 deletion tools/Equinox.Tools.TestHarness/Aggregate.fs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module Observable =
let logAggregate (log: ILogger) (source : IObservable<Envelope<TestResultAggregate>>) : IDisposable =
source
|> Observable.map TestResultAggregate.Render
|> Observable.subscribe (fun r -> log.Information("Aggregate: {result}",r))
|> Observable.subscribe (fun r -> log.Information("Aggregate: {result:l}",r))

/// Logs load test events with provided log level
let logEvents (log : ILogger) (events : IObservable<Envelope<LoadTestEvent>>) =
Expand Down