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

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

@ -0,0 +1,40 @@
package chart
import (
"strconv"
"strings"
"time"
)
// ParseFloats parses a list of floats.
func ParseFloats(values ...string) ([]float64, error) {
var output []float64
var parsedValue float64
var err error
var cleaned string
for _, value := range values {
cleaned = strings.TrimSpace(strings.Replace(value, ",", "", -1))
if cleaned == "" {
continue
}
if parsedValue, err = strconv.ParseFloat(cleaned, 64); err != nil {
return nil, err
}
output = append(output, parsedValue)
}
return output, nil
}
// ParseTimes parses a list of times with a given format.
func ParseTimes(layout string, values ...string) ([]time.Time, error) {
var output []time.Time
var parsedValue time.Time
var err error
for _, value := range values {
if parsedValue, err = time.Parse(layout, value); err != nil {
return nil, err
}
output = append(output, parsedValue)
}
return output, nil
}