MCPcopy
hub / github.com/sourcegraph/checkup / String

Method String

types/result.go:89–109  ·  view source on GitHub ↗

String returns a human-readable rendering of r.

()

Source from the content-addressed store, hash-verified

87
88// String returns a human-readable rendering of r.
89func (r Result) String() string {
90 stats := r.ComputeStats()
91 s := fmt.Sprintf("== %s - %s\n", r.Title, r.Endpoint)
92 s += fmt.Sprintf(" Threshold: %s\n", r.ThresholdRTT)
93 s += fmt.Sprintf(" Max: %s\n", stats.Max)
94 s += fmt.Sprintf(" Min: %s\n", stats.Min)
95 s += fmt.Sprintf(" Median: %s\n", stats.Median)
96 s += fmt.Sprintf(" Mean: %s\n", stats.Mean)
97 s += fmt.Sprintf(" All: %v\n", r.Times)
98 statusLine := fmt.Sprintf(" Assessment: %v\n", r.Status())
99 switch r.Status() {
100 case StatusHealthy:
101 statusLine = color.GreenString(statusLine)
102 case StatusDegraded:
103 statusLine = color.YellowString(statusLine)
104 case StatusDown:
105 statusLine = color.RedString(statusLine)
106 }
107 s += statusLine
108 return s
109}
110
111// Status returns a text representation of the overall status
112// indicated in r.

Callers 14

ProvisionMethod · 0.45
ListObjectsMethod · 0.45
writeFileMethod · 0.45
deleteFileMethod · 0.45
repositoryContentFunction · 0.45
withGitHubServerFunction · 0.45
TestCheckerFunction · 0.45
TestCheckerFunction · 0.45
TestCheckerFunction · 0.45

Calls 2

ComputeStatsMethod · 0.95
StatusMethod · 0.95

Tested by 11

ListObjectsMethod · 0.36
repositoryContentFunction · 0.36
withGitHubServerFunction · 0.36
TestCheckerFunction · 0.36
TestCheckerFunction · 0.36
TestCheckerFunction · 0.36