Skip to content

Commit

Permalink
Merge pull request #119 from statechannels/ci-metrics
Browse files Browse the repository at this point in the history
Record Mean TTFP per run for CI/Nightly runs
  • Loading branch information
lalexgap authored Oct 4, 2022
2 parents d763d15 + d7f5b8c commit a57a5ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ name = "virtual-payment"

[testcases.params]
concurrentPaymentJobs = {type = "int", desc = "The number of concurrent payment jobs a peer should attempt to maintain", default = 1}
isCI = {type = "bool", default = false, desc = "Whether this test is being run as from CI"}
isNightly = {type = "bool", default = false, desc = "Whether this test is being run as part of the nightly test suite"}
networkJitter = {type = "int", unit = "milliseconds", default = 0}
networkLatency = {type = "int", unit = "milliseconds", default = 0}
numOfHubs = {type = "int", default = 1, desc = "The number of instances that should play the role of the hub"}
Expand Down
10 changes: 10 additions & 0 deletions tests/virtual-payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,16 @@ func CreateVirtualPaymentTest(runEnv *runtime.RunEnv, init *run.InitContext) err
runEnv.RecordMessage("All ledger channels closed")
}

// Record the mean time to first payment to nightly/ci metrics if applicable
// This allows us to track performance over time
mean := runEnv.R().Timer(fmt.Sprintf("time_to_first_payment,me=%s", me.Address)).Mean()
if runEnv.BooleanParam("isNightly") {
runEnv.R().RecordPoint(fmt.Sprintf("nightly_mean_time_to_first_payment,me=%s", me.Address), float64(mean))
}
if runEnv.BooleanParam("isCI") {
runEnv.R().RecordPoint(fmt.Sprintf("ci_mean_time_to_first_payment,me=%s", me.Address), float64(mean))
}

client.MustSignalAndWait(ctx, "done", runEnv.TestInstanceCount)

return nil
Expand Down

0 comments on commit a57a5ff

Please sign in to comment.