Package com.linkedin.parseq.trace

Examples of com.linkedin.parseq.trace.Trace


  }

  @Test
  public void testReversibleWithRemoveAttributes() throws IOException
  {
    final Trace trace = new TraceRelationshipBuilder<Integer>()
            .addTrace(0, new ShallowTraceBuilder("test", ResultType.SUCCESS)
                    .setStartNanos(0L)
                    .setPendingNanos(50L)
                    .setEndNanos(100L)
                    .addAttribute("key1", "value1")
View Full Code Here


  }

  @Test
  public void testWithDupAttributes() throws IOException
  {
    final Trace trace = new TraceRelationshipBuilder<Integer>()
            .addTrace(0, new ShallowTraceBuilder("test", ResultType.SUCCESS)
                    .setStartNanos(0L)
                    .setPendingNanos(50L)
                    .setEndNanos(100L)
                    .addAttribute("key1", "value1")
View Full Code Here

  }

  @Test
  public void testWithNonExistingRemoveAttributes() throws IOException
  {
    final Trace trace = new TraceRelationshipBuilder<Integer>()
            .addTrace(0, new ShallowTraceBuilder("test", ResultType.SUCCESS)
                    .setStartNanos(0L)
                    .setPendingNanos(50L)
                    .setEndNanos(100L)
                    .removeAttribute("key1")
View Full Code Here

  }

  @Test
  public void testReversibleErrorTrace() throws IOException
  {
    final Trace trace = new TraceRelationshipBuilder<Integer>()
        .addTrace(0, new ShallowTraceBuilder("test", ResultType.ERROR)
            .setValue("error value")
            .setStartNanos(0L)
            .setPendingNanos(50L)
            .setEndNanos(100L)
View Full Code Here

  @Test
  public void testReversibleUnfinishedTrace() throws IOException
  {
    // If we have started a task we also must set the end time
    final Trace trace = new TraceRelationshipBuilder<Integer>()
        .addTrace(0, new ShallowTraceBuilder("test", ResultType.UNFINISHED)
            .setStartNanos(0L)
            .setPendingNanos(50L)
            .setEndNanos(100L)
            .build())
View Full Code Here

  }

  @Test
  public void testReversibleWithHiddenTrace() throws IOException
  {
    final Trace trace = new TraceRelationshipBuilder<Integer>()
            .addTrace(0, new ShallowTraceBuilder("test", ResultType.SUCCESS)
                    .setStartNanos(0L)
                    .setPendingNanos(50L)
                    .setEndNanos(100L)
                    .setHidden(true)
View Full Code Here

  }

  @Test
  public void testReversibleTraceWithChild() throws IOException
  {
    final Trace trace = new TraceRelationshipBuilder<Integer>()
        .addTrace(0, new ShallowTraceBuilder("parent", ResultType.SUCCESS)
            .setValue("parent value")
            .setStartNanos(0L)
            .setPendingNanos(100L)
            .setEndNanos(200L)
View Full Code Here

  }

  @Test
  public void testReversibleTraceWithPredecessor() throws IOException
  {
    final Trace trace = new TraceRelationshipBuilder<Integer>()
        .addTrace(0, new ShallowTraceBuilder("successor", ResultType.SUCCESS)
            .setValue("successor value")
            .setStartNanos(100L)
            .setPendingNanos(150L)
            .setEndNanos(200L)
View Full Code Here

  }

  @Test
  public void testReversibleTraceWithDiamond() throws IOException
  {
    final Trace trace = new TraceRelationshipBuilder<Integer>()
        .addTrace(0, new ShallowTraceBuilder("source", ResultType.SUCCESS)
              .setValue("source value")
              .setStartNanos(0L)
              .setPendingNanos(25L)
              .setEndNanos(50L)
View Full Code Here

  {
    final String json = buildJson(new String[] {traceStr(1, "parent", ResultType.UNFINISHED, false),
                                                traceStr(2, "child", ResultType.UNFINISHED, false),
                                                traceStr(3, "predecessor", ResultType.UNFINISHED, false)},
                                  new String[] {hierStr(1, 2), orderStr(3, 1)});
    final Trace trace;

    try
    {
      trace = decodeString(json);
    }
    catch (IOException e)
    {
      fail("JSON parse failed. Document:\n" + json + "\nError: " + e.toString());
      return;
    }

    assertEquals("parent", trace.getName());
    assertEquals(ResultType.UNFINISHED, trace.getResultType());

    assertEquals(2, trace.getRelated().size());

    String childName = null;
    String predecessorName = null;
    for (Related<Trace> related : trace.getRelated())
    {
      if (related.getRelationship().equals(Relationship.PARENT_OF.name()))
      {
        childName = related.getRelated().getName();
      }
View Full Code Here

TOP

Related Classes of com.linkedin.parseq.trace.Trace

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.