File: //usr/lib/python3.6/site-packages/glances/amps/__pycache__/glances_nginx.cpython-36.opt-1.pyc
3
Eo�c/
� @ s8 d Z ddlZddlmZ ddlmZ G dd� de�ZdS )ux
Nginx AMP
=========
Monitor the Nginx process using the status page.
How to read the stats
---------------------
Active connections – Number of all open connections. This doesn't mean number of users.
A single user, for a single page-view can open many concurrent connections to your server.
Server accepts handled requests – This shows three values.
First is total accepted connections.
Second is total handled connections. Usually first 2 values are same.
Third value is number of and handles requests. This is usually greater than second value.
Dividing third-value by second-one will give you number of requests per connection handled
by Nginx. In above example, 10993/7368, 1.49 requests per connections.
Reading – nginx reads request header
Writing – nginx reads request body, processes request, or writes response to a client
Waiting – keep-alive connections, actually it is active – (reading + writing).
This value depends on keepalive-timeout. Do not confuse non-zero waiting value for poor
performance. It can be ignored.
Source reference: https://easyengine.io/tutorials/nginx/status-page/
Configuration file example
--------------------------
[amp_nginx]
# Nginx status page should be enable (https://easyengine.io/tutorials/nginx/status-page/)
enable=true
regex=\/usr\/sbin\/nginx
refresh=60
one_line=false
status_url=http://localhost/nginx_status
� N)�logger)�
GlancesAmpc @ s, e Zd ZdZdZdZdZdZdZdd� Z d S )
�AmpzGlances' Nginx AMP.ZNginxz1.0z Get Nginx stats from status-pageZ Nicolargozcontact@nicolargo.comc C sh t jdj| j| jd��� tj| jd��}|jrB| j|jj � � nt jdj| j| jd�|j
�� | j� S )zUpdate the AMPz${}: Update stats using status URL {}Z
status_urlz#{}: Can not grab status URL {} ({}))r �debug�format�NAME�get�requests�okZ
set_result�text�rstrip�reason�result)�selfZprocess_list�res� r �#/usr/lib/python3.6/glances_nginx.py�updateB s z
Amp.updateN)
�__name__�
__module__�__qualname__�__doc__r �VERSIONZDESCRIPTIONZAUTHORZEMAILr r r r r r 5 s r )r r Zglances.loggerr Zglances.amps.glances_ampr r r r r r �<module>- s