MetricCollectors¶
MetricCollectors allows aggregating metrics across registered MetricCollectors.
Creating Instance¶
MetricCollectors takes the following to be created:
MetricCollectors is created when:
KsqlContextis createdKsqlServerMainstandalone 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:
ConsumerCollectoris requested to configureProducerCollectoris requested to configureStreamsErrorCollectoris createdKsqlContextutility is used to create a KsqlContextKsqlEngineMetricsis createdQueryBuilderis requested to buildStreamsPropertiesKsqlRestApplicationutility is used to build a KsqlRestApplicationStandaloneExecutorFactoryis 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:
ConsumerCollectoris requested to configureProducerCollectoris requested to configureStreamsErrorCollectoris 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:
MetricCollectorsis requested for currentProductionRate, currentConsumptionRate, totalMessageConsumption, totalBytesConsumption
currentConsumptionRateByQuery¶
Collection<Double> currentConsumptionRateByQuery()
currentConsumptionRateByQuery...FIXME
currentConsumptionRateByQuery is used when:
KsqlEngineMetricsis requested to updateMetrics
currentErrorRate¶
double currentErrorRate()
currentErrorRate...FIXME
currentErrorRate is used when:
KsqlEngineMetricsis requested to updateMetrics
getStatsFor¶
Collection<TopicSensors.Stat> getStatsFor(
String topic,
boolean isError)
getStatsFor...FIXME
getStatsFor is used when:
MetricCollectorsis requested to getAndFormatStatsForSourceDescriptionFactoryis requested for aSourceDescription