Skip to content

Commit

Permalink
Merge pull request #1640 from pveentjer/cleanup/monitor
Browse files Browse the repository at this point in the history
Cleaned up the monitor package
  • Loading branch information
noctarius committed Jan 28, 2014
2 parents 17bd6a8 + 703ef6b commit a6a1789
Show file tree
Hide file tree
Showing 13 changed files with 110 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@

public interface LocalInstanceStats extends DataSerializable {

public long getCreationTime();
long getCreationTime();

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,5 @@

package com.hazelcast.monitor;

/**
* User: sancar
* Date: 4/10/13
* Time: 2:28 PM
*/
public interface LocalMultiMapStats extends LocalMapStats {
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Local queue statistics.
*/
public interface LocalQueueStats extends LocalInstanceStats {

/**
* Returns the number of owned items in this member.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package com.hazelcast.monitor;

/**
* User: eminn
* Date: 03/12/13
* Time: 10:48 AM
*/
public interface NearCacheStats extends LocalInstanceStats {

/**
* Returns the creation time of this NearCache on this member
*
Expand All @@ -20,7 +16,6 @@ public interface NearCacheStats extends LocalInstanceStats {
*/
long getOwnedEntryCount();


/**
* Returns memory cost (number of bytes) of entries in this cache.
*
Expand Down Expand Up @@ -48,6 +43,4 @@ public interface NearCacheStats extends LocalInstanceStats {
* @return hit/miss ratio.
*/
double getRatio();


}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Set;

public class TimedMemberState implements DataSerializable, Cloneable {

long time;
MemberState memberState = null;
Set<String> instanceNames = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,34 +57,42 @@ public void cancelExecution() {
cancelled.incrementAndGet();
}

@Override
public long getCreationTime() {
return creationTime;
}

@Override
public long getPendingTaskCount() {
return pending.get();
}

@Override
public long getStartedTaskCount() {
return started.get();
}

@Override
public long getCompletedTaskCount() {
return completed.get();
}

@Override
public long getCancelledTaskCount() {
return cancelled.get();
}

@Override
public long getTotalStartLatency() {
return totalStartLatency.get();
}

@Override
public long getTotalExecutionLatency() {
return totalExecutionTime.get();
}

@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeLong(creationTime);
out.writeLong(pending.get());
Expand All @@ -94,6 +102,7 @@ public void writeData(ObjectDataOutput out) throws IOException {
out.writeLong(totalExecutionTime.get());
}

@Override
public void readData(ObjectDataInput in) throws IOException {
creationTime = in.readLong();
pending.set(in.readLong());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public LocalMapStatsImpl() {
creationTime = Clock.currentTimeMillis();
}

@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeLong(getCount.get());
out.writeLong(putCount.get());
Expand Down Expand Up @@ -90,6 +91,7 @@ public void writeData(ObjectDataOutput out) throws IOException {
}
}

@Override
public void readData(ObjectDataInput in) throws IOException {
getCount.set(in.readLong());
putCount.set(in.readLong());
Expand Down Expand Up @@ -122,6 +124,7 @@ public void readData(ObjectDataInput in) throws IOException {
}
}

@Override
public long getOwnedEntryCount() {
return ownedEntryCount;
}
Expand All @@ -130,6 +133,7 @@ public void setOwnedEntryCount(long ownedEntryCount) {
this.ownedEntryCount = ownedEntryCount;
}

@Override
public long getBackupEntryCount() {
return backupEntryCount;
}
Expand All @@ -138,6 +142,7 @@ public void setBackupEntryCount(long backupEntryCount) {
this.backupEntryCount = backupEntryCount;
}

@Override
public int getBackupCount() {
return backupCount;
}
Expand All @@ -146,6 +151,7 @@ public void setBackupCount(int backupCount) {
this.backupCount = backupCount;
}

@Override
public long getOwnedEntryMemoryCost() {
return ownedEntryMemoryCost;
}
Expand All @@ -154,6 +160,7 @@ public void setOwnedEntryMemoryCost(long ownedEntryMemoryCost) {
this.ownedEntryMemoryCost = ownedEntryMemoryCost;
}

@Override
public long getBackupEntryMemoryCost() {
return backupEntryMemoryCost;
}
Expand All @@ -162,10 +169,12 @@ public void setBackupEntryMemoryCost(long backupEntryMemoryCost) {
this.backupEntryMemoryCost = backupEntryMemoryCost;
}

@Override
public long getCreationTime() {
return creationTime;
}

@Override
public long getLastAccessTime() {
return lastAccessTime.get();
}
Expand All @@ -174,6 +183,7 @@ public void setLastAccessTime(long lastAccessTime) {
this.lastAccessTime.set(Math.max(this.lastAccessTime.get(), lastAccessTime));
}

@Override
public long getLastUpdateTime() {
return lastUpdateTime.get();
}
Expand All @@ -182,6 +192,7 @@ public void setLastUpdateTime(long lastUpdateTime) {
this.lastUpdateTime.set(Math.max(this.lastUpdateTime.get(), lastUpdateTime));
}

@Override
public long getHits() {
return hits.get();
}
Expand All @@ -190,6 +201,7 @@ public void setHits(long hits) {
this.hits.set(hits);
}

@Override
public long getLockedEntryCount() {
return lockedEntryCount;
}
Expand All @@ -198,6 +210,7 @@ public void setLockedEntryCount(long lockedEntryCount) {
this.lockedEntryCount = lockedEntryCount;
}

@Override
public long getDirtyEntryCount() {
return dirtyEntryCount;
}
Expand All @@ -206,10 +219,12 @@ public void setDirtyEntryCount(long l) {
this.dirtyEntryCount = l;
}

@Override
public long total() {
return putCount.get() + getCount.get() + removeCount.get() + numberOfOtherOperations.get();
}

@Override
public long getPutOperationCount() {
return putCount.get();
}
Expand All @@ -220,6 +235,7 @@ public void incrementPuts(long latency) {
maxPutLatency.set(Math.max(maxPutLatency.get(), latency));
}

@Override
public long getGetOperationCount() {
return getCount.get();
}
Expand All @@ -230,6 +246,7 @@ public void incrementGets(long latency) {
maxGetLatency.set(Math.max(maxGetLatency.get(), latency));
}

@Override
public long getRemoveOperationCount() {
return removeCount.get();
}
Expand All @@ -240,30 +257,37 @@ public void incrementRemoves(long latency) {
maxRemoveLatency.set(Math.max(maxRemoveLatency.get(), latency));
}

@Override
public long getTotalPutLatency() {
return totalPutLatencies.get();
}

@Override
public long getTotalGetLatency() {
return totalGetLatencies.get();
}

@Override
public long getTotalRemoveLatency() {
return totalRemoveLatencies.get();
}

@Override
public long getMaxPutLatency() {
return maxPutLatency.get();
}

@Override
public long getMaxGetLatency() {
return maxGetLatency.get();
}

@Override
public long getMaxRemoveLatency() {
return maxRemoveLatency.get();
}

@Override
public long getOtherOperationCount() {
return numberOfOtherOperations.get();
}
Expand All @@ -272,6 +296,7 @@ public void incrementOtherOperations() {
numberOfOtherOperations.incrementAndGet();
}

@Override
public long getEventOperationCount() {
return numberOfEvents.get();
}
Expand All @@ -284,10 +309,12 @@ public void setHeapCost(long heapCost) {
this.heapCost = heapCost;
}

@Override
public long getHeapCost() {
return heapCost;
}

@Override
public NearCacheStatsImpl getNearCacheStats() {
return nearCacheStats;
}
Expand All @@ -296,6 +323,7 @@ public void setNearCacheStats(NearCacheStatsImpl nearCacheStats) {
this.nearCacheStats = nearCacheStats;
}

@Override
public String toString() {
return "LocalMapStatsImpl{" +
"lastAccessTime=" + lastAccessTime +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,5 @@

import com.hazelcast.monitor.LocalMultiMapStats;

/**
* User: sancar
* Date: 4/10/13
* Time: 2:34 PM
*/
public class LocalMultiMapStatsImpl extends LocalMapStatsImpl implements LocalMultiMapStats {
}

0 comments on commit a6a1789

Please sign in to comment.