|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.cluster.ClusterMetricsCollector
public class ClusterMetricsCollector
INTERNAL API.
Cluster metrics is primarily for load-balancing of nodes. It controls metrics sampling at a regular frequency, prepares highly variable data for further analysis by other entities, and publishes the latest cluster metrics data around the node ring and local eventStream to assist in determining the need to redirect traffic to the least-loaded nodes.
Metrics sampling is delegated to the MetricsCollector
.
Smoothing of the data for each monitored process is delegated to the
EWMA
for exponential weighted moving average.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface akka.actor.Actor |
---|
Actor.emptyBehavior$ |
Constructor Summary | |
---|---|
ClusterMetricsCollector(ActorRef publisher)
|
Method Summary | |
---|---|
void |
addMember(Member member)
Adds a member to the node ring. |
Cluster |
cluster()
|
void |
collect()
Samples the latest metrics for the node, updates metrics statistics in MetricsGossip , and publishes the change to the event bus. |
MetricsCollector |
collector()
The metrics collector that samples data on the node. |
void |
gossip()
Gossip to peer nodes. |
Cancellable |
gossipTask()
Start periodic gossip to random nodes in cluster |
void |
gossipTo(Address address)
|
MetricsGossip |
latestGossip()
The latest metric values with their statistical data. |
Cancellable |
metricsTask()
Start periodic metrics collection |
scala.collection.immutable.SortedSet<Address> |
nodes()
The node ring gossipped that contains only members that are Up. |
void |
postStop()
User overridable callback. |
void |
preStart()
User overridable callback. |
void |
publish()
Publishes to the event stream. |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive()
This defines the initial actor behavior, it must return a partial function with the actor logic. |
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(ClusterEvent.CurrentClusterState state)
Updates the initial node ring for those nodes that are akka.cluster.MemberStatus.Up . |
void |
removeMember(Member member)
Removes a member from the member node ring. |
void |
replyGossipTo(Address address)
|
scala.Option<Address> |
selectRandomNode(scala.collection.immutable.IndexedSeq<Address> addresses)
|
void |
sendGossip(Address address,
MetricsGossipEnvelope envelope)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface akka.actor.Actor |
---|
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, postRestart, preRestart, self, sender, supervisorStrategy, unhandled |
Methods inherited from interface akka.actor.ActorLogging |
---|
_log, log |
Constructor Detail |
---|
public ClusterMetricsCollector(ActorRef publisher)
Method Detail |
---|
public Cluster cluster()
public scala.collection.immutable.SortedSet<Address> nodes()
public MetricsGossip latestGossip()
public MetricsCollector collector()
public Cancellable gossipTask()
public Cancellable metricsTask()
public void preStart()
Actor
preStart
in interface Actor
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Actor
receive
in interface Actor
public void postStop()
Actor
postStop
in interface Actor
public void addMember(Member member)
member
- (undocumented)public void removeMember(Member member)
member
- (undocumented)public void receiveState(ClusterEvent.CurrentClusterState state)
akka.cluster.MemberStatus.Up
.
state
- (undocumented)public void collect()
MetricsGossip
, and publishes the change to the event bus.
akka.cluster.ClusterMetricsCollector.collect( )
public void receiveGossip(MetricsGossipEnvelope envelope)
envelope
- (undocumented)public void gossip()
public void gossipTo(Address address)
public void replyGossipTo(Address address)
public void sendGossip(Address address, MetricsGossipEnvelope envelope)
public scala.Option<Address> selectRandomNode(scala.collection.immutable.IndexedSeq<Address> addresses)
public void publish()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |