Skip to content

Commit 1b0f120

Browse files
committed
fix issue: MetricInfo compareTo method logic bug cause some metric info missing from the TreeSet
1 parent b225e7f commit 1b0f120

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/act/metric/MetricInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public long getMsAvg() {
4949

5050
@Override
5151
public int hashCode() {
52-
return $.hc(name, ns);
52+
return $.hc(name);
5353
}
5454

5555
@Override
@@ -59,7 +59,7 @@ public boolean equals(Object obj) {
5959
}
6060
if (obj instanceof MetricInfo) {
6161
MetricInfo that = (MetricInfo) obj;
62-
return ns == that.ns & $.eq(name, that.name);
62+
return $.eq(name, that.name);
6363
}
6464
return false;
6565
}
@@ -75,7 +75,7 @@ public int compareTo(MetricInfo metricInfo) {
7575
if (l < 0) {
7676
return -1;
7777
} else if (l == 0) {
78-
return 0;
78+
return metricInfo.name.compareTo(name);
7979
} else {
8080
return 1;
8181
}

0 commit comments

Comments
 (0)