Examples of ExposedMetricsInfoImpl


Examples of org.apache.hadoop.metrics2.lib.ExposedMetricsInfoImpl

    PhoenixMetricsSink writer = new PhoenixMetricsSink();
    writer.setWriterForTesting(mockSink);

    // create a simple metrics record
    final long traceid = 987654;
    MetricsInfo info = new ExposedMetricsInfoImpl(TracingCompat.getTraceMetricName(traceid),
        "Some generic trace");
    // setup some metrics for the span
    long spanid = 10;
    AbstractMetric span = new ExposedMetricCounterLong(new ExposedMetricsInfoImpl(
        MetricInfo.SPAN.traceName, ""), spanid);
    long parentid = 11;
    AbstractMetric parent = new ExposedMetricCounterLong(new ExposedMetricsInfoImpl(
        MetricInfo.PARENT.traceName, ""), parentid);
    long startTime = 12;
    AbstractMetric start = new ExposedMetricCounterLong(new ExposedMetricsInfoImpl(
        MetricInfo.START.traceName, ""), startTime);
    long endTime = 13;
    AbstractMetric end = new ExposedMetricCounterLong(new ExposedMetricsInfoImpl(
        MetricInfo.END.traceName, ""), endTime);
    final List<AbstractMetric> metrics = Lists.newArrayList(span, parent, start, end);

    // create an annotation as well
    String annotation = "test annotation for a span";
    MetricsTag tag = new MetricsTag(
        new ExposedMetricsInfoImpl(MetricInfo.ANNOTATION.traceName, "0"), annotation);
    String hostnameValue = "host-name.value";
    MetricsTag hostname = new MetricsTag(new ExposedMetricsInfoImpl(MetricInfo.HOSTNAME.traceName,
        ""), hostnameValue);
    final List<MetricsTag> tags = Lists.newArrayList(hostname, tag);

    MetricsRecord record = new ExposedMetricsRecordImpl(info, System.currentTimeMillis(), tags,
        metrics);
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.