mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-17 08:46:22 +10:00
[유치수] [NOBTS] server map에서 request count가 맞지 않는 현상 수정.
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@1215 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.nhn.hippo.web.vo;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.profiler.common.Histogram;
|
||||
@@ -81,6 +80,48 @@ public class ResponseHistogram {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void mergeWith(ResponseHistogram histogram) {
|
||||
if (!this.equals(histogram)) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
long[] otherValues = histogram.values;
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
values[i] += otherValues[i];
|
||||
}
|
||||
|
||||
this.errorCount += histogram.errorCount;
|
||||
this.slowCount += histogram.slowCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((histogram == null) ? 0 : histogram.hashCode());
|
||||
result = prime * result + ((serviceType == null) ? 0 : serviceType.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ResponseHistogram other = (ResponseHistogram) obj;
|
||||
if (histogram == null) {
|
||||
if (other.histogram != null)
|
||||
return false;
|
||||
} else if (!histogram.equals(other.histogram))
|
||||
return false;
|
||||
if (serviceType != other.serviceType)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -49,9 +49,7 @@ public class TerminalStatistics {
|
||||
|
||||
public TerminalStatistics mergeWith(TerminalStatistics terminalRequest) {
|
||||
if (this.equals(terminalRequest)) {
|
||||
// TODO merge histogram here.
|
||||
|
||||
// this.histogram.mergeWith(terminalRequest.getHistogram());
|
||||
histogram.mergeWith(terminalRequest.getHistogram());
|
||||
return this;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Can't merge with different link.");
|
||||
|
||||
Reference in New Issue
Block a user