Add response time badge and chart

This commit is contained in:
TwinProduction
2021-08-21 17:38:23 -04:00
committed by Chris
parent bab69478dd
commit 470e3a3ebc
140 changed files with 26995 additions and 106 deletions

53
vendor/github.com/wcharczuk/go-chart/v2/value.go generated vendored Normal file
View File

@ -0,0 +1,53 @@
package chart
// Value is a chart value.
type Value struct {
Style Style
Label string
Value float64
}
// Values is an array of Value.
type Values []Value
// Values returns the values.
func (vs Values) Values() []float64 {
values := make([]float64, len(vs))
for index, v := range vs {
values[index] = v.Value
}
return values
}
// ValuesNormalized returns normalized values.
func (vs Values) ValuesNormalized() []float64 {
return Normalize(vs.Values()...)
}
// Normalize returns the values normalized.
func (vs Values) Normalize() []Value {
var output []Value
var total float64
for _, v := range vs {
total += v.Value
}
for _, v := range vs {
if v.Value > 0 {
output = append(output, Value{
Style: v.Style,
Label: v.Label,
Value: RoundDown(v.Value/total, 0.0001),
})
}
}
return output
}
// Value2 is a two axis value.
type Value2 struct {
Style Style
Label string
XValue, YValue float64
}