beyond-bitswap icon indicating copy to clipboard operation
beyond-bitswap copied to clipboard

Refactor emitMetrics function

Open adlrocha opened this issue 5 years ago • 0 comments

This function is a nightmare and needs to be cleaned!

func (n *IPFSNode) EmitMetrics(runenv *runtime.RunEnv, runNum int, seq int64, grpseq int64,
	latency time.Duration, bandwidthMB int, fileSize int, nodetp NodeType, tpindex int, timeToFetch int64, tcpFetch int64, leechFails int64) error

Create a NodeMetrics struct to track all the metrics for a node. Already tested the approach but I chose to leave it for when the full code is refactores and working.

type NodeMetrics struct {
   TimeToFetch int64
   TCPFetch int64
   LeechFails int64
}

adlrocha avatar Aug 26 '20 09:08 adlrocha