Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Gather ¶ added in v1.1.0
func Gather() []*dto.MetricFamily
func MustParseRequestID ¶
func NewContext ¶
func NewContext(ctx context.Context, metric *RequestMetric) context.Context
Types ¶
type CounterSmoother ¶ added in v1.1.0
type CounterSmoother struct {
Alpha float64
// contains filtered or unexported fields
}
func (*CounterSmoother) Update ¶ added in v1.1.0
func (s *CounterSmoother) Update(currentTotal float64) float64
type RequestMetric ¶
type RequestMetric struct {
StartAt time.Time
RequestID string
RecvReq uint64
SentResp uint64
StoreUrl string
CacheStatus string
RemoteAddr string
FirstResponseTime time.Time
}
func FromContext ¶
func FromContext(ctx context.Context) *RequestMetric
func WithRequestMetric ¶
func WithRequestMetric(req *http.Request) (*http.Request, *RequestMetric)
func (*RequestMetric) Clone ¶
func (r *RequestMetric) Clone() *RequestMetric
type RequestsCodeTotal ¶ added in v1.1.0
func CollectorRequestsCodeTotal ¶ added in v1.1.0
func CollectorRequestsCodeTotal() []*RequestsCodeTotal
Click to show internal directories.
Click to hide internal directories.