2015-12-19 00:54:02 +00:00
|
|
|
package supervisor
|
|
|
|
|
|
|
|
import "github.com/rcrowley/go-metrics"
|
|
|
|
|
|
|
|
var (
|
2016-06-03 22:00:49 +00:00
|
|
|
// ContainerCreateTimer holds the metrics timer associated with container creation
|
|
|
|
ContainerCreateTimer = metrics.NewTimer()
|
|
|
|
// ContainerDeleteTimer holds the metrics timer associated with container deletion
|
|
|
|
ContainerDeleteTimer = metrics.NewTimer()
|
|
|
|
// ContainerStartTimer holds the metrics timer associated with container start duration
|
|
|
|
ContainerStartTimer = metrics.NewTimer()
|
|
|
|
// ContainerStatsTimer holds the metrics timer associated with container stats generation
|
|
|
|
ContainerStatsTimer = metrics.NewTimer()
|
|
|
|
// ContainersCounter keeps track of the number of active containers
|
|
|
|
ContainersCounter = metrics.NewCounter()
|
|
|
|
// EventSubscriberCounter keeps track of the number of active event subscribers
|
2015-12-19 00:54:02 +00:00
|
|
|
EventSubscriberCounter = metrics.NewCounter()
|
2016-06-03 22:00:49 +00:00
|
|
|
// TasksCounter keeps track of the number of active supervisor tasks
|
|
|
|
TasksCounter = metrics.NewCounter()
|
|
|
|
// ExecProcessTimer holds the metrics timer associated with container exec
|
|
|
|
ExecProcessTimer = metrics.NewTimer()
|
|
|
|
// ExitProcessTimer holds the metrics timer associated with reporting container exit status
|
|
|
|
ExitProcessTimer = metrics.NewTimer()
|
|
|
|
// EpollFdCounter keeps trac of how many process are being monitored
|
|
|
|
EpollFdCounter = metrics.NewCounter()
|
2015-12-19 00:54:02 +00:00
|
|
|
)
|
|
|
|
|
2016-06-03 22:00:49 +00:00
|
|
|
// Metrics return the list of all available metrics
|
2015-12-19 00:54:02 +00:00
|
|
|
func Metrics() map[string]interface{} {
|
|
|
|
return map[string]interface{}{
|
|
|
|
"container-create-time": ContainerCreateTimer,
|
|
|
|
"container-delete-time": ContainerDeleteTimer,
|
|
|
|
"container-start-time": ContainerStartTimer,
|
2016-02-11 22:36:32 +00:00
|
|
|
"container-stats-time": ContainerStatsTimer,
|
2015-12-19 00:54:02 +00:00
|
|
|
"containers": ContainersCounter,
|
|
|
|
"event-subscribers": EventSubscriberCounter,
|
2016-02-12 01:26:24 +00:00
|
|
|
"tasks": TasksCounter,
|
2015-12-19 00:54:02 +00:00
|
|
|
"exec-process-time": ExecProcessTimer,
|
|
|
|
"exit-process-time": ExitProcessTimer,
|
2016-02-01 19:02:41 +00:00
|
|
|
"epoll-fds": EpollFdCounter,
|
2015-12-19 00:54:02 +00:00
|
|
|
}
|
|
|
|
}
|