Documentation ¶
Index ¶
- Constants
- func Delta(current, previous map[string]map[string]float64) map[string]map[string]float64
- func SendNginxDownStatus(ctx context.Context, dims []*proto.Dimension, m chan<- *proto.StatsEntity)
- type CPUTimes
- type ContainerCPU
- type ContainerMemory
- type Disk
- type DiskIO
- type Load
- type NetIO
- type NginxAccessLog
- type NginxErrorLog
- type NginxOSS
- type NginxPlus
- type NginxProcess
- type NginxStatic
- type NginxWorker
- type NginxWorkerClient
- type NginxWorkerCollector
- type Swap
- type VirtualMemory
- type WorkerStats
- type Workers
Constants ¶
View Source
const ( OSSNamespace = "nginx" PlusNamespace = "plus" SystemNamespace = "system" ContainerNamespace = "container" OSSNginxType = "oss" PlusNginxType = "plus" CpuGroup = "cpu" MemoryGroup = "mem" )
View Source
const ( ContainerCpuMetricsWarning = "Unable to collect %s.%s metrics, %v" CpuCoresMetricName = "cores" CpuPeriodMetricName = "period" CpuQuotaMetricName = "quota" CpuSetCoresMetricName = "set.cores" CpuThrottlingTimeMetricName = "throttling.time" CpuThrottlingThrottledMetricName = "throttling.throttled" CpuThrottlingPeriodsMetricName = "throttling.periods" CpuThrottlingPercentageMetricName = "throttling.percent" )
View Source
const ( ContainerMemoryMetricsWarning = "Unable to collect %s.%s metrics, %v" OutOfMemoryMetricName = "oom" OutOfMemoryKillMetricName = "oom.kill" )
View Source
const ( HttpRequestBufferedMetricName = "http.request.buffered" UpstreamResponseBufferedMetricName = "upstream.response.buffered" UpstreamRequestFailedMetricName = "upstream.request.failed" UpstreamResponseFailedMetricName = "upstream.response.failed" )
View Source
const MOUNT_POINT = "mount_point"
View Source
const NETWORK_INTERFACE = "network_interface"
Variables ¶
This section is empty.
Functions ¶
func SendNginxDownStatus ¶
Types ¶
type CPUTimes ¶
type CPUTimes struct {
// contains filtered or unexported fields
}
func NewCPUTimesSource ¶
func NewCPUTimesSource(namespace string, env core.Environment) *CPUTimes
type ContainerCPU ¶
type ContainerCPU struct {
// contains filtered or unexported fields
}
func NewContainerCPUSource ¶
func NewContainerCPUSource(namespace string, basePath string) *ContainerCPU
func (*ContainerCPU) Collect ¶
func (c *ContainerCPU) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity)
type ContainerMemory ¶
type ContainerMemory struct {
// contains filtered or unexported fields
}
func NewContainerMemorySource ¶
func NewContainerMemorySource(namespace string, basePath string) *ContainerMemory
func (*ContainerMemory) Collect ¶
func (c *ContainerMemory) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity)
type DiskIO ¶
type DiskIO struct {
// contains filtered or unexported fields
}
func NewDiskIOSource ¶
func NewDiskIOSource(namespace string, env core.Environment) *DiskIO
type NetIO ¶
type NetIO struct {
// contains filtered or unexported fields
}
func NewNetIOSource ¶
func NewNetIOSource(namespace string, env core.Environment) *NetIO
type NginxAccessLog ¶
type NginxAccessLog struct {
// contains filtered or unexported fields
}
func NewNginxAccessLog ¶
func NewNginxAccessLog( baseDimensions *metrics.CommonDim, namespace string, binary core.NginxBinary, nginxType string, collectionInterval time.Duration) *NginxAccessLog
func (*NginxAccessLog) Collect ¶
func (c *NginxAccessLog) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity)
func (*NginxAccessLog) Stop ¶
func (c *NginxAccessLog) Stop()
func (*NginxAccessLog) Update ¶
func (c *NginxAccessLog) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxErrorLog ¶
type NginxErrorLog struct {
// contains filtered or unexported fields
}
func NewNginxErrorLog ¶
func NewNginxErrorLog( baseDimensions *metrics.CommonDim, namespace string, binary core.NginxBinary, nginxType string, collectionInterval time.Duration) *NginxErrorLog
func (*NginxErrorLog) Collect ¶
func (c *NginxErrorLog) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity)
func (*NginxErrorLog) Stop ¶
func (c *NginxErrorLog) Stop()
func (*NginxErrorLog) Update ¶
func (c *NginxErrorLog) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxOSS ¶
type NginxOSS struct {
// contains filtered or unexported fields
}
func NewNginxOSS ¶
type NginxPlus ¶
type NginxPlus struct {
// contains filtered or unexported fields
}
NginxPlus generates metrics from NGINX Plus API
func NewNginxPlus ¶
type NginxProcess ¶
type NginxProcess struct {
// contains filtered or unexported fields
}
func NewNginxProcess ¶
func NewNginxProcess(baseDimensions *metrics.CommonDim, namespace string, binary core.NginxBinary) *NginxProcess
NewNginxProc collects metrics about nginx and nginx child processes
func (*NginxProcess) Collect ¶
func (c *NginxProcess) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity)
func (*NginxProcess) Stop ¶
func (c *NginxProcess) Stop()
func (*NginxProcess) Update ¶
func (c *NginxProcess) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxStatic ¶
type NginxStatic struct {
// contains filtered or unexported fields
}
func NewNginxStatic ¶
func NewNginxStatic(baseDimensions *metrics.CommonDim, namespace string) *NginxStatic
This is to output a static "nginx.status = 0" metric if NGINX is not running or detected or NGINX Plus API or stub_status API is not setup properly.
func (*NginxStatic) Collect ¶
func (c *NginxStatic) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity)
func (*NginxStatic) Stop ¶
func (c *NginxStatic) Stop()
func (*NginxStatic) Update ¶
func (c *NginxStatic) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxWorker ¶
type NginxWorker struct {
// contains filtered or unexported fields
}
func NewNginxWorker ¶
func NewNginxWorker(baseDimensions *metrics.CommonDim, namespace string, binary core.NginxBinary, collector NginxWorkerCollector) *NginxWorker
NewNginxWorker collects metrics about nginx child processes
func (*NginxWorker) Collect ¶
func (c *NginxWorker) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity)
func (*NginxWorker) Stop ¶
func (c *NginxWorker) Stop()
func (*NginxWorker) Update ¶
func (c *NginxWorker) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxWorkerClient ¶
type NginxWorkerClient struct{}
NginxWorkerClient allows you to fetch NGINX worker metrics from psutil via the PID of the master procs it implements an interface that we can mock for testing
func (*NginxWorkerClient) GetWorkerStats ¶
func (client *NginxWorkerClient) GetWorkerStats(childProcs []*proto.NginxDetails) (*WorkerStats, error)
GetWorkerStats fetches the nginx master & worker metrics from psutil.
type NginxWorkerCollector ¶
type NginxWorkerCollector interface {
GetWorkerStats(childProcs []*proto.NginxDetails) (*WorkerStats, error)
}
func NewNginxWorkerClient ¶
func NewNginxWorkerClient() NginxWorkerCollector
type Swap ¶
type Swap struct {
// contains filtered or unexported fields
}
func NewSwapSource ¶
func NewSwapSource(namespace string, env core.Environment) *Swap
type VirtualMemory ¶
type VirtualMemory struct {
// contains filtered or unexported fields
}
func NewVirtualMemorySource ¶
func NewVirtualMemorySource(namespace string, env core.Environment) *VirtualMemory
func (*VirtualMemory) Collect ¶
func (c *VirtualMemory) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity)
type WorkerStats ¶
type WorkerStats struct {
Workers *Workers
}
WorkerStats represents NGINX worker metrics
Source Files ¶
Click to show internal directories.
Click to hide internal directories.