MCPcopy Create free account
hub / github.com/github/gh-aw / experimentTotalRuns

Function experimentTotalRuns

pkg/cli/experiments_command.go:716–727  ·  view source on GitHub ↗

experimentTotalRuns returns the total number of runs recorded in the state. Prefers the runs array length when non-empty; falls back to summing all variant counts.

(state *ExperimentState)

Source from the content-addressed store, hash-verified

714// experimentTotalRuns returns the total number of runs recorded in the state.
715// Prefers the runs array length when non-empty; falls back to summing all variant counts.
716func experimentTotalRuns(state *ExperimentState) int {
717 if len(state.Runs) > 0 {
718 return len(state.Runs)
719 }
720 total := 0
721 for _, variants := range state.Counts {
722 for _, c := range variants {
723 total += c
724 }
725 }
726 return total
727}
728
729// experimentLastRun returns the date (YYYY-MM-DD) of the most recent run, or "" if unknown.
730func experimentLastRun(state *ExperimentState) string {

Callers 4

experimentInfoFromStateFunction · 0.85
TestParseExperimentStateFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestParseExperimentStateFunction · 0.68