Improve Shard#entityCreated API performance #29520
Expose size of reachable actor count
This commit is contained in:
parent
32ec0428d3
commit
33fda3ae6f
1 changed files with 3 additions and 1 deletions
|
|
@ -358,6 +358,8 @@ private[akka] object Shard {
|
|||
// only called once during handoff
|
||||
def activeEntities(): Set[ActorRef] = byRef.keySet.asScala.toSet
|
||||
|
||||
def nrActiveEntities: Int = byRef.size
|
||||
|
||||
// only called for getting shard stats
|
||||
def activeEntityIds(): Set[EntityId] = byRef.values.asScala.toSet
|
||||
|
||||
|
|
@ -1059,7 +1061,7 @@ private[akka] class Shard(
|
|||
* of active entities.
|
||||
*/
|
||||
@InternalStableApi
|
||||
def entityCreated(@unused id: EntityId): Int = entities.activeEntities().size
|
||||
def entityCreated(@unused id: EntityId): Int = entities.nrActiveEntities
|
||||
|
||||
// ===== buffering while busy saving a start or stop when remembering entities =====
|
||||
def appendToMessageBuffer(id: EntityId, msg: Any, snd: ActorRef): Unit = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue