-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service Factory + Individual Services' Factory Implementations #257
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Andrew Choi <[email protected]>
Signed-off-by: Andrew Choi <[email protected]>
…to andchoi_ServiceFactory
andrewchoi5
pushed a commit
that referenced
this pull request
Jun 2, 2020
…rameters. Ensure KafkaMetricsReporterSerivce carries the correct constructor parameters. Abstract out the helper methods with constructorContainsClass The way Service Instantiations are done within Kafka Monitor will be updated with #257. testing: produce.treat.zero.throughput.as.unavailable = true topic = kafka-monitor-topic1 zookeeper.connect = localhost:2181 (com.linkedin.kmf.services.configs.ProduceServiceConfig) [2020-05-29 14:34:57,457] INFO produce-service/ProduceService is initialized. (com.linkedin.kmf.services.ProduceService) [2020-05-29 14:34:57,468] INFO KafkaMetricsReporterServiceConfig values: bootstrap.servers = localhost:9092 report.interval.sec = 3 report.kafka.topic.replication.factor = 1 report.metrics.list = [kmf.services:type=produce-service,name=*:produce-availability-avg, kmf.services:type=consume-service,name=*:consume-availability-avg, kmf.services:type=produce-service,name=*:records-produced-total, kmf.services:type=consume-service,name=*:records-consumed-total, kmf.services:type=consume-service,name=*:records-lost-total, kmf.services:type=consume-service,name=*:records-duplicated-total, kmf.services:type=consume-service,name=*:records-delay-ms-avg, kmf.services:type=produce-service,name=*:records-produced-rate, kmf.services:type=produce-service,name=*:produce-error-rate, kmf.services:type=consume-service,name=*:consume-error-rate] topic = kafka-monitor-topic1 zookeeper.connect = localhost:2181 (com.linkedin.kmf.services.configs.KafkaMetricsReporterServiceConfig) [2020-05-29 14:34:57,694] INFO CreateTopicsResult: {kafka-monitor-topic1=KafkaFuture{value=null,exception=null,done=true}}. (com.linkedin.kmf.common.Utils) [2020-05-29 14:34:57,694] INFO Created monitoring topic kafka-monitor-topic1 in cluster with 1 partitions and replication factor of 1. (com.linkedin.kmf.common.Utils) [2020-05-29 14:34:57,694] INFO Completed the topic creation if it doesn't exist for kafka-monitor-topic1. (com.linkedin.kmf.common.Utils) [2020-05-29 14:34:57,706] INFO produce-service/ProduceService started (com.linkedin.kmf.services.ProduceService) [2020-05-29 14:34:57,707] INFO reporter-kafka-service/KafkaMetricsReporterService has started. (com.linkedin.kmf.services.KafkaMetricsReporterService) [2020-05-29 14:34:57,707] INFO Xinfra Monitor (KafkaMonitor) started. (com.linkedin.kmf.KafkaMonitor) [2020-05-29 14:35:00,722] INFO Kafka Metrics Reporter sending metrics = { "kmf.services:name=produce-service,type=produce-service:records-produced-rate" : "0.4514446227929374", "kmf.services:name=produce-service,type=produce-service:records-produced-total" : "27.0", "kmf.services:name=produce-service,type=produce-service:produce-availability-avg" : "1.0", "kmf.services:name=produce-service,type=produce-service:produce-error-rate" : "0.0" } (com.linkedin.kmf.services.KafkaMetricsReporterService) [2020-05-29 14:35:03,708] INFO Kafka Metrics Reporter sending metrics = { "kmf.services:name=produce-service,type=produce-service:records-produced-rate" : "0.9363765571440515", "kmf.services:name=produce-service,type=produce-service:records-produced-total" : "56.0", "kmf.services:name=produce-service,type=produce-service:produce-availability-avg" : "1.0", "kmf.services:name=produce-service,type=produce-service:produce-error-rate" : "0.0" } (com.linkedin.kmf.services.KafkaMetricsReporterService) [2020-05-29 14:35:06,708] INFO Kafka Metrics Reporter sending metrics = { "kmf.services:name=produce-service,type=produce-service:records-produced-rate" : "1.4045648357160772", "kmf.services:name=produce-service,type=produce-service:records-produced-total" : "84.0", "kmf.services:name=produce-service,type=produce-service:produce-availability-avg" : "1.0", "kmf.services:name=produce-service,type=produce-service:produce-error-rate" : "0.0" } (com.linkedin.kmf.services.KafkaMetricsReporterService) [2020-05-29 14:35:09,709] INFO Kafka Metrics Reporter sending metrics = { "kmf.services:name=produce-service,type=produce-service:records-produced-rate" : "1.8894425308497476", "kmf.services:name=produce-service,type=produce-service:records-produced-total" : "113.0", "kmf.services:name=produce-service,type=produce-service:produce-availability-avg" : "1.0", "kmf.services:name=produce-service,type=produce-service:produce-error-rate" : "0.0" } (com.linkedin.kmf.services.KafkaMetricsReporterService) [2020-05-29 14:35:12,712] INFO Kafka Metrics Reporter sending metrics = { "kmf.services:name=produce-service,type=produce-service:records-produced-rate" : "2.3742246150244948", "kmf.services:name=produce-service,type=produce-service:records-produced-total" : "142.0", "kmf.services:name=produce-service,type=produce-service:produce-availability-avg" : "1.0", "kmf.services:name=produce-service,type=produce-service:produce-error-rate" : "0.0" } (com.linkedin.kmf.services.KafkaMetricsReporterService) [2020-05-29 14:35:15,709] INFO Kafka Metrics Reporter sending metrics = { "kmf.services:name=produce-service,type=produce-service:records-produced-rate" : "2.842571691330156", "kmf.services:name=produce-service,type=produce-service:records-produced-total" : "170.0", "kmf.services:name=produce-service,type=produce-service:produce-availability-avg" : "1.0", "kmf.services:name=produce-service,type=produce-service:produce-error-rate" : "0.0" } (com.linkedin.kmf.services.KafkaMetricsReporterService) f[2020-05-29 14:35:18,712] INFO Kafka Metrics Reporter sending metrics = { "kmf.services:name=produce-service,type=produce-service:records-produced-rate" : "3.3273140716960943", "kmf.services:name=produce-service,type=produce-service:records-produced-total" : "199.0", "kmf.services:name=produce-service,type=produce-service:produce-availability-avg" : "1.0", "kmf.services:name=produce-service,type=produce-service:produce-error-rate" : "0.0" } (com.linkedin.kmf.services.KafkaMetricsReporterService) Signed-off-by: Andrew Choi <[email protected]>
Signed-off-by: Andrew Choi <[email protected]>
…kafka-monitor into andchoi_ServiceFactory
Signed-off-by: Andrew Choi <[email protected]>
indrajeetkm
approved these changes
Jun 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Service Factory + Individual Services' Factory Implementations
Because of the early design, architectural decisions of Xinfra Monitor, the
KafkaMonitor
class enforces individual Xinfra MonitorServices
to carry the same set of constructor parameters.This is a large caveat as not all
Service
classes don't need the identical constructor arguments.This is not enforced the codebase. It is partially and only silently enforced by convention.
Service
's constructor implementations aren't allowed to be evolved independently. 3. Change(s) in one Service's constructor absolutely forces the other Services' constructors to also change its parameters, unfortunately.Signed off by : Andrew Choi