Documentation ¶
Index ¶
- type HTTPMetrics
- func (h *HTTPMetrics) AddMethodRequest(method string)
- func (h *HTTPMetrics) AddMethodResponse(method string)
- func (h *HTTPMetrics) AddSize(size int)
- func (h *HTTPMetrics) AddStatus(status int)
- func (h *HTTPMetrics) MethodMetrics(method string) *Metrics
- func (h *HTTPMetrics) SizeMetrics(size int) *Metrics
- func (h *HTTPMetrics) StatusMetrics(status int) *Metrics
- type Metrics
- type MetricsManager
- func (sw *MetricsManager) CommitTelemetry()
- func (sw *MetricsManager) RegisterSegment(version, hash, buildTime string)
- func (sw *MetricsManager) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (sw *MetricsManager) TickKeepAlive()
- func (sw *MetricsManager) UpdateUpTime()
- type PathMetrics
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPMetrics ¶
type HTTPMetrics struct { Methods map[string]*Metrics `json:"methods"` Status map[int]*Metrics `json:"status"` Sizes map[int]*Metrics `json:"sizes"` }
func (*HTTPMetrics) AddMethodRequest ¶
func (h *HTTPMetrics) AddMethodRequest(method string)
func (*HTTPMetrics) AddMethodResponse ¶
func (h *HTTPMetrics) AddMethodResponse(method string)
func (*HTTPMetrics) AddSize ¶
func (h *HTTPMetrics) AddSize(size int)
func (*HTTPMetrics) AddStatus ¶
func (h *HTTPMetrics) AddStatus(status int)
func (*HTTPMetrics) MethodMetrics ¶
func (h *HTTPMetrics) MethodMetrics(method string) *Metrics
func (*HTTPMetrics) SizeMetrics ¶
func (h *HTTPMetrics) SizeMetrics(size int) *Metrics
func (*HTTPMetrics) StatusMetrics ¶
func (h *HTTPMetrics) StatusMetrics(status int) *Metrics
type Metrics ¶
type Metrics struct { Requests uint64 `json:"requests,omitempty"` Responses uint64 `json:"responses,omitempty"` Latencies map[int64]int `json:"latencies,omitempty"` }
func (*Metrics) AddLatency ¶
func (*Metrics) AddRequest ¶
func (h *Metrics) AddRequest()
func (*Metrics) AddResponse ¶
func (h *Metrics) AddResponse()
type MetricsManager ¶
type MetricsManager struct { sync.RWMutex `json:"-"` ID string `json:"id"` UpTime int64 `json:"uptime"` *Snapshot Segment *analytics.Client `json:"-"` Logger logrus.FieldLogger `json:"-"` // contains filtered or unexported fields }
func NewMetricsManager ¶
func NewMetricsManager(l logrus.FieldLogger) *MetricsManager
func (*MetricsManager) CommitTelemetry ¶
func (sw *MetricsManager) CommitTelemetry()
func (*MetricsManager) RegisterSegment ¶
func (sw *MetricsManager) RegisterSegment(version, hash, buildTime string)
func (*MetricsManager) ServeHTTP ¶
func (sw *MetricsManager) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*MetricsManager) TickKeepAlive ¶
func (sw *MetricsManager) TickKeepAlive()
func (*MetricsManager) UpdateUpTime ¶
func (sw *MetricsManager) UpdateUpTime()
type PathMetrics ¶
type PathMetrics struct { *Metrics *HTTPMetrics }
type Snapshot ¶
type Snapshot struct { *Metrics *HTTPMetrics Paths map[string]*PathMetrics `json:"paths"` }
func (*Snapshot) Path ¶
func (s *Snapshot) Path(path string) *PathMetrics
Click to show internal directories.
Click to hide internal directories.