public class ClusterMetricsCollector
extends java.lang.Object
implements akka.actor.Actor, akka.actor.ActorLogging
Actor responsible for periodic data sampling in the node and publication to the cluster.
Constructor and Description |
---|
ClusterMetricsCollector() |
Modifier and Type | Method and Description |
---|---|
void |
addMember(akka.cluster.Member member)
Adds a member to the node ring.
|
akka.cluster.Cluster |
cluster() |
MetricsCollector |
collector()
The metrics collector that samples data on the node.
|
void |
gossip()
Gossip to peer nodes.
|
akka.actor.Cancellable |
gossipTask()
Start periodic gossip to random nodes in cluster
|
void |
gossipTo(akka.actor.Address address) |
MetricsGossip |
latestGossip()
The latest metric values with their statistical data.
|
ClusterMetricsExtension |
metrics() |
scala.collection.immutable.SortedSet<akka.actor.Address> |
nodes()
The node ring gossipped that contains only members that are Up.
|
void |
postStop() |
void |
preStart() |
void |
publish()
Publishes to the event stream.
|
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive() |
void |
receiveGossip(MetricsGossipEnvelope envelope)
Receives changes from peer nodes, merges remote with local gossip nodes, then publishes
changes to the event stream for load balancing router consumption, and gossip back.
|
void |
receiveState(akka.cluster.ClusterEvent.CurrentClusterState state)
Updates the initial node ring for those nodes that are
MemberStatus Up . |
void |
removeMember(akka.cluster.Member member)
Removes a member from the member node ring.
|
void |
replyGossipTo(akka.actor.Address address) |
void |
sample()
Samples the latest metrics for the node, updates metrics statistics in
MetricsGossip , and publishes the change to the event bus. |
akka.actor.Cancellable |
sampleTask()
Start periodic metrics collection
|
scala.Option<akka.actor.Address> |
selectRandomNode(scala.collection.immutable.IndexedSeq<akka.actor.Address> addresses) |
void |
sendGossip(akka.actor.Address address,
MetricsGossipEnvelope envelope) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public akka.cluster.Cluster cluster()
public ClusterMetricsExtension metrics()
public scala.collection.immutable.SortedSet<akka.actor.Address> nodes()
public MetricsGossip latestGossip()
public MetricsCollector collector()
public akka.actor.Cancellable gossipTask()
public akka.actor.Cancellable sampleTask()
public void preStart()
preStart
in interface akka.actor.Actor
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
receive
in interface akka.actor.Actor
public void postStop()
postStop
in interface akka.actor.Actor
public void addMember(akka.cluster.Member member)
member
- (undocumented)public void removeMember(akka.cluster.Member member)
member
- (undocumented)public void receiveState(akka.cluster.ClusterEvent.CurrentClusterState state)
MemberStatus
Up
.state
- (undocumented)public void sample()
MetricsGossip
, and publishes the change to the event bus.
MetricsCollector
public void receiveGossip(MetricsGossipEnvelope envelope)
envelope
- (undocumented)public void gossip()
public void gossipTo(akka.actor.Address address)
public void replyGossipTo(akka.actor.Address address)
public void sendGossip(akka.actor.Address address, MetricsGossipEnvelope envelope)
public scala.Option<akka.actor.Address> selectRandomNode(scala.collection.immutable.IndexedSeq<akka.actor.Address> addresses)
public void publish()