NAME

NetServer::Portal::Top - Make event loop statistics easily available

SYNOPSIS

require NetServer::Portal::Top;

DESCRIPTION

All statistics collected by Event are displayed in a format similar to the popular (and excellent) top program.

PRECISE STAT DEFINITIONS

  • idle

    Idle tracks the amount of time that the process cooperatively reliquished control to the operating system. (Usually via select or poll.)

  • other processes

    Attempts to estimate the process's non-idle time that the operating system instead gave to other processes. (Actual clock time minus the combined total time spent in idle and in running event handlers.) This stat is an underestimate (lower bound) since the process can also be preemptively interrupted during event processing.

  • lag

    Lag is the percent over the planned amount of time that the event loop took to complete. ((Actual time - planned time) / planned time)

It is unfortunately that more intuitive stats are not available. Benchmarking is a slippery business. If you have ideas for improvements, don't be shy!

SCREENSHOT

pl/3bork  [12836 @ eq1062]                                    12:15:18 [  15s]
21 events (6 zombies); load averages: 0.33, 0.32, 0.32                        
                                                                              
 EID PRI STATE  RAN  TIME  CPU  TYPE DESCRIPTION                            P1
   0   8 sleep  247  0:09 66.7%  sys idle                                     
  24   4 sleep  105  0:04 28.1% idle QSGTable sweep                           
   3   4 sleep   15  0:00  2.4% time server status                            
  22   4 sleep   15  0:00  1.8% time QSGTable                                 
  12   4 cpu      4  0:00  0.8% time NetServer::Portal::Client localhost      
  23   4 sleep   15  0:00  0.1% time QSGTable Detail                          
   2   4 sleep   15  0:00  0.0% time Qt                                       
   7   4 sleep    8  0:00  0.0% time ObjStore::Serve checkpoint               
  10   4 sleep    8  0:00  0.0% time SSL items                                
   9   4 sleep    8  0:00  0.0% time SSL service                              
   6  -1 sleep    5  0:00  0.0% time Event::Stats                             
  21   4 zomb     0  0:00  0.0% idle QSGTable sweep                           
  19   4 zomb     0  0:00  0.0% time QSGTable                                 
  11   4 sleep    0  0:00  0.0%   io NetServer::Portal::Client localhost      
   8   4 sleep    0  0:00  0.0%   io SSL                                      
  13   4 zomb     0  0:00  0.0% time QSGTable                                 

The three load averages are for the most recent 15 seconds, 1 minute, and 15 minutes, respectively.

For efficiency, not all time intervals are available. When you change the time interval, it will be rounded to the closest for which there is data.

BUGS

The potential impact of multiple CPUs and kernel-level thread support is ignored.