Ejemplo n.º 1
0
func (r *ReporterImpl) Report(report Report) {
	messagesPerSecond := float64(report.MessageCount) / r.secondsPerCycle
	percent := messagesPerSecond / float64(r.expectedMessagesPerSecond) * 100.0
	errorsPerSecond := float64(report.ErrorCount) / r.secondsPerCycle
	bytesPerSecond := utils.ByteSize(report.ByteCount) / utils.ByteSize(r.secondsPerCycle)
	ReporterLogger.Info("%8d messages/s (%6.2f%%), %8d errors/s, %s/s", uint64(messagesPerSecond), percent, uint64(errorsPerSecond), bytesPerSecond.String())
}
Ejemplo n.º 2
0
func (s *Scheme) outputReport() {
	bytesPerSec := utils.ByteSize(s.ByteCount()) * utils.ByteSize(time.Second) / utils.ByteSize(s.RunTime().Nanoseconds())
	messagesPerSec := float64(s.messagesPerRun) * float64(time.Second) / float64(s.RunTime().Nanoseconds())

	logs.Logger.Info("Byte count: %d", s.ByteCount())
	logs.Logger.Info("Rates: %s/s %.1f messages/s", bytesPerSec.String(), messagesPerSec)
	logs.Logger.Info("Error count: %d", s.ErrorCount())
	logs.Logger.Info("Run time: %s", s.RunTime().String())
	if s.FirstError() != nil {
		logs.Logger.Info("First error: %s", s.FirstError().Error())
	}
}