Package akka.cluster.metrics
Class ClusterMetricsCollector
- java.lang.Object
-
- akka.cluster.metrics.ClusterMetricsCollector
-
- All Implemented Interfaces:
Actor
,ActorLogging
public class ClusterMetricsCollector extends java.lang.Object implements Actor, ActorLogging
The node ring gossipped that contains only members that are Up.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClusterMetricsCollector.GossipTick$
static class
ClusterMetricsCollector.MetricsTick$
-
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$
-
-
Constructor Summary
Constructors Constructor Description ClusterMetricsCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMember(Member member)
Adds a member to the node ring.protected void
akka$actor$Actor$_setter_$context_$eq(ActorContext x$1)
protected void
akka$actor$Actor$_setter_$self_$eq(ActorRef x$1)
The 'self' field holds the ActorRef for this actor.Cluster
cluster()
MetricsCollector
collector()
The metrics collector that samples data on the node.ActorContext
context()
Scala API: Stores the context for this actor, including self, and sender.void
gossip()
Gossip to peer nodes.Cancellable
gossipTask()
Start periodic gossip to random nodes in clustervoid
gossipTo(Address address)
MetricsGossip
latestGossip()
The latest metric values with their statistical data.void
latestGossip_$eq(MetricsGossip x$1)
ClusterMetricsExtension
metrics()
scala.collection.immutable.SortedSet<Address>
nodes()
The node ring gossipped that contains only members that are Up.void
nodes_$eq(scala.collection.immutable.SortedSet<Address> x$1)
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()
Scala API: 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 areMemberStatus
Up
.void
removeMember(Member member)
Removes a member from the member node ring.void
replyGossipTo(Address address)
void
sample()
Samples the latest metrics for the node, updates metrics statistics inMetricsGossip
, and publishes the change to the event bus.Cancellable
sampleTask()
Start periodic metrics collectionscala.Option<Address>
selectRandomNode(scala.collection.immutable.IndexedSeq<Address> addresses)
ActorRef
self()
The 'self' field holds the ActorRef for this actor.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, postRestart, preRestart, sender, supervisorStrategy, unhandled
-
Methods inherited from interface akka.actor.ActorLogging
_log_$eq, log
-
-
-
-
Method Detail
-
context
public ActorContext context()
Description copied from interface:Actor
Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward
.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
ActorContext
is the Scala API.getContext
returns aAbstractActor.ActorContext
, which is the Java API of the actor context.
-
self
public final ActorRef self()
Description copied from interface:Actor
The 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
-
akka$actor$Actor$_setter_$context_$eq
protected void akka$actor$Actor$_setter_$context_$eq(ActorContext x$1)
- Specified by:
akka$actor$Actor$_setter_$context_$eq
in interfaceActor
-
akka$actor$Actor$_setter_$self_$eq
protected final void akka$actor$Actor$_setter_$self_$eq(ActorRef x$1)
Description copied from interface:Actor
The 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
- Specified by:
akka$actor$Actor$_setter_$self_$eq
in interfaceActor
- Parameters:
x$1
- (undocumented)
-
cluster
public Cluster cluster()
-
metrics
public ClusterMetricsExtension metrics()
-
nodes
public scala.collection.immutable.SortedSet<Address> nodes()
The node ring gossipped that contains only members that are Up.- Returns:
- (undocumented)
-
nodes_$eq
public void nodes_$eq(scala.collection.immutable.SortedSet<Address> x$1)
-
latestGossip
public MetricsGossip latestGossip()
The latest metric values with their statistical data.- Returns:
- (undocumented)
-
latestGossip_$eq
public void latestGossip_$eq(MetricsGossip x$1)
-
collector
public MetricsCollector collector()
The metrics collector that samples data on the node.- Returns:
- (undocumented)
-
gossipTask
public Cancellable gossipTask()
Start periodic gossip to random nodes in cluster- Returns:
- (undocumented)
-
sampleTask
public Cancellable sampleTask()
Start periodic metrics collection- Returns:
- (undocumented)
-
preStart
public void preStart()
Description copied from interface:Actor
User overridable callback. Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.
-
receive
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Description copied from interface:Actor
Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.
-
postStop
public void postStop()
Description copied from interface:Actor
User overridable callback. Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.
-
addMember
public void addMember(Member member)
Adds a member to the node ring.- Parameters:
member
- (undocumented)
-
removeMember
public void removeMember(Member member)
Removes a member from the member node ring.- Parameters:
member
- (undocumented)
-
receiveState
public void receiveState(ClusterEvent.CurrentClusterState state)
Updates the initial node ring for those nodes that areMemberStatus
Up
.- Parameters:
state
- (undocumented)
-
sample
public void sample()
Samples the latest metrics for the node, updates metrics statistics inMetricsGossip
, and publishes the change to the event bus.- See Also:
MetricsCollector
-
receiveGossip
public 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.- Parameters:
envelope
- (undocumented)
-
gossip
public void gossip()
Gossip to peer nodes.
-
gossipTo
public void gossipTo(Address address)
-
replyGossipTo
public void replyGossipTo(Address address)
-
sendGossip
public void sendGossip(Address address, MetricsGossipEnvelope envelope)
-
selectRandomNode
public scala.Option<Address> selectRandomNode(scala.collection.immutable.IndexedSeq<Address> addresses)
-
publish
public void publish()
Publishes to the event stream.
-
-