Package edu.berkeley.xtrace

Examples of edu.berkeley.xtrace.XTraceMetadata


  void receiveReport(String msg) {
    Matcher matcher = XTRACE_LINE.matcher(msg);
    if (matcher.find()) {
      Report r = Report.createFromString(msg);
      String xtraceLine = matcher.group(1);
      XTraceMetadata meta = XTraceMetadata.createFromString(xtraceLine);

      if (meta.getTaskId() != null) {
        TaskID task = meta.getTaskId();
        String taskId = task.toString().toUpperCase();
        BufferedWriter fout = fileCache.getHandle(task);
        if (fout == null) {
          LOG
              .warn("Discarding a report due to internal fileCache error: "
View Full Code Here


   
    private void sendReport() {
      TaskID id = taskList.get()[rnd.nextInt(taskList.get().length)];
     
      Report r = new Report();
      r.put("X-Trace", new XTraceMetadata(id, 0).toString());
      r.put("Time", (new Date().toString()));
      r.put("Key1", "Value1");
      r.put("Key2", "Value2");
      r.put("Key3", "Value3.1");
      r.put("Key3", "Value3.2");
View Full Code Here

  }

  @Test
  public void testGetMetadata() {
    TaskID task = new TaskID(8);
    XTraceMetadata md = new XTraceMetadata(task, 0);
   
    Report r = new Report();
    r.put("X-Trace", md.toString());
    r.put("Key1", "Value1");
    r.put("Key2", "Value2");
   
    assertEquals(md, r.getMetadata());
   
    r = new Report();
    r.put("Key1", "Value1");
    r.put("X-Trace", md.toString());
    r.put("Key2", "Value2");
   
    assertEquals(md, r.getMetadata());
  }
View Full Code Here

  }

  @Test
  public void testToString() {
    Report r = new Report();
    XTraceMetadata xtr = new XTraceMetadata();
    r.put("X-Trace", xtr.toString());
    r.put("Key1", "Value1");
    r.put("Key2", "Value2");
    r.put("Key4", "Value4.1");
    r.put("Key4", "Value4.2");
    r.put("Key4", "Value4.3");
View Full Code Here

      for (int i = 0; i < numKeys; i++) {
        report.put("Key"+i, randomString(10 + r.nextInt(20)));
      }
      report.put("Timestamp", ""+System.currentTimeMillis());
      report.put("Sequence", ""+numSent++);
      report.put("X-Trace", new XTraceMetadata(task, r.nextInt()).toString());
      report.put("Tag", "loadtest");
      report.put("Title", "Load Test");
      return report;
    }
View Full Code Here

TOP

Related Classes of edu.berkeley.xtrace.XTraceMetadata

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.