MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / metricTask

Method metricTask

pkg/controller/task.go:52–66  ·  view source on GitHub ↗
(opt *options.ControllerOptions)

Source from the content-addressed store, hash-verified

50}
51
52func (controller *Controller) metricTask(opt *options.ControllerOptions) {
53 taskID := id.GetTaskID()
54 logger := logs.NewLogger().WithField("metric_task_id", taskID)
55 interval := time.Duration(opt.MetricsTaskInterval) * time.Second
56 ticker := time.NewTicker(interval)
57 for {
58 select {
59 case <-ticker.C:
60 logger.Debug("start metric task")
61 controller.overallMetrics()
62 controller.runtimeMetrics(logger)
63 logger.Debug("finish metric task")
64 }
65 }
66}
67
68func (controller *Controller) resourceTask(logger *logs.Logger) {
69 logger.Info("start resource task")

Callers 1

InitFunction · 0.80

Calls 6

overallMetricsMethod · 0.95
runtimeMetricsMethod · 0.95
GetTaskIDFunction · 0.92
NewLoggerFunction · 0.92
WithFieldMethod · 0.80
DebugMethod · 0.80

Tested by

no test coverage detected