func (p *criStatsProvider) listContainerNetworkStats() (map[string]*statsapi.NetworkStats, error) {
	containers, err := hcsshim.GetContainers(hcsshim.ComputeSystemQuery{
		Types: []string{"Container"},
	})
	if err != nil {
		return nil, err
	}

	stats := make(map[string]*statsapi.NetworkStats)
	for _, c := range containers {
		cstats, err := fetchContainerStats(c)
		if err != nil {
			klog.V(4).Infof("Failed to fetch statistics for container %q with error '%v', continue to get stats for other containers", c.ID, err)
			continue
		}
		if len(cstats.Network) > 0 {
			stats[c.ID] = hcsStatsToNetworkStats(cstats.Timestamp, cstats.Network)
		}
	}

	return stats, nil
}
// listContainerNetworkStats returns the network stats of all the running containers.
listContainerNetworkStats returns the network stats of all the running containers.
// listContainerNetworkStats returns the network stats of all the running containers .
func (p *criStatsProvider) listContainerNetworkStats() (map[string]*statsapi.NetworkStats, error) {
	containers, err := hcsshim.GetContainers(hcsshim.ComputeSystemQuery{
		Types: []string{"Container"},
	})
	if err != nil {
		return nil, err
	}
	stats := make(map[string]*statsapi.NetworkStats)
	for _, c := range containers {
		cstats, err := fetchContainerStats(c)
		if err != nil {
			klog.V(4).Infof("Failed to fetch statistics for container %q with error '%v', continue to get stats for other containers", c.ID, err)
			continue
		}
		if len(cstats.Network) > 0 {
			stats[c.ID] = hcsStatsToNetworkStats(cstats.Timestamp, cstats.Network)
		}
	}
	return stats, nil
}
func ( p * criStatsProvider ) listContainerNetworkStats ( ) ( map [ string ] * statsapi . NetworkStats , error ) { containers , err := hcsshim . GetContainers ( hcsshim . ComputeSystemQuery { Types : [ ] string { " " } , } ) if err != nil { return nil , err } stats := make ( map [ string ] * statsapi . NetworkStats ) for _ , c := range containers { cstats , err := fetchContainerStats ( c ) if err != nil { klog . V ( 4 ) . Infof ( " " , c . ID , err ) continue } if len ( cstats . Network ) > 0 { stats [ c . ID ] = hcsStatsToNetworkStats ( cstats . Timestamp , cstats . Network ) } } return stats , nil }
listContainerNetworkStats returns the network stats of all the running containers.
listContainerNetworkStats returns the network stats of all the running containers .