NewSample creates a new Sample initialized to the provided values. The nats.Conn information captured
(jobCount int, msgSize int, start, end time.Time, nc *nats.Conn)
| 144 | |
| 145 | // NewSample creates a new Sample initialized to the provided values. The nats.Conn information captured |
| 146 | func NewSample(jobCount int, msgSize int, start, end time.Time, nc *nats.Conn) *Sample { |
| 147 | s := Sample{JobMsgCnt: jobCount, Start: start, End: end} |
| 148 | s.MsgBytes = uint64(msgSize * jobCount) |
| 149 | s.MsgCnt = nc.OutMsgs + nc.InMsgs |
| 150 | s.IOBytes = nc.OutBytes + nc.InBytes |
| 151 | return &s |
| 152 | } |
| 153 | |
| 154 | // Throughput of bytes per second |
| 155 | func (s *Sample) Throughput() float64 { |
no outgoing calls