MCPcopy
hub / github.com/IBM/sarama / updateIncomingCommunicationMetrics

Method updateIncomingCommunicationMetrics

broker.go:1844–1862  ·  view source on GitHub ↗
(bytes int, requestLatency time.Duration)

Source from the content-addressed store, hash-verified

1842}
1843
1844func (b *Broker) updateIncomingCommunicationMetrics(bytes int, requestLatency time.Duration) {
1845 b.updateRequestLatencyAndInFlightMetrics(requestLatency)
1846 b.responseRate.Mark(1)
1847
1848 if b.brokerResponseRate != nil {
1849 b.brokerResponseRate.Mark(1)
1850 }
1851
1852 responseSize := int64(bytes)
1853 b.incomingByteRate.Mark(responseSize)
1854 if b.brokerIncomingByteRate != nil {
1855 b.brokerIncomingByteRate.Mark(responseSize)
1856 }
1857
1858 b.responseSize.Update(responseSize)
1859 if b.brokerResponseSize != nil {
1860 b.brokerResponseSize.Update(responseSize)
1861 }
1862}
1863
1864func (b *Broker) updateRequestLatencyAndInFlightMetrics(requestLatency time.Duration) {
1865 requestLatencyInMs := int64(requestLatency / time.Millisecond)

Callers 6

responseReceiverMethod · 0.95
AuthorizeMethod · 0.80

Tested by

no test coverage detected