model

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatUptime

func FormatUptime(d time.Duration) string

Types

type CertSortField added in v1.1.0

type CertSortField int
const (
	SortByCertDomain CertSortField = iota
	SortByCertExpiry
	SortByCertSource
	SortByCertIssuer
)

func (CertSortField) Next added in v1.1.0

func (s CertSortField) Next() CertSortField

func (CertSortField) Prev added in v1.1.0

func (s CertSortField) Prev() CertSortField

func (CertSortField) String added in v1.1.0

func (s CertSortField) String() string

type DerivedMetrics

type DerivedMetrics struct {
	RPS            float64
	AvgTime        float64
	ErrorRate      float64
	TotalIdle      int
	TotalBusy      int
	TotalCrashes   float64
	P50            float64
	P90            float64
	P95            float64
	P99            float64
	HasPercentiles bool
}

type HostDerived

type HostDerived struct {
	Host                               string
	RPS                                float64
	AvgTime                            float64
	ErrorRate                          float64
	InFlight                           float64
	P50, P90, P95, P99                 float64
	HasPercentiles                     bool
	TTFBP50, TTFBP90, TTFBP95, TTFBP99 float64
	HasTTFB                            bool
	StatusCodes                        map[int]float64
	MethodRates                        map[string]float64
	AvgResponseSize                    float64
	AvgRequestSize                     float64
	TotalRequests                      float64
}

type HostSortField

type HostSortField int
const (
	SortByHost HostSortField = iota
	SortByHostRPS
	SortByHostAvg
	SortByHostInFlight
	SortByHost2xx
	SortByHost4xx
	SortByHost5xx
)

func (HostSortField) Next

func (s HostSortField) Next() HostSortField

func (HostSortField) Prev

func (s HostSortField) Prev() HostSortField

func (HostSortField) String

func (s HostSortField) String() string

type SortField

type SortField int
const (
	SortByIndex SortField = iota
	SortByState
	SortByMethod
	SortByURI
	SortByTime
	SortByMemory
	SortByRequests
)

func (SortField) Next

func (s SortField) Next() SortField

func (SortField) Prev

func (s SortField) Prev() SortField

func (SortField) String

func (s SortField) String() string

type State

type State struct {
	Current         *fetcher.Snapshot
	Previous        *fetcher.Snapshot
	Derived         DerivedMetrics
	HostDerived     []HostDerived
	UpstreamDerived []UpstreamDerived
	// contains filtered or unexported fields
}

func (*State) CopyForExport

func (s *State) CopyForExport() State

CopyForExport returns a copy safe for concurrent read from the exporter.

func (*State) ResetPercentiles

func (s *State) ResetPercentiles()

func (*State) Update

func (s *State) Update(snap *fetcher.Snapshot)

type UpstreamDerived added in v1.2.0

type UpstreamDerived struct {
	Address       string
	Handler       string
	Healthy       bool
	HealthChanged bool
}

type UpstreamSortField added in v1.2.0

type UpstreamSortField int
const (
	SortByUpstreamAddress UpstreamSortField = iota
	SortByUpstreamHealth
)

func (UpstreamSortField) Next added in v1.2.0

func (UpstreamSortField) Prev added in v1.2.0

func (UpstreamSortField) String added in v1.2.0

func (s UpstreamSortField) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL