GOSSIP-17 Add metrics (Chandresh Pancholi via egc)
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.apache.gossip.manager;
|
||||
|
||||
import com.codahale.metrics.MetricRegistry;
|
||||
import java.net.URI;
|
||||
|
||||
import org.apache.gossip.GossipSettings;
|
||||
@ -30,6 +31,8 @@ import io.teknek.tunit.TUnit;
|
||||
|
||||
public class DataReaperTest {
|
||||
|
||||
private final MetricRegistry registry = new MetricRegistry();
|
||||
|
||||
@Test
|
||||
public void testReaperOneShot() {
|
||||
String myId = "4";
|
||||
@ -37,7 +40,7 @@ public class DataReaperTest {
|
||||
String value = "a";
|
||||
GossipSettings settings = new GossipSettings();
|
||||
GossipManager gm = RandomGossipManager.newBuilder().cluster("abc").settings(settings)
|
||||
.withId(myId).uri(URI.create("udp://localhost:6000")).build();
|
||||
.withId(myId).uri(URI.create("udp://localhost:6000")).registry(registry).build();
|
||||
gm.init();
|
||||
gm.gossipPerNodeData(perNodeDatum(key, value));
|
||||
gm.gossipSharedData(sharedDatum(key, value));
|
||||
@ -68,7 +71,6 @@ public class DataReaperTest {
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testHigherTimestampWins() {
|
||||
String myId = "4";
|
||||
@ -76,7 +78,7 @@ public class DataReaperTest {
|
||||
String value = "a";
|
||||
GossipSettings settings = new GossipSettings();
|
||||
GossipManager gm = RandomGossipManager.newBuilder().cluster("abc").settings(settings)
|
||||
.withId(myId).uri(URI.create("udp://localhost:7000")).build();
|
||||
.withId(myId).uri(URI.create("udp://localhost:7000")).registry(registry).build();
|
||||
gm.init();
|
||||
GossipDataMessage before = perNodeDatum(key, value);
|
||||
GossipDataMessage after = perNodeDatum(key, "b");
|
||||
|
Reference in New Issue
Block a user