Package zipkin2.collector
Class InMemoryCollectorMetrics
- java.lang.Object
-
- zipkin2.collector.InMemoryCollectorMetrics
-
- All Implemented Interfaces:
CollectorMetrics
public final class InMemoryCollectorMetrics extends java.lang.Object implements CollectorMetrics
-
-
Field Summary
-
Fields inherited from interface zipkin2.collector.CollectorMetrics
NOOP_METRICS
-
-
Constructor Summary
Constructors Constructor Description InMemoryCollectorMetrics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
bytes()
void
clear()
InMemoryCollectorMetrics
forTransport(java.lang.String transportType)
Those who wish to partition metrics by transport can call this method to include the transport type in the backend metric key.void
incrementBytes(int quantity)
Increments the number of bytes containing serialized spans in a message.void
incrementMessages()
Increments count of messages received, which contain 0 or more spans.void
incrementMessagesDropped()
Increments count of messages that could not be read.void
incrementSpans(int quantity)
Increments the count of spans read from a successful message.void
incrementSpansDropped(int quantity)
Increments the count of spans dropped for any reason.int
messages()
int
messagesDropped()
int
spans()
int
spansDropped()
-
-
-
Method Detail
-
forTransport
public InMemoryCollectorMetrics forTransport(java.lang.String transportType)
Description copied from interface:CollectorMetrics
Those who wish to partition metrics by transport can call this method to include the transport type in the backend metric key.For example, an implementation may by default report
incremented spans
to the key "zipkin.collector.span.accepted". Whenmetrics.forTransport("kafka"
is called, the counter would report to "zipkin.collector.kafka.span.accepted"- Specified by:
forTransport
in interfaceCollectorMetrics
- Parameters:
transportType
- ex "http", "rabbitmq", "kafka"
-
incrementMessages
public void incrementMessages()
Description copied from interface:CollectorMetrics
Increments count of messages received, which contain 0 or more spans. Ex POST requests or Kafka messages consumed.- Specified by:
incrementMessages
in interfaceCollectorMetrics
-
messages
public int messages()
-
incrementMessagesDropped
public void incrementMessagesDropped()
Description copied from interface:CollectorMetrics
Increments count of messages that could not be read. Ex malformed content, or peer disconnect.- Specified by:
incrementMessagesDropped
in interfaceCollectorMetrics
-
messagesDropped
public int messagesDropped()
-
incrementBytes
public void incrementBytes(int quantity)
Description copied from interface:CollectorMetrics
Increments the number of bytes containing serialized spans in a message.Note: this count should relate to the raw data structures, like json or thrift, and discount compression, enveloping, etc.
- Specified by:
incrementBytes
in interfaceCollectorMetrics
-
bytes
public int bytes()
-
incrementSpans
public void incrementSpans(int quantity)
Description copied from interface:CollectorMetrics
Increments the count of spans read from a successful message. When bundling is used, accepted spans will be a larger number than successful messages.- Specified by:
incrementSpans
in interfaceCollectorMetrics
-
spans
public int spans()
-
incrementSpansDropped
public void incrementSpansDropped(int quantity)
Description copied from interface:CollectorMetrics
Increments the count of spans dropped for any reason. For example, failure queueing to storage or sampling decisions.- Specified by:
incrementSpansDropped
in interfaceCollectorMetrics
-
spansDropped
public int spansDropped()
-
clear
public void clear()
-
-