Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Add public method isFinished() on JaegerSpan (#634)
Browse files Browse the repository at this point in the history
* Add public method isFinished() on JaegerSpan

Signed-off-by: Doug Chimento <dchimento@gmail.com>

* Adding sync block around isFinished for JaegerSpan

Signed-off-by: Doug Chimento <dchimento@gmail.com>
  • Loading branch information
dougEfresh authored and yurishkuro committed Aug 3, 2019
1 parent d773589 commit f1a7ca9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public long getStart() {
return startTimeMicroseconds;
}

public boolean isFinished() {
synchronized (this) {
return finished;
}
}

public long getDuration() {
synchronized (this) {
return durationMicroseconds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ public void testSetNumberTag() {
assertEquals(expected, jaegerSpan.getTags().get(key));
}

@Test
public void testFinished() {
jaegerSpan.finish();
assertTrue(jaegerSpan.isFinished());
}

@Test
public void testSetTag() {
jaegerSpan.setTag(new StringTag("stringTag"), "stringTagValue")
Expand Down

0 comments on commit f1a7ca9

Please sign in to comment.