Examples of MetricConfig


Examples of com.dianping.cat.advanced.metric.config.entity.MetricConfig

      }
    } catch (Exception e) {
      Cat.logError(e);
    }
    if (m_metricConfig == null) {
      m_metricConfig = new MetricConfig();
    }

    deleteUnusedConfig();
  }
View Full Code Here

Examples of com.dianping.cat.advanced.metric.config.entity.MetricConfig

    long modifyTime = config.getModifyDate().getTime();

    synchronized (this) {
      if (modifyTime > m_modifyTime) {
        String content = config.getContent();
        MetricConfig metricConfig = DefaultSaxParser.parse(content);

        m_metricConfig = metricConfig;
        m_modifyTime = modifyTime;
      }
    }
View Full Code Here

Examples of com.dianping.cat.advanced.metric.config.entity.MetricConfig

    ((MockMetricConfigManager) manager).setConfigDao(new MockConfigDao2());
    try {
      manager.initialize();
    } catch (Exception e) {
    }
    MetricConfig config = manager.getMetricConfig();
    Assert.assertEquals(0, config.getMetricItemConfigs().size());
  }
View Full Code Here

Examples of com.dianping.cat.advanced.metric.config.entity.MetricConfig

    @Override
    public Config findByPK(int keyId, Readset<Config> readset) throws DalException {
      Config config = new Config();

      config.setId(keyId);
      config.setContent(new MetricConfig().toString());
      config.setModifyDate(new Date());
      return config;
    }
View Full Code Here

Examples of com.dianping.cat.advanced.metric.config.entity.MetricConfig

    @Override
    public Config findByName(String name, Readset<Config> readset) throws DalException {
      Config config = new Config();

      config.setName(name);
      MetricConfig metricConfig = new MetricConfig();

      MetricItemConfig metricItemConfig = new MetricItemConfig();

      metricItemConfig.setDomain("domain");
      metricItemConfig.setMetricKey("domain:URL:metricKey");
      metricItemConfig.setType("URL");
      metricItemConfig.setMetricKey("metricKey");
      metricConfig.addMetricItemConfig(metricItemConfig);
      config.setContent(metricConfig.toString());
      config.setModifyDate(new Date());
      return config;
    }
View Full Code Here

Examples of org.apache.kafka.common.metrics.MetricConfig

    }

    private KafkaProducer(ProducerConfig config) {
        log.trace("Starting the Kafka producer");
        this.time = new SystemTime();
        MetricConfig metricConfig = new MetricConfig().samples(config.getInt(ProducerConfig.METRICS_NUM_SAMPLES_CONFIG))
                                                      .timeWindow(config.getLong(ProducerConfig.METRICS_SAMPLE_WINDOW_MS_CONFIG),
                                                                  TimeUnit.MILLISECONDS);
        String clientId = config.getString(ProducerConfig.CLIENT_ID_CONFIG);
        String jmxPrefix = "kafka.producer." + (clientId.length() > 0 ? clientId + "." : "");
        List<MetricsReporter> reporters = config.getConfiguredInstances(ProducerConfig.METRIC_REPORTER_CLASSES_CONFIG,
View Full Code Here

Examples of org.apache.kafka.common.metrics.MetricConfig

    private KafkaConsumer(ConsumerConfig config, ConsumerRebalanceCallback callback) {
        log.trace("Starting the Kafka consumer");
        subscribedTopics = new HashSet<String>();
        subscribedPartitions = new HashSet<TopicPartition>();
        this.metrics = new Metrics(new MetricConfig(),
                                   Collections.singletonList((MetricsReporter) new JmxReporter("kafka.consumer.")),
                                   new SystemTime());
        this.metadataFetchTimeoutMs = config.getLong(ConsumerConfig.METADATA_FETCH_TIMEOUT_CONFIG);
        this.totalMemorySize = config.getLong(ConsumerConfig.TOTAL_BUFFER_MEMORY_CONFIG);
        List<InetSocketAddress> addresses = ClientUtils.parseAndValidateAddresses(config.getList(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG));
View Full Code Here

Examples of org.platformlayer.ops.model.metrics.MetricConfig

  public MetricConfig getMetricsInfo() throws OpsException {
    if (metrics == null) {
      metrics = ResourceUtils.findResource(getClass(), getMetricKey() + ".metrics", MetricConfig.class);
      if (metrics == null) {
        // Empty to stop reload attempts
        metrics = new MetricConfig();
      }
    }
    return metrics;
  }
View Full Code Here

Examples of org.platformlayer.ops.model.metrics.MetricConfig

  final List<MetricConfig> metricConfigs = Lists.newArrayList();

  public MetricConfig getMetricInfo(Object target) throws OpsException {
    visit(target);

    MetricConfig metricConfig = new MetricConfig();
    metricConfig.metrics = metricConfigs;
    return metricConfig;
  }
View Full Code Here

Examples of org.platformlayer.ops.model.metrics.MetricConfig

  void visitMethods(Object target) throws OpsException {
    for (Method method : target.getClass().getMethods()) {
      Class<?> returnType = method.getReturnType();
      if (returnType.equals(MetricConfig.class)) {
        MetricConfig metricConfig;
        try {
          metricConfig = (MetricConfig) method.invoke(target, (Object[]) null);
        } catch (IllegalArgumentException e) {
          throw new OpsException("Error invoking method: " + method, e);
        } catch (IllegalAccessException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.