Documentation
¶
Index ¶
- type AgentMessageParser
- type ClustersApcuStatuses
- type ClustersOpcacheStatuses
- type InternedStingsMemory
- type KeyHits
- type Keys
- type Memory
- type MetricSenderInterface
- type NodeApcuSetting
- type NodeApcuSmaInfo
- type NodeApcuStatus
- type NodeOpcacheStatus
- type NodeStatistics
- type Observer
- func (o *Observer) AddMetricSender(metricSender MetricSenderInterface)
- func (o *Observer) GetApcuStatistics() ClustersApcuStatuses
- func (o *Observer) GetOpcacheStatistics() ClustersOpcacheStatuses
- func (o *Observer) PullAgents()
- func (o *Observer) ResetOpcache(clusterName string, groupName string, hostName string) error
- func (o *Observer) StartPulling(refreshIntervalNanoSeconds int64)
- func (o *Observer) StopPulling()
- type Restarts
- type Script
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentMessageParser ¶
type AgentMessageParser struct { }
AgentMessageParser implements parsing of agent response
func (AgentMessageParser) Parse ¶
func (parser AgentMessageParser) Parse(body []byte) (*NodeStatistics, error)
Parse agent response to struct
type ClustersApcuStatuses ¶
type ClustersApcuStatuses map[string]map[string]map[string]NodeApcuStatus
type ClustersOpcacheStatuses ¶
type ClustersOpcacheStatuses map[string]map[string]map[string]NodeOpcacheStatus
ClustersOpcacheStatuses represents collection of node opcache statuses Struct: {clusterName}.{groupName}.{nodeName} => NodeOpcacheStatus
type InternedStingsMemory ¶
type InternedStingsMemory struct { Total int // configuration.directives.opcache.interned_strings_buffer BufferSize int // status.interned_strings_usage.buffer_size UsedMemory int // status.interned_strings_usage.used_memory FreeMemory int // status.interned_strings_usage.free_memory NumOfStrings int // status.interned_strings_usage.number_of_strings }
type Keys ¶
type Keys struct { Total int // configuration.directives.opcache.max_accelerated_files, The maximum number of keys (and therefore scripts) in the OPcache hash table TotalPrime int // status.opcache_statistics.max_cached_keys UsedKeys int // status.opcache_statistics.num_cached_keys UsedScripts int // status.opcache_statistics.num_cached_scripts Free int // may be defined as TotalPrime-UsedKeys }
type Memory ¶
type Memory struct { Total int // configuration.directives.opcache.memory_consumption Used int // status.memory_usage.used_memory Free int // status.memory_usage.free_memory Wasted int // status.memory_usage.wasted_memory MaxWastedPercentage float64 // configuration.directives.opcache.max_wasted_percentage CurrentWastedPercentage float64 // status.memory_usage.current_wasted_percentage }
type MetricSenderInterface ¶
type MetricSenderInterface interface { Send( clusterName string, groupName string, hostName string, nodeStatistics NodeStatistics, ) }
type NodeApcuSetting ¶
type NodeApcuSmaInfo ¶
type NodeApcuStatus ¶
type NodeApcuStatus struct { Enabled bool SmaInfo *NodeApcuSmaInfo Settings *map[string]NodeApcuSetting }
type NodeOpcacheStatus ¶
type NodeOpcacheStatus struct { Configuration map[string]interface{} PHPVersion string // configuration.version.version Scripts map[string]Script Optimizations []int //configuration.directives.opcache.optimization_level StartTime int64 // status.opcache_statistics.start_time // If cache_full is true and num_cached_keys equals max_cached_keys then there are too many files. // No restart will be triggered. As a result there are scripts that don't get cached, // even though there might be memory available. CacheFull bool // status.cache_full Memory Memory InternedStingsMemory InternedStingsMemory Keys Keys KeyHits KeyHits Restarts Restarts }
NodeOpcacheStatus represents status of opcache on single node
type NodeStatistics ¶
type NodeStatistics struct { OpcacheStatistics NodeOpcacheStatus ApcuStatistics NodeApcuStatus }
type Observer ¶
type Observer struct { Clusters map[string]configuration.ClusterConfig LastStatusUpdate time.Time // contains filtered or unexported fields }
Observer periodically reads status of observable nodes and aggregates received data
func NewObserver ¶
func NewObserver(clusters map[string]configuration.ClusterConfig) *Observer
func (*Observer) AddMetricSender ¶
func (o *Observer) AddMetricSender(metricSender MetricSenderInterface)
func (*Observer) GetApcuStatistics ¶
func (o *Observer) GetApcuStatistics() ClustersApcuStatuses
GetApcuStatistics returns pulled APCu statuses for all clusters
func (*Observer) GetOpcacheStatistics ¶
func (o *Observer) GetOpcacheStatistics() ClustersOpcacheStatuses
GetOpcacheStatistics returns pulled opcache statuses for all clusters
func (*Observer) PullAgents ¶
func (o *Observer) PullAgents()
PullAgents fetches data from all agents and store it to internal struct
func (*Observer) ResetOpcache ¶
func (*Observer) StartPulling ¶
StartPulling observing of configured nodes
type Restarts ¶
type Restarts struct { // Restarts occured when: // - wasted scripts > "opcache.max_wasted_percentage" // - "status.opcache_statistics.num_cached_scripts" > "opcache.max_accelerated_files" OutOfMemoryCount int // status.opcache_statistics.oom_restarts HashCount int // status.opcache_statistics.hash_restarts ManualCount int // status.opcache_statistics.manual_restarts LastRestartTime int64 // status.opcache_statistics.last_restart_time }
Click to show internal directories.
Click to hide internal directories.