@Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { String site = config.getString("dataSourceConfig.site"); String topic = config.getString("dataSourceConfig.topic"); this.baseMetricDimension = new HashMap<>(); this.baseMetricDimension.put("site", site); this.baseMetricDimension.put("topic", topic); registry = new MetricRegistry(); this.granularity = DEFAULT_METRIC_GRANULARITY; if (config.hasPath("dataSourceConfig.kafkaDistributionDataIntervalMin")) { this.granularity = config.getInt("dataSourceConfig.kafkaDistributionDataIntervalMin") * DateUtils.MILLIS_PER_MINUTE; } String host = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST); int port = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT); String username = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME); String password = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD); listener = new EagleServiceReporterMetricListener(host, port, username, password); }
@Override public void init() { String site = config.getString("dataSourceConfig.site"); String topic = config.getString("dataSourceConfig.topic"); this.baseMetricDimension = new HashMap<>(); this.baseMetricDimension.put("site", site); this.baseMetricDimension.put("topic", topic); registry = new MetricRegistry(); this.granularity = DEFAULT_METRIC_GRANULARITY; if (config.hasPath("dataSourceConfig.kafkaDistributionDataIntervalMin")) { this.granularity = config.getInt("dataSourceConfig.kafkaDistributionDataIntervalMin") * DateUtils.MILLIS_PER_MINUTE; } String host = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST); int port = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT); String username = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME); String password = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD); listener = new EagleServiceReporterMetricListener(host, port, username, password); }
private void initMetricReportor() { String host = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST); int port = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT); String username = config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) ? config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) : null; String password = config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD) ? config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD) : null; registry = new MetricRegistry(); listener = new EagleServiceReporterMetricListener(host, port, username, password); baseDimensions = new HashMap<>(); baseDimensions = new HashMap<String, String>(); baseDimensions.put(Constants.ALERT_EXECUTOR_ID, executorId); baseDimensions.put(Constants.PARTITIONSEQ, String.valueOf(partitionSeq)); baseDimensions.put(Constants.SOURCE, ManagementFactory.getRuntimeMXBean().getName()); baseDimensions.put(EagleConfigConstants.APPLICATION, config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.APPLICATION)); baseDimensions.put(EagleConfigConstants.SITE, config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.SITE)); dimensionsMap = new HashMap<String, Map<String, String>>(); }
@SuppressWarnings("rawtypes") @Override public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { consumerOffsetFetcher = new KafkaConsumerOffsetFetcher(config.zkConfig, config.kafkaConfig.topic, config.kafkaConfig.group); latestOffsetFetcher = new KafkaLatestOffsetFetcher(config.kafkaConfig.kafkaEndPoints); this.baseMetricDimension = new HashMap<>(); this.baseMetricDimension.put("site", config.kafkaConfig.site); this.baseMetricDimension.put("topic", config.kafkaConfig.topic); this.baseMetricDimension.put("group", config.kafkaConfig.group); String host = config.serviceConfig.serviceHost; Integer port = config.serviceConfig.servicePort; String username = config.serviceConfig.username; String password = config.serviceConfig.password; listener = new EagleServiceReporterMetricListener(host, port, username, password); }
@SuppressWarnings("rawtypes") @Override public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { consumerOffsetFetcher = new KafkaConsumerOffsetFetcher(config.zkConfig, config.kafkaConfig.topic, config.kafkaConfig.group); latestOffsetFetcher = new KafkaLatestOffsetFetcher(config.kafkaConfig.kafkaEndPoints); this.baseMetricDimension = new HashMap<>(); this.baseMetricDimension.put("site", config.kafkaConfig.site); this.baseMetricDimension.put("topic", config.kafkaConfig.topic); this.baseMetricDimension.put("group", config.kafkaConfig.group); String host = config.serviceConfig.serviceHost; Integer port = config.serviceConfig.servicePort; String username = config.serviceConfig.username; String password = config.serviceConfig.password; listener = new EagleServiceReporterMetricListener(host, port, username, password); }
@Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { registry = new MetricRegistry(); String host = EagleConfigHelper.getServiceHost(config); int port = EagleConfigHelper.getServicePort(config); String username = EagleConfigHelper.getServiceUser(config); String password = EagleConfigHelper.getServicePassword(config); listener = new EagleServiceReporterMetricListener(host, port, username, password); dimensions = new HashMap<>(); dimensions.put(EagleConfigConstants.SITE, config.getString("siteId")); dimensions.put(EagleConfigConstants.APPLICATION, config.getString("appId")); gcPausedTimeMetricName = MetricKeyCodeDecoder.codeMetricKey(GCConstants.GC_PAUSE_TIME_METRIC_NAME, dimensions); this.collector = collector; }
@Override public void init() { registry = new MetricRegistry(); String host = EagleConfigHelper.getServiceHost(config); int port = EagleConfigHelper.getServicePort(config); String username = EagleConfigHelper.getServiceUser(config); String password = EagleConfigHelper.getServicePassword(config); listener = new EagleServiceReporterMetricListener(host, port, username, password); dimensions = new HashMap<>(); dimensions.put(EagleConfigConstants.SITE, EagleConfigHelper.getSite(config)); dimensions.put(EagleConfigConstants.APPLICATION, EagleConfigHelper.getApplication(config)); gcPausedTimeMetricName = MetricKeyCodeDecoder.codeMetricKey(GCConstants.GC_PAUSE_TIME_METRIC_NAME, dimensions); }