Skip to content

Commit

Permalink
round mean
Browse files Browse the repository at this point in the history
  • Loading branch information
martin.cong committed Jan 31, 2024
1 parent e85c070 commit 35f3da9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ void merge(MeasurementAggregator it) {
}

public String toString() {
return (min / 10f) + "/" + Math.round(sum / (float) count) / 10f + "/" + (max / 10f);
var mean = this.sum / 10.0 / this.count;
return (min / 10f) + "/" + Math.round(mean * 10) / 10f + "/" + (max / 10f);
}
}

Expand All @@ -96,7 +97,7 @@ public static void main(String[] args) throws IOException {
var buff = new byte[maxNameLength];
while (mb.hasRemaining()) {
var name = readNextHashKey(buff, mb);
// var name = readNextString(buff,mb);//.intern();
// var name = readNextString(buff, mb);// .intern();
var temp = readNextInt10Times(buff, mb);
add2map(map, name, temp);
}
Expand Down

0 comments on commit 35f3da9

Please sign in to comment.