Skip to content

Commit

Permalink
codecov test
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvin committed Jan 21, 2025
1 parent 195150b commit 74d8549
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
Expand Down Expand Up @@ -173,6 +177,8 @@ public String toThinString() {
return sb.toString();
}

private static DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

/**
* Parse {@link MetricNode} from thin string, see {@link #toThinString()}
*
Expand Down Expand Up @@ -211,11 +217,15 @@ public static MetricNode fromThinString(String line) {
* @return string format of this.
*/
public String toFatString() {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
StringBuilder sb = new StringBuilder(32);
sb.delete(0, sb.length());
sb.append(getTimestamp()).append("|");
sb.append(df.format(new Date(getTimestamp()))).append("|");
long timestamp = getTimestamp();
sb.append(timestamp).append("|");

LocalDateTime dateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault());
sb.append(df.format(dateTime)).append("|");
sb.append(dateTime).append("|");
String legalName = getResource().replaceAll("\\|", "_");
sb.append(legalName).append("|");
sb.append(getPassQps()).append("|");
Expand Down

0 comments on commit 74d8549

Please sign in to comment.