Skip to content

Commit

Permalink
Add current time in the log
Browse files Browse the repository at this point in the history
Sometime the metric timestamp is a future time. the error message is a
little confusing.

Signed-off-by: Yixing Jia<yixingj@vmware.com>
  • Loading branch information
yixingjia committed Aug 30, 2022
1 parent b7fe9f8 commit e6020c4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
Expand Down Expand Up @@ -799,7 +800,9 @@ public List<ValueUnit> generateValueUnits(List<PowerStripsRealtimeValue> values,
String valueDateTime = value.getRecordedDateTime();
long recordedTime = WormholeDateFormat.getLongTime(valueDateTime, dateFormat, timezone);
if (recordedTime > currenttime || recordedTime == -1) {
logger.error("Failed to translate the time string: " + valueDateTime);
logger.error(
String.format("Failed to translate the time string: %s, current time is: %s",
valueDateTime, new Date()));
continue;
}
if (sensorValueTypeMap.containsKey(value.getName())) {
Expand Down

0 comments on commit e6020c4

Please sign in to comment.