Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MemoryStatistics ¶
type MemoryStatistics struct {
sync.Mutex
Alloc uint64 `json:"alloc"`
TotalAlloc uint64 `json:"totalAlloc"`
Sys uint64 `json:"sys"`
Lookups uint64 `json:"lookups"`
Mallocs uint64 `json:"mallocs"`
Frees uint64 `json:"frees"`
HeapAlloc uint64 `json:"heapAlloc"`
HeapSys uint64 `json:"heapSys"`
HeapIdle uint64 `json:"heapIdle"`
HeapInuse uint64 `json:"heapInuse"`
HeapReleased uint64 `json:"heapReleased"`
HeapObjects uint64 `json:"heapObjects"`
NumGC uint32 `json:"numGC"`
}
func (*MemoryStatistics) ToMap ¶
func (ms *MemoryStatistics) ToMap() map[string]interface{}
func (*MemoryStatistics) Update ¶
func (ms *MemoryStatistics) Update()
type MetricsManager ¶
type MetricsManager struct {
sync.RWMutex `json:"-"`
Segment analytics.Client `json:"-"`
Logger logrus.FieldLogger `json:"-"`
ID string `json:"id"`
UpTime int64 `json:"uptime"`
MemoryStatistics *MemoryStatistics `json:"memory"`
BuildVersion string `json:"buildVersion"`
BuildHash string `json:"buildHash"`
BuildTime string `json:"buildTime"`
InstanceID string `json:"instanceId"`
ServiceName string `json:"serviceName"`
// contains filtered or unexported fields
}
func NewMetricsManager ¶
func NewMetricsManager( id string, enable bool, writeKey string, whitelistedURLs []string, logger logrus.FieldLogger, serviceName string, sampling float64, endpoint string, ) *MetricsManager
func NewMetricsManagerWithConfig ¶
func NewMetricsManagerWithConfig( id string, enable bool, writeKey string, whitelistedURLs []string, logger logrus.FieldLogger, serviceName string, sampling float64, config analytics.Config, ) *MetricsManager
func (*MetricsManager) CommitMemoryStatistics ¶
func (sw *MetricsManager) CommitMemoryStatistics()
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)
Click to show internal directories.
Click to hide internal directories.