code: func (n *networkCounter) mergeCollectedData(packetsReceivedPerSecondData,
  	packetsSentPerSecondData,
  	bytesReceivedPerSecondData,
  	bytesSentPerSecondData,
  	packetsReceivedDiscardedData,
  	packetsReceivedErrorsData,
  	packetsOutboundDiscardedData,
  	packetsOutboundErrorsData map[string]uint64) {
  	adapters := sets.NewString()
  
  	// merge the collected data and list of adapters.
  	adapters.Insert(n.mergePacketsReceivedPerSecondData(packetsReceivedPerSecondData)...)
  	adapters.Insert(n.mergePacketsSentPerSecondData(packetsSentPerSecondData)...)
  	adapters.Insert(n.mergeBytesReceivedPerSecondData(bytesReceivedPerSecondData)...)
  	adapters.Insert(n.mergeBytesSentPerSecondData(bytesSentPerSecondData)...)
  	adapters.Insert(n.mergePacketsReceivedDiscardedData(packetsReceivedDiscardedData)...)
  	adapters.Insert(n.mergePacketsReceivedErrorsData(packetsReceivedErrorsData)...)
  	adapters.Insert(n.mergePacketsOutboundDiscardedData(packetsOutboundDiscardedData)...)
  	adapters.Insert(n.mergePacketsOutboundErrorsData(packetsOutboundErrorsData)...)
  
  	// delete the cache for non-existing adapters.
  	for adapter := range n.adapterStats {
  		if !adapters.Has(adapter) {
  			delete(n.adapterStats, adapter)
  		}
  	}
  }
docs: // mergeCollectedData merges the collected data into cache. It should be invoked under lock protected.