(rb protocolBody)
| 1898 | } |
| 1899 | |
| 1900 | func (b *Broker) updateProtocolMetrics(rb protocolBody) { |
| 1901 | protocolRequestsRate := b.protocolRequestsRate[rb.key()] |
| 1902 | if protocolRequestsRate == nil { |
| 1903 | protocolRequestsRate = metrics.GetOrRegisterMeter(fmt.Sprintf("protocol-requests-rate-%d", rb.key()), b.metricRegistry) |
| 1904 | b.protocolRequestsRate[rb.key()] = protocolRequestsRate |
| 1905 | } |
| 1906 | protocolRequestsRate.Mark(1) |
| 1907 | |
| 1908 | if b.brokerProtocolRequestsRate != nil { |
| 1909 | brokerProtocolRequestsRate := b.brokerProtocolRequestsRate[rb.key()] |
| 1910 | if brokerProtocolRequestsRate == nil { |
| 1911 | brokerProtocolRequestsRate = b.registerMeter(fmt.Sprintf("protocol-requests-rate-%d", rb.key())) |
| 1912 | b.brokerProtocolRequestsRate[rb.key()] = brokerProtocolRequestsRate |
| 1913 | } |
| 1914 | brokerProtocolRequestsRate.Mark(1) |
| 1915 | } |
| 1916 | } |
| 1917 | |
| 1918 | type throttleSupport interface { |
| 1919 | throttleTime() time.Duration |
no test coverage detected