metrics.go 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. package supervisor
  2. import "github.com/rcrowley/go-metrics"
  3. var (
  4. ContainerCreateTimer = metrics.NewTimer()
  5. ContainerDeleteTimer = metrics.NewTimer()
  6. ContainerStartTimer = metrics.NewTimer()
  7. ContainerStatsTimer = metrics.NewTimer()
  8. ContainersCounter = metrics.NewCounter()
  9. EventSubscriberCounter = metrics.NewCounter()
  10. TasksCounter = metrics.NewCounter()
  11. ExecProcessTimer = metrics.NewTimer()
  12. ExitProcessTimer = metrics.NewTimer()
  13. EpollFdCounter = metrics.NewCounter()
  14. )
  15. func Metrics() map[string]interface{} {
  16. return map[string]interface{}{
  17. "container-create-time": ContainerCreateTimer,
  18. "container-delete-time": ContainerDeleteTimer,
  19. "container-start-time": ContainerStartTimer,
  20. "container-stats-time": ContainerStatsTimer,
  21. "containers": ContainersCounter,
  22. "event-subscribers": EventSubscriberCounter,
  23. "tasks": TasksCounter,
  24. "exec-process-time": ExecProcessTimer,
  25. "exit-process-time": ExitProcessTimer,
  26. "epoll-fds": EpollFdCounter,
  27. }
  28. }