Skip to content

Commit

Permalink
fix map -> singleTime field name in EntityTickProfiler.
Browse files Browse the repository at this point in the history
Signed-off-by: Ross Allan <rallanpcl@gmail.com>
  • Loading branch information
LunNova committed Jun 9, 2013
1 parent d3c4aaa commit 17e2fda
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public void clear() {
invocationCount.clear();
time.clear();
totalTime.set(0);
map.clear();
singleTime.clear();
singleInvocationCount.clear();
ticks = 0;
}
Expand Down Expand Up @@ -250,7 +250,7 @@ public TableFormatter writeData(TableFormatter tf, int elements) {
time.put(entry.getKey(), entry.getValue().get());
}
Map<Object, Long> singleTime = new HashMap<Object, Long>();
for (Map.Entry<Object, AtomicLong> entry : this.map.entrySet()) {
for (Map.Entry<Object, AtomicLong> entry : this.singleTime.entrySet()) {
singleTime.put(entry.getKey(), entry.getValue().get());
}
double totalTime = this.totalTime.get();
Expand Down Expand Up @@ -371,7 +371,7 @@ private static String niceName(Class<?> clazz) {

private final Map<Class<?>, AtomicInteger> invocationCount = new NonBlockingHashMap<Class<?>, AtomicInteger>();
private final Map<Class<?>, AtomicLong> time = new NonBlockingHashMap<Class<?>, AtomicLong>();
private final Map<Object, AtomicLong> map = new NonBlockingHashMap<Object, AtomicLong>();
private final Map<Object, AtomicLong> singleTime = new NonBlockingHashMap<Object, AtomicLong>();
private final Map<Object, AtomicLong> singleInvocationCount = new NonBlockingHashMap<Object, AtomicLong>();

private AtomicLong getSingleInvocationCount(Object o) {
Expand Down Expand Up @@ -406,13 +406,13 @@ private AtomicInteger getInvocationCount(Class<?> clazz) {
}

private AtomicLong getSingleTime(Object o) {
AtomicLong t = map.get(o);
AtomicLong t = singleTime.get(o);
if (t == null) {
synchronized (o) {
t = map.get(o);
t = singleTime.get(o);
if (t == null) {
t = new AtomicLong();
map.put(o, t);
singleTime.put(o, t);
}
}
}
Expand Down

0 comments on commit 17e2fda

Please sign in to comment.