Skip to content

Commit

Permalink
added JMX information on RetransmiTable to NAKACK
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Dec 10, 2010
1 parent 0b26f95 commit 6f01869
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/org/jgroups/protocols/pbcast/NAKACK.java
Expand Up @@ -473,6 +473,18 @@ public String printLossRates() {
return sb.toString();
}

@ManagedOperation(description="Returns the sizes of all NakReceiverWindow.RetransmitTables")
public String printRetransmitTableSizes() {
StringBuilder sb=new StringBuilder();
for(Map.Entry<Address,NakReceiverWindow> entry: xmit_table.entrySet()) {
NakReceiverWindow win=entry.getValue();
sb.append(entry.getKey() + ": ").append(win.getRetransmiTableSize())
.append(" (capacity=" + win.getRetransmitTableCapacity() + ")\n");
}
return sb.toString();
}


@ManagedAttribute
public double getAverageLossRate() {
double retval=0.0;
Expand Down
5 changes: 5 additions & 0 deletions src/org/jgroups/stack/NakReceiverWindow.java
Expand Up @@ -220,6 +220,11 @@ private void setSmoothedLossRate() {
}


public int getRetransmiTableSize() {return xmit_table.size();}

public int getRetransmitTableCapacity() {return xmit_table.capacity();}


/**
* Adds a message according to its seqno (sequence number).
* <p>
Expand Down

0 comments on commit 6f01869

Please sign in to comment.