Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectedData ¶
type CollectedData struct {
Name string `json:"name"`
CollectionTime int64 `json:"collection_time"`
Data interface{} `json:"data"`
Save bool `json:"-"` //Ignores this attribute while marshalling
}
CollectedData holds the data that is collected
func NewCollectedData ¶
func NewCollectedData(name string, data interface{}) *CollectedData
NewCollectedData returns an instance of the CollectedData struct
type CollectorAPI ¶
type CollectorAPI struct {
LinuxMonitors []LinuxMonitor
}
CollectorAPI is responsible for data collection in the server
func GetcollectorAPI ¶
func GetcollectorAPI() *CollectorAPI
GetcollectorAPI can be invoked from other packages for fetching an instance of the collectorAPI
func (*CollectorAPI) Initialize ¶
func (collectorAPI *CollectorAPI) Initialize()
Initialize is responsible loading the data collection metrics from the linux_monitors.json and initialzing the collectorAPI
func (*CollectorAPI) ParseAndSave ¶
func (collectorAPI *CollectorAPI) ParseAndSave(serverMonJob *ServerMonitoringJob)
ParseAndSave is responsible for parsing and saving the collected data
func (*CollectorAPI) ScheduleDataCollection ¶
func (collectorAPI *CollectorAPI) ScheduleDataCollection()
ScheduleDataCollection is responsible for scheduling the metrics defined in linux_monitors.json based on the time interval configured.
type LinuxMonitor ¶
type LinuxMonitor struct {
Name string `json:"name"`
Script bool `json:"script"`
Command string `json:"command"`
CommandArgs string `json:"command_args"`
Interval int `json:"interval"`
KeyValue bool `json:"key_value"`
ParseAllLine bool `json:"parse_all_line"`
ParseImpl string `json:"parse_impl"`
ParseConfig []ParseConfiguration `json:"parse_config"`
}
LinuxMonitor holds all the attributes related to the data collection of metrics like CPU utilization, disk utilization, memory utilization etc.
type ParseConfiguration ¶
type ParseConfiguration struct {
MetricName string `json:"metric_name"`
ParseLine int `json:"parse_line"`
Delimiter string `json:"delimiter"`
Token int `json:"token"`
Counter bool `json:"counter"`
Expression string `json:"expression"`
}
ParseConfiguration holds the attributes defined in the linux_monitors.json that are necessary for parsing the collected data.
type ServerMonitoringJob ¶
type ServerMonitoringJob struct {
ID int
MonitorConfig LinuxMonitor
ResultData *routinepool.JobResult
}
ServerMonitoringJob represents the details of the job that has been scheduled
func (*ServerMonitoringJob) DoJob ¶
func (serverMonJob *ServerMonitoringJob) DoJob(routinePool *routinepool.RoutinePool)
DoJob implements Job interface's DoJob(routinePool *routinepool.RoutinePool) defined in routinepool.go This method will be called in WorkRoutine's safelyDoWork method
func (*ServerMonitoringJob) GetID ¶
func (serverMonJob *ServerMonitoringJob) GetID() int
GetID uniquely identifies the ServerMonitoringJob