MetricCollectors¶
MetricCollectors
allows aggregating metrics across registered MetricCollectors.
Creating Instance¶
MetricCollectors
takes the following to be created:
MetricCollectors
is created when:
KsqlContext
is createdKsqlServerMain
standalone application is launched (and creates an Executable)
Metrics¶
MetricCollectors
can be given a Metrics
(Apache Kafka) when created.
This Metrics
is configured to use JmxReporter
with io.confluent.ksql.metrics
JMX namespace.
Metrics
is used to register new metric reporters in addConfigurableReporter.
getMetrics¶
Metrics getMetrics()
getMetrics
returns the Metrics.
getMetrics
is used when:
ConsumerCollector
is requested to configureProducerCollector
is requested to configureStreamsErrorCollector
is createdKsqlContext
utility is used to create a KsqlContextKsqlEngineMetrics
is createdQueryBuilder
is requested to buildStreamsPropertiesKsqlRestApplication
utility is used to build a KsqlRestApplicationStandaloneExecutorFactory
is requested to create a StandaloneExecutor
MetricCollectors by ID¶
Map<String, MetricCollector> collectorMap
MetricCollectors
creates an empty collectorMap
registry of MetricCollectors by id when created.
A new MetricCollector is added to the collectorMap
registry in addCollector and removed in remove.
The MetricCollectors themselves in collectorMap
are used when:
Registering MetricCollector¶
String addCollector(
String id,
MetricCollector collector)
addCollector
...FIXME
addCollector
is used when:
ConsumerCollector
is requested to configureProducerCollector
is requested to configureStreamsErrorCollector
is used to create a StreamsErrorCollector
addConfigurableReporter¶
void addConfigurableReporter(
KsqlConfig ksqlConfig)
addConfigurableReporter
...FIXME
addConfigurableReporter
is used when:
aggregateStat¶
double aggregateStat(
String name,
boolean isError)
aggregateStat
sums up aggregateStats of all the registered MetricCollectors.
aggregateStat
is used when:
MetricCollectors
is requested for currentProductionRate, currentConsumptionRate, totalMessageConsumption, totalBytesConsumption
currentConsumptionRateByQuery¶
Collection<Double> currentConsumptionRateByQuery()
currentConsumptionRateByQuery
...FIXME
currentConsumptionRateByQuery
is used when:
KsqlEngineMetrics
is requested to updateMetrics
currentErrorRate¶
double currentErrorRate()
currentErrorRate
...FIXME
currentErrorRate
is used when:
KsqlEngineMetrics
is requested to updateMetrics
getStatsFor¶
Collection<TopicSensors.Stat> getStatsFor(
String topic,
boolean isError)
getStatsFor
...FIXME
getStatsFor
is used when:
MetricCollectors
is requested to getAndFormatStatsForSourceDescriptionFactory
is requested for aSourceDescription