MCPcopy
hub / github.com/nats-io/nats.go / NewSample

Function NewSample

bench/bench.go:146–152  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

144
145// NewSample creates a new Sample initialized to the provided values. The nats.Conn information captured
146func 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
155func (s *Sample) Throughput() float64 {

Callers 3

runPublisherFunction · 0.92
runSubscriberFunction · 0.92

Calls

no outgoing calls

Tested by 1