forked from belaban/JGroups
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
550 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/org/jgroups/gossiprouter/metrics/GossipRouterGroupMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.jgroups.gossiprouter.metrics; | ||
|
||
import org.jgroups.Address; | ||
import org.jgroups.PhysicalAddress; | ||
|
||
import java.util.function.IntSupplier; | ||
|
||
public interface GossipRouterGroupMetrics { | ||
|
||
GossipRouterMemberMetrics registerMember(Address logicalAddress, PhysicalAddress physicalAddress, String logicalName); | ||
|
||
void setGroupSize(IntSupplier groupSizeSupplier); | ||
|
||
void incrementRegisterEvents(); | ||
|
||
void incrementUnregisterEvents(); | ||
|
||
void incrementSuspectEvents(); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/org/jgroups/gossiprouter/metrics/GossipRouterMemberMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.jgroups.gossiprouter.metrics; | ||
|
||
public interface GossipRouterMemberMetrics { | ||
void addUnicastMessageReceived(int bytes); | ||
|
||
void addMulticastMessageReceived(int bytes); | ||
|
||
void addUnicastMessageSent(int bytes); | ||
|
||
void addMulticastMessageSent(int bytes); | ||
|
||
void onDisconnect(); | ||
|
||
void unregister(); | ||
} |
6 changes: 6 additions & 0 deletions
6
src/org/jgroups/gossiprouter/metrics/GossipRouterMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.jgroups.gossiprouter.metrics; | ||
|
||
public interface GossipRouterMetrics { | ||
|
||
GossipRouterGroupMetrics createGroupMetrics(String name); | ||
} |
77 changes: 77 additions & 0 deletions
77
src/org/jgroups/gossiprouter/metrics/NoOpGossipRouterMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package org.jgroups.gossiprouter.metrics; | ||
|
||
import org.jgroups.Address; | ||
import org.jgroups.PhysicalAddress; | ||
|
||
import java.util.function.IntSupplier; | ||
|
||
public final class NoOpGossipRouterMetrics implements GossipRouterMetrics { | ||
|
||
public static final NoOpGossipRouterMetrics INSTANCE = new NoOpGossipRouterMetrics(); | ||
private static final GossipRouterMemberMetrics MEMBER_METRICS = new GossipRouterMemberMetrics() { | ||
@Override | ||
public void addUnicastMessageReceived(int bytes) { | ||
|
||
} | ||
|
||
@Override | ||
public void addMulticastMessageReceived(int bytes) { | ||
|
||
} | ||
|
||
@Override | ||
public void addUnicastMessageSent(int bytes) { | ||
|
||
} | ||
|
||
@Override | ||
public void addMulticastMessageSent(int bytes) { | ||
|
||
} | ||
|
||
@Override | ||
public void onDisconnect() { | ||
|
||
} | ||
|
||
@Override | ||
public void unregister() { | ||
|
||
} | ||
}; | ||
private static final GossipRouterGroupMetrics GROUP_METRICS = new GossipRouterGroupMetrics() { | ||
@Override | ||
public GossipRouterMemberMetrics registerMember(Address logicalAddress, PhysicalAddress physicalAddress, String logicalName) { | ||
return MEMBER_METRICS; | ||
} | ||
|
||
@Override | ||
public void setGroupSize(IntSupplier groupSizeSupplier) { | ||
|
||
} | ||
|
||
@Override | ||
public void incrementRegisterEvents() { | ||
|
||
} | ||
|
||
@Override | ||
public void incrementUnregisterEvents() { | ||
|
||
} | ||
|
||
@Override | ||
public void incrementSuspectEvents() { | ||
|
||
} | ||
}; | ||
|
||
private NoOpGossipRouterMetrics() { | ||
} | ||
|
||
@Override | ||
public GossipRouterGroupMetrics createGroupMetrics(String name) { | ||
return GROUP_METRICS; | ||
} | ||
|
||
} |
Oops, something went wrong.