# HG changeset patch # User Dominic Cleal # Date 1228997791 0 # Node ID d136d4894ea3e9605336537ba2ab2801820f513f # Parent e59e6471ce44a0f827809c6086795adeda6ce29b Missing type matching on per-type stats diff -r e59e6471ce44 -r d136d4894ea3 src/net/scatterspace/blitz/jmx/InstanceCountImpl.java --- a/src/net/scatterspace/blitz/jmx/InstanceCountImpl.java Thu Dec 11 00:49:28 2008 +0000 +++ b/src/net/scatterspace/blitz/jmx/InstanceCountImpl.java Thu Dec 11 12:16:31 2008 +0000 @@ -50,10 +50,14 @@ public int getCount() throws RemoteException { Iterator iter = getStatistics().iterator(); - if (!iter.hasNext()) - return 0; + while (iter.hasNext()) + { + InstanceCount inst = iter.next(); + if (inst.getType().equals(type_)) + return inst.getCount(); + } - return iter.next().getCount(); + return 0; } @Override diff -r e59e6471ce44 -r d136d4894ea3 src/net/scatterspace/blitz/jmx/OpImpl.java --- a/src/net/scatterspace/blitz/jmx/OpImpl.java Thu Dec 11 00:49:28 2008 +0000 +++ b/src/net/scatterspace/blitz/jmx/OpImpl.java Thu Dec 11 12:16:31 2008 +0000 @@ -53,7 +53,7 @@ while (iter.hasNext()) { OpStat op = iter.next(); - if (op.getOp() == OpStat.READS) + if (op.getType().equals(type_) && op.getOp() == OpStat.READS) return op.getCount(); } @@ -66,7 +66,7 @@ while (iter.hasNext()) { OpStat op = iter.next(); - if (op.getOp() == OpStat.TAKES) + if (op.getType().equals(type_) && op.getOp() == OpStat.TAKES) return op.getCount(); } @@ -79,7 +79,7 @@ while (iter.hasNext()) { OpStat op = iter.next(); - if (op.getOp() == OpStat.WRITES) + if (op.getType().equals(type_) && op.getOp() == OpStat.WRITES) return op.getCount(); }