func (t *Topic) AggregateChannelE2eProcessingLatency() *quantile.Quantile { var latencyStream *quantile.Quantile for _, c := range t.channelMap { if c.e2eProcessingLatencyStream == nil { continue } if latencyStream == nil { latencyStream = quantile.New( t.ctx.nsqd.getOpts().E2EProcessingLatencyWindowTime, t.ctx.nsqd.getOpts().E2EProcessingLatencyPercentiles) } latencyStream.Merge(c.e2eProcessingLatencyStream) } return latencyStream }
func (t *Topic) AggregateChannelE2eProcessingLatency() *quantile.Quantile { var latencyStream *quantile.Quantile t.RLock() realChannels := make([]*Channel, 0, len(t.channelMap)) for _, c := range t.channelMap { realChannels = append(realChannels, c) } t.RUnlock() for _, c := range realChannels { if c.e2eProcessingLatencyStream == nil { continue } if latencyStream == nil { latencyStream = quantile.New( t.ctx.nsqd.getOpts().E2EProcessingLatencyWindowTime, t.ctx.nsqd.getOpts().E2EProcessingLatencyPercentiles) } latencyStream.Merge(c.e2eProcessingLatencyStream) } return latencyStream }