public CountMetric scope(String key) { CountMetric val = _value.get(key); if (val == null) { _value.put(key, val = new CountMetric()); } return val; }
public CountMetric scope(String key) { CountMetric val = _value.get(key); if(val == null) { _value.put(key, val = new CountMetric()); } return val; }
public CountMetric scope(String key) { CountMetric val = value.get(key); if (val == null) { value.put(key, val = new CountMetric()); } return val; }
public CountMetric scope(String key) { CountMetric val = _value.get(key); if (val == null) { _value.put(key, val = new CountMetric()); } return val; }
@SuppressWarnings("rawtypes") public void registerMetrics(Map conf, IMetricsContext context, String mapStateMetricName) { int bucketSize = (Integer) (conf.get(Config.TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS)); String metricBaseName = "cassandra/" + mapStateMetricName; _mreads = context.registerMetric(metricBaseName + "/readCount", new CountMetric(), bucketSize); _mwrites = context.registerMetric(metricBaseName + "/writeCount", new CountMetric(), bucketSize); _mexceptions = context.registerMetric(metricBaseName + "/exceptionCount", new CountMetric(), bucketSize); } }
@SuppressWarnings("rawtypes") @Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.logger = Logger.getLogger(JSONTranslatorBolt.class.getName()); this.collector = collector; gson = new GsonBuilder().create(); type = new TypeToken<HashMap<String, Object>>() { }.getType(); factory = new UnifiedFactory(); if (stormConf.get(TRANSLATOR_TIMESTAMP_KEY) != null) { this.timestampKey = stormConf.get(TRANSLATOR_TIMESTAMP_KEY).toString(); } else { timestampKey = DEFAULT_TIMESTAMP; } if (stormConf.get(TRANSLATOR_TENAN_ID_KEY) != null) { this.timestampKey = stormConf.get(TRANSLATOR_TENAN_ID_KEY).toString(); } else { tenantIdKey = DEFAULT_TENANT_ID; } sucessMetric = new CountMetric(); failMetric = new CountMetric(); if (context != null) { context.registerMetric(_METRIC_TRANSLATOR_SUCCESS, sucessMetric, Constants.METRICS_FREQUENCY); context.registerMetric(_METRIC_TRANSLATOR_FAIL, failMetric, Constants.METRICS_FREQUENCY); } logger.info("Translator bolt initialized"); }
@SuppressWarnings("rawtypes") @Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.logger = Logger.getLogger(JSONTranslatorBolt.class.getName()); this.collector = collector; gson = new GsonBuilder().create(); type = new TypeToken<HashMap<String, Object>>() { }.getType(); factory = new UnifiedFactory(); if (stormConf.get(TRANSLATOR_TIMESTAMP_KEY) != null) { this.timestampKey = stormConf.get(TRANSLATOR_TIMESTAMP_KEY).toString(); } else { timestampKey = DEFAULT_TIMESTAMP; } if (stormConf.get(TRANSLATOR_TENAN_ID_KEY) != null) { this.timestampKey = stormConf.get(TRANSLATOR_TENAN_ID_KEY).toString(); } else { ruleGroupField = DEFAULT_RULE_GROUP_FIELD; } sucessMetric = new CountMetric(); failMetric = new CountMetric(); if (context != null) { context.registerMetric(_METRIC_TRANSLATOR_SUCCESS, sucessMetric, Constants.METRICS_FREQUENCY); context.registerMetric(_METRIC_TRANSLATOR_FAIL, failMetric, Constants.METRICS_FREQUENCY); } logger.info("Translator bolt initialized"); }
interceptor.configure(stormConf); sucessMetric = new CountMetric(); failMetric = new CountMetric(); if (context != null) { context.registerMetric(_METRIC_INTERCEPTOR_SUCCESS, sucessMetric, Constants.METRICS_FREQUENCY);
interceptor.configure(stormConf); sucessMetric = new CountMetric(); failMetric = new CountMetric(); if (context != null) { context.registerMetric(_METRIC_INTERCEPTOR_SUCCESS, sucessMetric, Constants.METRICS_FREQUENCY);
_fetchAPICallCount = new CountMetric(); _fetchAPIMessageCount = new CountMetric();