@Override public void addMessageEvent(io.opencensus.trace.MessageEvent messageEvent) { Preconditions.checkNotNull(messageEvent, "messageEvent"); synchronized (this) { if (hasBeenEnded) { logger.log(Level.FINE, "Calling addNetworkEvent() on an ended Span."); return; } getInitializedNetworkEvents() .addEvent( new EventWithNanoTime<io.opencensus.trace.MessageEvent>( clock.nowNanos(), checkNotNull(messageEvent, "networkEvent"))); } }
@Override public void addAnnotation(String description, Map<String, AttributeValue> attributes) { Preconditions.checkNotNull(description, "description"); Preconditions.checkNotNull(attributes, "attribute"); synchronized (this) { if (hasBeenEnded) { logger.log(Level.FINE, "Calling addAnnotation() on an ended Span."); return; } getInitializedAnnotations() .addEvent( new EventWithNanoTime<Annotation>( clock.nowNanos(), Annotation.fromDescriptionAndAttributes(description, attributes))); } }
@Override public void addAnnotation(String description, Map<String, AttributeValue> attributes) { Preconditions.checkNotNull(description, "description"); Preconditions.checkNotNull(attributes, "attribute"); synchronized (this) { if (hasBeenEnded) { logger.log(Level.FINE, "Calling addAnnotation() on an ended Span."); return; } getInitializedAnnotations() .addEvent( new EventWithNanoTime<Annotation>( clock.nowNanos(), Annotation.fromDescriptionAndAttributes(description, attributes))); } }
@Override public void addMessageEvent(io.opencensus.trace.MessageEvent messageEvent) { Preconditions.checkNotNull(messageEvent, "messageEvent"); synchronized (this) { if (hasBeenEnded) { logger.log(Level.FINE, "Calling addNetworkEvent() on an ended Span."); return; } getInitializedNetworkEvents() .addEvent( new EventWithNanoTime<io.opencensus.trace.MessageEvent>( clock.nowNanos(), checkNotNull(messageEvent, "networkEvent"))); } }
@Override public void addAnnotation(Annotation annotation) { Preconditions.checkNotNull(annotation, "annotation"); synchronized (this) { if (hasBeenEnded) { logger.log(Level.FINE, "Calling addAnnotation() on an ended Span."); return; } getInitializedAnnotations() .addEvent(new EventWithNanoTime<Annotation>(clock.nowNanos(), annotation)); } }
@Override public void addLink(Link link) { Preconditions.checkNotNull(link, "link"); synchronized (this) { if (hasBeenEnded) { logger.log(Level.FINE, "Calling addLink() on an ended Span."); return; } getInitializedLinks().addEvent(link); } }
@GuardedBy("this") private TraceEvents<EventWithNanoTime<Annotation>> getInitializedAnnotations() { if (annotations == null) { annotations = new TraceEvents<EventWithNanoTime<Annotation>>(traceParams.getMaxNumberOfAnnotations()); } return annotations; }
@GuardedBy("this") private TraceEvents<Link> getInitializedLinks() { if (links == null) { links = new TraceEvents<Link>(traceParams.getMaxNumberOfLinks()); } return links; }
@GuardedBy("this") private TraceEvents<EventWithNanoTime<io.opencensus.trace.MessageEvent>> getInitializedNetworkEvents() { if (messageEvents == null) { messageEvents = new TraceEvents<EventWithNanoTime<io.opencensus.trace.MessageEvent>>( traceParams.getMaxNumberOfMessageEvents()); } return messageEvents; }
@Override public void addLink(Link link) { Preconditions.checkNotNull(link, "link"); synchronized (this) { if (hasBeenEnded) { logger.log(Level.FINE, "Calling addLink() on an ended Span."); return; } getInitializedLinks().addEvent(link); } }
@Override public void addAnnotation(Annotation annotation) { Preconditions.checkNotNull(annotation, "annotation"); synchronized (this) { if (hasBeenEnded) { logger.log(Level.FINE, "Calling addAnnotation() on an ended Span."); return; } getInitializedAnnotations() .addEvent(new EventWithNanoTime<Annotation>(clock.nowNanos(), annotation)); } }
@GuardedBy("this") private TraceEvents<EventWithNanoTime<io.opencensus.trace.MessageEvent>> getInitializedNetworkEvents() { if (messageEvents == null) { messageEvents = new TraceEvents<EventWithNanoTime<io.opencensus.trace.MessageEvent>>( traceParams.getMaxNumberOfMessageEvents()); } return messageEvents; }
@GuardedBy("this") private TraceEvents<EventWithNanoTime<Annotation>> getInitializedAnnotations() { if (annotations == null) { annotations = new TraceEvents<EventWithNanoTime<Annotation>>(traceParams.getMaxNumberOfAnnotations()); } return annotations; }
@GuardedBy("this") private TraceEvents<Link> getInitializedLinks() { if (links == null) { links = new TraceEvents<Link>(traceParams.getMaxNumberOfLinks()); } return links; }