本文整理了Java中zipkin2.Annotation.timestamp()
方法的一些代码示例,展示了Annotation.timestamp()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation.timestamp()
方法的具体详情如下:
包路径:zipkin2.Annotation
类名称:Annotation
方法名:timestamp
[英]Microseconds from epoch.
This value should be set directly by instrumentation, using the most precise value possible. For example, gettimeofday or multiplying System#currentTimeMillis by 1000.
[中]
代码示例来源:origin: line/armeria
final long clientWireSendTime = clientFooSpan.annotations().stream()
.filter(a -> a.value().equals("ws"))
.findFirst().get().timestamp();
final long clientWireReceiveTime = clientFooSpan.annotations().stream()
.filter(a -> a.value().equals("wr"))
.findFirst().get().timestamp();
final long clientEndTime = clientStartTime + clientFooSpan.durationAsLong();
final long serverWireSendTime = serviceFooSpan.annotations().stream()
.filter(a -> a.value().equals("ws"))
.findFirst().get().timestamp();
final long serverWireReceiveTime = serviceFooSpan.annotations().stream()
.filter(a -> a.value().equals("wr"))
.findFirst().get().timestamp();
final long serverEndTime = serverStartTime + serviceFooSpan.durationAsLong();
代码示例来源:origin: io.zipkin.zipkin2/zipkin
/** Compares by {@link #timestamp}, then {@link #value}. */
@Override public int compareTo(Annotation that) {
if (this == that) return 0;
int byTimestamp = timestamp() < that.timestamp() ? -1 : timestamp() == that.timestamp() ? 0 : 1;
if (byTimestamp != 0) return byTimestamp;
return value().compareTo(that.value());
}
代码示例来源:origin: io.zipkin.zipkin2/zipkin
@Override public boolean equals(Object o) {
if (o == this) return true;
if (!(o instanceof Annotation)) return false;
Annotation that = (Annotation) o;
return timestamp == that.timestamp() && value.equals(that.value());
}
代码示例来源:origin: io.zipkin.zipkin2/zipkin-storage-cassandra
static long guessTimestamp(Span span) {
assert 0L == span.timestampAsLong() : "method only for when span has no timestamp";
for (Annotation annotation : span.annotations()) {
if (0L < annotation.timestamp()) {
return annotation.timestamp();
}
}
return 0L; // return a timestamp that won't match a query
}
代码示例来源:origin: io.zipkin.zipkin2/zipkin-storage-cassandra-v1
private static long guessTimestamp(Span span) {
assert 0L == span.timestampAsLong() : "method only for when span has no timestamp";
for (Annotation annotation : span.annotations()) {
if (0L < annotation.timestamp()) return annotation.timestamp();
}
return 0L; // return a timestamp that won't match a query
}
代码示例来源:origin: io.zipkin.zipkin2/zipkin-storage-cassandra
AnnotationUDT(Annotation annotation) {
this.ts = annotation.timestamp();
this.v = annotation.value();
}
代码示例来源:origin: io.zipkin.zipkin2/zipkin
if (a.timestamp() < startTs) startTs = a.timestamp();
} else if (value.equals("sr")) {
kind = Span.Kind.SERVER;
if (a.timestamp() < startTs) startTs = a.timestamp();
} else if (value.equals("ss")) {
kind = Span.Kind.SERVER;
if (a.timestamp() > endTs) endTs = a.timestamp();
} else if (value.equals("cr")) {
kind = Span.Kind.CLIENT;
if (a.timestamp() > endTs) endTs = a.timestamp();
} else if (value.equals("ms")) {
kind = Span.Kind.PRODUCER;
msTs = a.timestamp();
} else if (value.equals("mr")) {
kind = Span.Kind.CONSUMER;
mrTs = a.timestamp();
} else if (value.equals("ws")) {
wsTs = a.timestamp();
} else if (value.equals("wr")) {
wrTs = a.timestamp();
代码示例来源:origin: io.zipkin.zipkin2/zipkin
@Override void writeValue(Buffer b, Annotation value) {
TIMESTAMP.write(b, value.timestamp());
VALUE.write(b, value.value());
}
代码示例来源:origin: io.zipkin.zipkin2/zipkin
@Override int sizeOfValue(Annotation value) {
return TIMESTAMP.sizeInBytes(value.timestamp()) + VALUE.sizeInBytes(value.value());
}
代码示例来源:origin: Nike-Inc/wingtips
private List<TimestampedAnnotation> toWingtipsAnnotations(List<Annotation> zipkinAnnotations) {
return zipkinAnnotations
.stream()
.map(za -> TimestampedAnnotation.forEpochMicros(za.timestamp(), za.value()))
.collect(Collectors.toList());
}
代码示例来源:origin: io.netifi.proteus/proteus-tracing-openzipkin
private zipkin2.proto3.Annotation.Builder mapAnnotation(Annotation annotation) {
return zipkin2.proto3.Annotation.newBuilder()
.setTimestamp(annotation.timestamp())
.setValue(annotation.value());
}
代码示例来源:origin: io.netifi.proteus/tracing-openzipkin
private zipkin2.proto3.Annotation.Builder mapAnnotation(Annotation annotation) {
return zipkin2.proto3.Annotation.newBuilder()
.setTimestamp(annotation.timestamp())
.setValue(annotation.value());
}
代码示例来源:origin: netifi-proteus/proteus-java
private zipkin2.proto3.Annotation.Builder mapAnnotation(Annotation annotation) {
return zipkin2.proto3.Annotation.newBuilder()
.setTimestamp(annotation.timestamp())
.setValue(annotation.value());
}
代码示例来源:origin: com.google.cloud.trace.adapters.zipkin/translation
result.put(getLabelName(annotation.value()), formatTimestamp(annotation.timestamp()));
代码示例来源:origin: io.zipkin.zipkin2/zipkin
for (int i = 0; i < length; i++) {
Annotation a = value.annotations().get(i);
sizeInBytes += annotationSizeInBytes(a.timestamp(), a.value(), 0);
代码示例来源:origin: io.zipkin.zipkin2/zipkin
if (beginAnnotation && a.value().equals(md.begin)) continue;
if (endAnnotation && a.value().equals(md.end)) continue;
result.addAnnotation(a.timestamp(), a.value(), ep);
代码示例来源:origin: io.zipkin.zipkin2/zipkin
for (int i = 0, length = value.annotations().size(); i < length; ) {
Annotation a = value.annotations().get(i++);
writeAnnotation(a.timestamp(), a.value(), null, b);
if (i < length) b.writeByte(',');
代码示例来源:origin: openzipkin/zipkin-gcp
for (Annotation annotation : zipkinSpan.annotations()) {
events.addTimeEvent(TimeEvent.newBuilder()
.setTime(createTimestamp(annotation.timestamp()))
.setAnnotation(TimeEvent.Annotation.newBuilder()
.setDescription(toTruncatableString(annotation.value())))
代码示例来源:origin: io.zipkin.zipkin2/zipkin-storage-cassandra
builder.addAnnotation(udt.toAnnotation().timestamp(), udt.toAnnotation().value());
代码示例来源:origin: io.github.scouter-project/zipkin-storage-scouter-udp
pack.annotationValues = new ListValue();
for (Annotation annotation : span.annotations()) {
pack.annotationTimestamps.add(annotation.timestamp() / 1000);
pack.annotationValues.add(annotation.value());
内容来源于网络,如有侵权,请联系作者删除!