Package com.cloudera.flume.reporter

Examples of com.cloudera.flume.reporter.ReportEvent


    return node;
  }

  @Override
  public ReportEvent getMetrics() {
    ReportEvent node = new ReportEvent(getName());
    node.setLongMetric(R_NUM_LOGICAL_NODES, this.getLogicalNodeManager()
        .getNodes().size());
    return node;
  }
View Full Code Here


    return "AlwaysRetry";
  }

  @Override
  public ReportEvent getMetrics() {
    return new ReportEvent(getName());
  }
View Full Code Here

          return r.getKey();
        }

        @Override
        public ReportEvent getMetrics() {
          return new ReportEvent(r.getValue());
        }

        @Override
        public Map<String, Reportable> getSubMetrics() {
          return ReportUtil.noChildren();
View Full Code Here

    return "ExpBackoff";
  }

  @Override
  public ReportEvent getMetrics() {
    ReportEvent rpt = new ReportEvent(getName());
    Attributes.setLong(rpt, A_INITIAL, initialSleep);
    Attributes.setLong(rpt, A_COUNT, backoffCount);
    Attributes.setLong(rpt, A_COUNTCAP, maxTries);
    Attributes.setLong(rpt, A_CURRENTBACKOFF, sleepIncrement);
    Attributes.setLong(rpt, A_RETRYTIME, retryTime);
View Full Code Here

      FlumeSpecException, IOException, InterruptedException {
    ReportTestUtils.setupSinkFactory();

    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "ackChecker one");
    ReportEvent rpt = ReportUtil.getFlattenedReport(snk);
    LOG.info(ReportUtil.toJSONObject(rpt).toString());
    assertNotNull(rpt.getLongMetric(AckChecksumChecker.A_ACK_ENDS));
    assertNotNull(rpt.getLongMetric(AckChecksumChecker.A_ACK_FAILS));
    assertNotNull(rpt.getLongMetric(AckChecksumChecker.A_ACK_STARTS));
    assertNotNull(rpt.getLongMetric(AckChecksumChecker.A_ACK_SUCCESS));
    assertNotNull(rpt.getLongMetric(AckChecksumChecker.A_ACK_UNEXPECTED));
    assertEquals("One", rpt.getStringMetric("One.name"));

  }
View Full Code Here

    return "Collector";
  }

  @Override
  public ReportEvent getMetrics() {
    ReportEvent rpt = new ReportEvent(getName());
    return rpt;
  }
View Full Code Here

      Event e = new EventImpl(("attempt " + i).getBytes());
      sink.append(e);
    }
    Assert.assertEquals(ok.get(), 100);

    ReportEvent rpt = sink.getMetrics();
    Writer out = new OutputStreamWriter(System.out);
    rpt.toJson(out);
    out.flush();

    // 100 good messages. every 4th message fails -- 3 good 1 bad.
    // 00 01 02 xx 03 04 05 xx 06 07 08 xx ...
    // so 100 good msgs, 133 total messages, 33 bad msgs
    Assert.assertEquals(new Long(100), rpt
        .getLongMetric(StubbornAppendSink.A_SUCCESSES));
    Assert.assertEquals(new Long(33), rpt
        .getLongMetric(StubbornAppendSink.A_FAILS));
    Assert.assertEquals(new Long(33), rpt
        .getLongMetric(StubbornAppendSink.A_RECOVERS));
  }
View Full Code Here

    ReportManager rman = ReportManager.get();
    SortedMap<String, Reportable> sorted = new TreeMap<String, Reportable>(rman
        .getReportables());
    for (Map.Entry<String, Reportable> ent : sorted.entrySet()) {
      String params = ent.getKey();
      ReportEvent r = ent.getValue().getMetrics();
      System.out.println(new String(r.toString()));
      System.err.print(new Date(r.getTimestamp()) + ",");
      System.err.print(params + ",");
      System.err.print(Attributes.readString(r,
          BenchmarkReportDecorator.A_BENCHMARK_CSV));
    }
  }
View Full Code Here

    doubleMetrics.put("double1", Double.MIN_VALUE);
    doubleMetrics.put("double2", Double.MAX_VALUE);

    Map<String, ReportEvent> reports = new HashMap<String, ReportEvent>();
    reports.put("reportKey", new ReportEvent(longMetrics, stringMetrics,
        doubleMetrics));

    masterRPC.putReports(reports);
  }
View Full Code Here

    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(
        LogicalNodeContext.testingContext()), spec);
    snk.open();
    snk.append(new EventImpl("this is a test".getBytes()));
    snk.close();
    ReportEvent rpta = ReportManager.get().getReportable("foo").getMetrics();
    assertEquals(1, (long) rpta.getLongMetric("foo"));
    ReportEvent rptb = ReportManager.get().getReportable("bar").getMetrics();
    assertEquals(1, (long) rptb.getLongMetric("bar"));
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.reporter.ReportEvent

Copyright © 2018 www.massapicom. 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.