Documentation ¶
Index ¶
- Constants
- Variables
- func LogHandlerFunc(next http.HandlerFunc) http.HandlerFunc
- type APIHandler
- type ClaimRunRequest
- type Option
- type ResponseInspectingWriter
- type UIHandler
- func (s *UIHandler) ExecuteTemplate(name string, w io.Writer, value interface{}) error
- func (h *UIHandler) LoadSummaries(ctx context.Context) (packages []string, month, day, hour []*tester.RunSummary, err error)
- func (h *UIHandler) Render(w http.ResponseWriter, r *http.Request, name string, value interface{})
- func (h *UIHandler) RenderError(w http.ResponseWriter, r *http.Request, err error, status int)
- func (h *UIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
const ( // RunDurationMetricName is the name of the metric for test and benchmark run // durations. RunDurationMetricName = "run_duration_s" // RunLastMetricName is the name of the metric for the test and benchmark last // run timestamp. RunLastMetricName = "run_last_timestamp" )
Variables ¶
var RunDurationMetric = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "tester", Subsystem: "tb", Name: RunDurationMetricName, Help: "Amount of time tests or benchmarks take.", Buckets: []float64{ 0.001, 0.01, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.25, 1.5, 1.75, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 180, 240, 300, 360, 420, 480, 540, 600, 660, 720, 780, 840, 900, }, }, []string{"name", "state"}, )
RunDurationMetric is the the metric for test and benchmark run durations.
var RunLastMetric = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "testr", Subsystem: "tb", Name: RunLastMetricName, Help: "Timestamp of the last run for a test or benchmark.", }, []string{"name", "state"}, )
RunLastMetric is the the metric for test and benchmark last run timestamps.
Functions ¶
func LogHandlerFunc ¶
func LogHandlerFunc(next http.HandlerFunc) http.HandlerFunc
LogHandlerFunc logs request/response information.
Types ¶
type APIHandler ¶
APIHandler is the http handler for presenting the API.
func NewAPIHandler ¶
NewAPIHandler constructs a new `APIHandler`.
func (*APIHandler) ServeHTTP ¶
func (h *APIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ClaimRunRequest ¶
type Option ¶
type Option func(*options)
Option is used to inject dependencies into a Server on creation.
func WithAPIKey ¶
WithAPIKey allows configuring a symmetric key for api auth.
func WithAlertManager ¶
func WithAlertManager(am *alerting.AlertManager) Option
WithAlertManager allows configuring a custom alert manager.
func WithSlackApp ¶
WithSlackApp allows configuring a slack app integration.
type ResponseInspectingWriter ¶
type ResponseInspectingWriter struct { http.ResponseWriter Status int }
ResponseInspectingWriter is an http.ResponseWriter that captures response info.
func (*ResponseInspectingWriter) Write ¶
func (w *ResponseInspectingWriter) Write(p []byte) (int, error)
Write wraps the method for writing response bodies..
func (*ResponseInspectingWriter) WriteHeader ¶
func (w *ResponseInspectingWriter) WriteHeader(s int)
WriteHeader wraps the method capturing the response status code.
type UIHandler ¶
UIHandler is the http handler for presenting the web UI.
func NewUIHandler ¶
NewUIHandler constructs a new `UIHandler`.
func (*UIHandler) ExecuteTemplate ¶
ExecuteTemplate runs the given template with the value