Skip to content

Commit

Permalink
fixed no consumer metrics job
Browse files Browse the repository at this point in the history
  • Loading branch information
smartloli committed Jan 21, 2019
1 parent bbb7f97 commit 3c9ef28
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
22 changes: 11 additions & 11 deletions kafka-eagle-common/src/main/resources/system-config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# multi zookeeper&kafka cluster list
######################################

kafka.eagle.zk.cluster.alias=cluster1,cluster4
kafka.eagle.zk.cluster.alias=cluster1
#cluster2.zk.list=dn1:2181,dn2:2181,dn3:2181
cluster1.zk.list=vmn1:2181
cluster1.zk.list=127.0.0.1:2181
#cluster2.zk.list=vmn2:2181
#cluster3.zk.list=vmn3:2181
cluster4.zk.list=vmn4:2181
Expand All @@ -22,7 +22,7 @@ kafka.eagle.webui.port=8048
######################################
# kafka offset storage
######################################
cluster1.kafka.eagle.offset.storage=zookeeper
cluster1.kafka.eagle.offset.storage=kafka
#cluster2.kafka.eagle.offset.storage=kafka
#cluster3.kafka.eagle.offset.storage=kafka
cluster4.kafka.eagle.offset.storage=kafka
Expand Down Expand Up @@ -84,12 +84,12 @@ kafka.eagle.sasl.mechanism=PLAIN
######################################
# kafka jdbc driver address
######################################
kafka.eagle.driver=com.mysql.jdbc.Driver
kafka.eagle.url=jdbc:mysql://127.0.0.1:3306/ke3?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
kafka.eagle.username=root
kafka.eagle.password=123456

#kafka.eagle.driver=org.sqlite.JDBC
#kafka.eagle.url=jdbc:sqlite:/Users/dengjie/workspace/kafka-egale/kafka-eagle-web/src/main/resources/db/ke.db
#kafka.eagle.driver=com.mysql.jdbc.Driver
#kafka.eagle.url=jdbc:mysql://127.0.0.1:3306/ke3?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
#kafka.eagle.username=root
#kafka.eagle.password=root
#kafka.eagle.password=123456

kafka.eagle.driver=org.sqlite.JDBC
kafka.eagle.url=jdbc:sqlite:/Users/dengjie/workspace/kafka-egale/kafka-eagle-web/src/main/resources/db/ke.db
kafka.eagle.username=root
kafka.eagle.password=root
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public interface JConstants {

static String CREATE_TABLE_KE_CLUSTERS = "CREATE TABLE IF NOT EXISTS `ke_clusters` (`id` int(11) NOT NULL AUTO_INCREMENT,`type` varchar(32) DEFAULT NULL,`cluster` varchar(256) DEFAULT NULL,`server` text DEFAULT NULL,`owner` text DEFAULT NULL,`created` varchar(32) DEFAULT NULL,`modify` varchar(32) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";

static String CREATE_TABLE_KE_LAG = "CREATE TABLE IF NOT EXISTS `ke_lag` (`cluster` varchar(256) DEFAULT NULL,`group` varchar(256) DEFAULT NULL,`topic` varchar(256) DEFAULT NULL,`lag` varchar(256) DEFAULT NULL,`timespan` bigint(20) DEFAULT NULL,`tm` varchar(16)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
static String CREATE_TABLE_KE_LAG = "CREATE TABLE IF NOT EXISTS `ke_lag` (`cluster` varchar(256) DEFAULT NULL,`group` varchar(256) DEFAULT NULL,`topic` varchar(256) DEFAULT NULL,`lag` varchar(256) DEFAULT NULL,`timespan` bigint(20) DEFAULT NULL,`tm` varchar(16) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";

static String CREATE_TABLE_KE_USER_ROLE = "CREATE TABLE IF NOT EXISTS `ke_user_role` (`id` int(11) NOT NULL AUTO_INCREMENT,`user_id` int(11) NOT NULL,`role_id` tinyint(4) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4";
static String CREATE_TABLE_KE_USER_ROLE_INSERT = "INSERT INTO `ke_user_role` VALUES ('1', '1', '1');";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,13 @@ public void metricsJobQuartz() {
}
try {
MetricsServiceImpl metricsServiceImpl = StartupListener.getBean("metricsServiceImpl", MetricsServiceImpl.class);
metricsServiceImpl.setConsumerLag(topicLags);
if (topicLags.size() > 0) {
metricsServiceImpl.setConsumerLag(topicLags);
}
} catch (Exception e) {
LOG.error("Collector consumer lag data has error,msg is " + e.getMessage());
e.printStackTrace();
}
}

}

0 comments on commit 3c9ef28

Please sign in to comment.