take the ip parse for costs stats
This commit is contained in:
parent
ad08637d21
commit
02e10db478
|
|
@ -239,6 +239,9 @@ public class SearcherTest {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mark the start time
|
||||||
|
long sTime = System.nanoTime();
|
||||||
|
|
||||||
byte[] sip;
|
byte[] sip;
|
||||||
try {
|
try {
|
||||||
sip = Util.parseIP(ps[0]);
|
sip = Util.parseIP(ps[0]);
|
||||||
|
|
@ -264,9 +267,7 @@ public class SearcherTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final byte[] ip : new byte[][]{sip, eip}) {
|
for (final byte[] ip : new byte[][]{sip, eip}) {
|
||||||
long sTime = System.nanoTime();
|
|
||||||
String region = searcher.search(ip);
|
String region = searcher.search(ip);
|
||||||
costs += System.nanoTime() - sTime;
|
|
||||||
|
|
||||||
// check the region info
|
// check the region info
|
||||||
if (!ps[2].equals(region)) {
|
if (!ps[2].equals(region)) {
|
||||||
|
|
@ -277,6 +278,8 @@ public class SearcherTest {
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
costs += System.nanoTime() - sTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
reader.close();
|
reader.close();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue