github.com/aergoio/aergo@v1.3.1/p2p/metric/datametric.go (about)

     1  /*
     2   * @file
     3   * @copyright defined in aergo/LICENSE.txt
     4   */
     5  
     6  package metric
     7  
     8  // DataMetric hold data transfer of a peer. It shows eventually consistent aps and load score.
     9  type DataMetric interface {
    10  	// APS shows average bytes per second in a given period
    11  	APS() int64
    12  	// LoadScore is calulated value of network load.
    13  	LoadScore() int64
    14  	// add bytes transferred
    15  	AddBytes(byteSize int)
    16  	// Calculate should be called peridically with exact interval and a single thread
    17  	Calculate()
    18  }