code: func (s DeviceSession) GetPacketLossPercentage() float64 {
  	if len(s.UplinkHistory) < UplinkHistorySize {
  		return 0
  	}
  
  	var lostPackets uint32
  	var previousFCnt uint32
  
  	for i, uh := range s.UplinkHistory {
  		if i == 0 {
  			previousFCnt = uh.FCnt
  			continue
  		}
  		lostPackets += uh.FCnt - previousFCnt - 1 // there is always an expected difference of 1
  		previousFCnt = uh.FCnt
  	}
  
  	return float64(lostPackets) / float64(len(s.UplinkHistory)) * 100
  }
docs: // GetPacketLossPercentage returns the percentage of packet-loss over the
  // records stored in UplinkHistory.
  // Note it returns 0 when the uplink history table hasn't been filled yet
  // to avoid reporting 33% for example when one of the first three uplinks
  // was lost.