// Fetch returns a list of docker CPU stats. func (m *MetricSet) Fetch() ([]common.MapStr, error) { stats, err := docker.FetchStats(m.dockerClient) if err != nil { return nil, err } formattedStats := m.cpuService.getCPUStatsList(stats) return eventsMapping(formattedStats), nil }
// Fetch creates a list of memory events for each container. func (m *MetricSet) Fetch() ([]common.MapStr, error) { stats, err := docker.FetchStats(m.dockerClient) if err != nil { return nil, err } memoryStats := m.memoryService.getMemoryStatsList(stats) return eventsMapping(memoryStats), nil }
// Fetch methods creates a list of network events for each container. func (m *MetricSet) Fetch() ([]common.MapStr, error) { stats, err := docker.FetchStats(m.dockerClient) if err != nil { return nil, err } formattedStats := m.netService.getNetworkStatsPerContainer(stats) return eventsMapping(formattedStats), nil }