Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ public boolean apply(Token input) {
throw new RuntimeException("Could not parse: " + input);
}

// fix up the point.
if (point.getTimestamp() == null) {
point.setTimestamp(System.currentTimeMillis());
}
String host = null;
Map<String, String> annotations = point.getAnnotations();
if (annotations != null) {
Expand Down Expand Up @@ -268,8 +264,12 @@ public AdaptiveTimestamp(boolean optional) {
public void consume(Queue<Token> tokenQueue, ReportPoint point) {
Token peek = tokenQueue.peek();
if (peek == null) {
if (optional) return;
else throw new RuntimeException("Expecting timestamp, found EOF");
if (optional) {
point.setTimestamp(System.currentTimeMillis());
return;
} else {
throw new RuntimeException("Expecting timestamp, found EOF");
}
}
if (peek.getType() == DSWrapperLexer.Number) {
try {
Expand All @@ -288,6 +288,8 @@ public void consume(Queue<Token> tokenQueue, ReportPoint point) {
}
} else if (!optional) {
throw new RuntimeException("Expecting timestamp, found: " + peek.getText());
} else {
point.setTimestamp(System.currentTimeMillis());
}
}
}
Expand Down