Examples of Metrics


Examples of org.apache.hadoop.metrics2.annotation.Metrics

      }
    }
    // Create a new registry according to annotation
    for (Annotation annotation : cls.getAnnotations()) {
      if (annotation instanceof Metrics) {
        Metrics ma = (Metrics) annotation;
        info = factory.getInfo(cls, ma);
        if (r == null) {
          r = new MetricsRegistry(info);
        }
        r.setContext(ma.context());
      }
    }
    if (r == null) return new MetricsRegistry(cls.getSimpleName());
    return r;
  }
View Full Code Here

Examples of org.apache.hadoop.metrics2.annotation.Metrics

      }
    }
    // Create a new registry according to annotation
    for (Annotation annotation : cls.getAnnotations()) {
      if (annotation instanceof Metrics) {
        Metrics ma = (Metrics) annotation;
        info = factory.getInfo(cls, ma);
        if (r == null) {
          r = new MetricsRegistry(info);
        }
        r.setContext(ma.context());
      }
    }
    if (r == null) return new MetricsRegistry(cls.getSimpleName());
    return r;
  }
View Full Code Here

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

        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,
                                                                        MetricsReporter.class);
        reporters.add(new JmxReporter(jmxPrefix));
        this.metrics = new Metrics(metricConfig, reporters, time);
        this.partitioner = new Partitioner();
        long retryBackoffMs = config.getLong(ProducerConfig.RETRY_BACKOFF_MS_CONFIG);
        this.metadataFetchTimeoutMs = config.getLong(ProducerConfig.METADATA_FETCH_TIMEOUT_CONFIG);
        this.metadata = new Metadata(retryBackoffMs, config.getLong(ProducerConfig.METADATA_MAX_AGE_CONFIG));
        this.maxRequestSize = config.getInt(ProducerConfig.MAX_REQUEST_SIZE_CONFIG);
View Full Code Here

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

public class MetricsBench {

    public static void main(String[] args) {
        long iters = Long.parseLong(args[0]);
        Metrics metrics = new Metrics();
        Sensor parent = metrics.sensor("parent");
        Sensor child = metrics.sensor("child", parent);
        for (Sensor sensor : Arrays.asList(parent, child)) {
            sensor.add(sensor.name() + ".avg", new Avg());
            sensor.add(sensor.name() + ".count", new Count());
            sensor.add(sensor.name() + ".max", new Max());
            sensor.add(new Percentiles(1024,
View Full Code Here

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

    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.apache.kafka.common.metrics.Metrics

    @Before
    public void setup() throws Exception {
        this.server = new EchoServer();
        this.server.start();
        this.selector = new Selector(new Metrics(), new MockTime());
    }
View Full Code Here

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

public class JmxReporterTest {

    @Test
    public void testJmxRegistration() throws Exception {
        Metrics metrics = new Metrics();
        metrics.addReporter(new JmxReporter());
        Sensor sensor = metrics.sensor("kafka.requests");
        sensor.add("pack.bean1.avg", new Avg());
        sensor.add("pack.bean2.total", new Total());
        Sensor sensor2 = metrics.sensor("kafka.blah");
        sensor2.add("pack.bean1.some", new Total());
        sensor2.add("pack.bean2.some", new Total());
    }
View Full Code Here

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

                                   this.accumulator,
                                   MAX_REQUEST_SIZE,
                                   ACKS_ALL,
                                   maxRetries,
                                   REQUEST_TIMEOUT_MS,
                                   new Metrics(),
                                   time);
        // do a successful retry
        Future<RecordMetadata> future = accumulator.append(tp, "key".getBytes(), "value".getBytes(), CompressionType.NONE, null).future;
        sender.run(time.milliseconds()); // connect
        sender.run(time.milliseconds()); // send produce request
View Full Code Here

Examples of org.kitesdk.morphline.base.Metrics

        new MorphlineContext.Builder().build(),
        null);
    assertNotNull(morphline);
   
    new Fields();
    new Metrics();   
  }
View Full Code Here

Examples of org.lilyproject.clientmetrics.Metrics

        HBaseMetricsPlugin metricsPlugin = new HBaseMetricsPlugin(hbaseMetrics, hbaseAdmin, useHbaseMetrics);
        plugins.add(metricsPlugin);
        addMetricsPlugins(plugins);

        metricsStream = new PrintStream(new FileOutputStream(metricsFile));
        metrics = new Metrics(metricsStream, plugins);
        metrics.setThreadCount(workers);

        metrics.startHeader();

        metricsStream.println("Now: " + new DateTime());
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.