H:j d dl Z d dlZd dlZd dlZd dlmZmZmZ d dlmZ d dl m
Z
d dlmZ d dl
mZ d dlmZ d dlmZmZ d d lmZmZ d
Z e j e j e j d Z e j d
Ze e j d e e j! e" e G d d Z# G d ded Z$ G d de Z%dS ) N) TypedDict
NamedTupleSelf)ChainMap)ProcLve)PyLve)LVE_DEFAULT)LVEStat)read_raw_configget_boolean)OverloadCheckerread_times_from_procz+/var/run/cloudlinux/effective-normal-limits)levelBurstWatcherz"/var/log/lvestats-burstwatcher.logz%%(asctime)s %(levelname)s %(message)sc H e Zd ZddZddZd ZdefdZd Zd Z d e
fd
ZdS )ServicereturnNc . t | _ | j st d t }|j | _ t |j |j
t | _ i | _
i | _ d S )Nzpylve initialization failed)idle_time_thresholdmax_samples_number get_stats)r _pylve
initializeRuntimeError_Configread_from_config_fileenabled_enabledr
r max_samplesr _overload_checker_current_bursting_lves_effective_normal_limits)selfconfigs /builddir/build/BUILDROOT/lve-stats-5.0.4-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/burstwatcher/service.py__init__zService.__init__# s gg{%%'' ><===..00
!0 & :%1*"
"
"
')#(*%%% c , d} t j d | j s| r=| | | n|dz dk r| d}|dz
})Nr T )timesleepr _is_server_overloaded_load_effective_normal_limits_get_current_bursting_lves_disable_bursting)r# cnts r% runzService.run2 s
JqMMM=
))++
22444//111&&((((rQ224441HC
r' c t t dd 5 }t j | }t | dk r|| _ d d d n# 1 swxY w Y nB# t t t j f$ r# t dt Y nw xY wt dt | j d S )NrzUTF-8)encodingr z7Can`t load cached effective normal limits from file: %sz*Loaded effective normal limits for %s lves)
openEFFECTIVE_NORMAL_LIMITS_PATHjsonloadsreadlenr" OSErrorIOErrorJSONDecodeErrorlogger exceptiondebug)r# floaded_effective_normal_limitss r% r. z%Service._load_effective_normal_limitsC s$ v2C'JJJ
Sa15AFFHH1E1E.566::4RD1
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S $"67 v v vVXtuuuuu vA3tGdCeCefffffs5 A2 AA&A2 &A**A2 -A*.A2 2