File tree Expand file tree Collapse file tree 3 files changed +21
-20
lines changed Expand file tree Collapse file tree 3 files changed +21
-20
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ namespace raylet {
1010
1111ActorRegistration::ActorRegistration (const  ActorTableDataT &actor_table_data)
1212    : actor_table_data_(actor_table_data),
13-       alive_ (true ),
1413      execution_dependency_ (ObjectID::nil()),
1514      frontier_() {}
1615
@@ -44,16 +43,7 @@ bool ActorRegistration::IsAlive() const {
4443  return  actor_table_data_.state  == ActorState::ALIVE;
4544}
4645
47- std::string ActorRegistration::DebugString () const  {
48-   std::stringstream result;
49-   if  (alive_) {
50-     result << " alive" 
51-   } else  {
52-     result << " dead" 
53-   }
54-   result << " , num handles: " size ();
55-   return  result.str ();
56- }
46+ int  ActorRegistration::NumHandles () const  { return  frontier_.size (); }
5747
5848}  //  namespace raylet
5949
Original file line number Diff line number Diff line change @@ -94,17 +94,15 @@ class ActorRegistration {
9494  // / \return True if the local actor is alive and false if it is dead.
9595  bool  IsAlive () const ;
9696
97-   // / Returns debug string for class .
97+   // / Returns num handles to this actor entry .
9898  // /
99-   // / \return string .
100-   std::string  DebugString () const ;
99+   // / \return int .
100+   int   NumHandles () const ;
101101
102102 private: 
103103  // / Information from the global actor table about this actor, including the
104104  // / node manager location.
105105  ActorTableDataT actor_table_data_;
106-   // / True if the actor is alive and false otherwise.
107-   bool  alive_;
108106  // / The object representing the state following the actor's most recently
109107  // / executed task. The next task to execute on the actor should be marked as
110108  // / execution-dependent on this object.
Original file line number Diff line number Diff line change @@ -1764,14 +1764,27 @@ std::string NodeManager::DebugString() const {
17641764  result << " \n " DebugString ();
17651765  result << " \n " DebugString ();
17661766  result << " \n " DebugString ();
1767+   result << " \n ActorRegistry:" 
1768+   int  live_actors = 0 ;
1769+   int  dead_actors = 0 ;
1770+   int  max_num_handles = 0 ;
1771+   for  (auto  &pair : actor_registry_) {
1772+     if  (pair.second .IsAlive ()) {
1773+       live_actors += 1 ;
1774+     } else  {
1775+       dead_actors += 1 ;
1776+     }
1777+     if  (pair.second .NumHandles () > max_num_handles) {
1778+       max_num_handles = pair.second .NumHandles ();
1779+     }
1780+   }
1781+   result << " \n - num live actors: " 
1782+   result << " \n - num dead actors: " 
1783+   result << " \n - max num handles: " 
17671784  result << " \n RemoteConnections:" 
17681785  for  (auto  &pair : remote_server_connections_) {
17691786    result << " \n " first .hex () << " : " second ->DebugString ();
17701787  }
1771-   result << " \n ActorRegistry:" 
1772-   for  (auto  &pair : actor_registry_) {
1773-     result << " \n " first .hex () << " : " second .DebugString ();
1774-   }
17751788  result << " \n DebugString() time ms: " current_time_ms () - now_ms);
17761789  return  result.str ();
17771790}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments