Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/landscape/monitor/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/landscape/monitor/memoryinfo.pyc

ó
ÍÿŠTc@sfddlZddlmZddlmZddlmZddlmZdefd„ƒYZ	dS(iÿÿÿÿN(tCoverageMonitor(tMemoryStats(tAccumulator(t
MonitorPlugint
MemoryInfocBskeZdZdZdZdZdd
dejd„Zd„Z	d„Z
ed	„Zed
„Z
d„ZRS(s<Plugin captures information about free memory and free swap.smemory-infotmemoryii<s
/proc/meminfocCs1||_||_||_g|_||_dS(N(t	_intervalt_monitor_intervalt_source_filenamet_memory_infot_create_time(tselftintervaltmonitor_intervaltsource_filenametcreate_time((s@/usr/lib/python2.7/dist-packages/landscape/monitor/memoryinfo.pyt__init__s
				cCsÉtt|ƒj|ƒt|j|jjƒ|_|jjj	|j
|jƒt|j
ddd|j
ƒ|_|jjj	|j|jjƒ|jjjd|jjddƒ|jd|jtƒdS(Ngš™™™™™é?smemory/swap snapshotRtstoptpriorityiÐsmemory-info(tsuperRtregisterRt_persisttregistryt	step_sizet_accumulatetreactort
call_everyRtrunRR
t_monitorRtlogtcall_ontcall_on_acceptedtsend_messagetTrue(RR((s@/usr/lib/python2.7/dist-packages/landscape/monitor/memoryinfo.pyRs
"cCs$|j}g|_idd6|d6S(Nsmemory-infottype(R	(Rtmemory_info((s@/usr/lib/python2.7/dist-packages/landscape/monitor/memoryinfo.pytcreate_message&s		cCsB|jƒ}t|dƒr>|jjj||jd|ƒndS(Nsmemory-infoturgent(R$tlenRtbrokerR t_session_id(RR%tmessage((s@/usr/lib/python2.7/dist-packages/landscape/monitor/memoryinfo.pyR +scCs |jjjd|j|ƒdS(Nsmemory-info(RR'tcall_if_acceptedR (RR%((s@/usr/lib/python2.7/dist-packages/landscape/monitor/memoryinfo.pytexchange1scCs´|jjƒt|jƒƒ}t|jƒ}|j||jdƒ}|j||jdƒ}|r°|r°|d}t|dƒ}t|dƒ}|j	j
|||fƒndS(Nsaccumulate-memorysaccumulate-swapii(RtpingtintR
RRRtfree_memoryt	free_swapR	tappend(Rt
new_timestamptmemstatstmemory_step_datatswap_step_datat	timestampR.R/((s@/usr/lib/python2.7/dist-packages/landscape/monitor/memoryinfo.pyR5s

Ni(t__name__t
__module__t__doc__tpersist_nametscopetNonetrun_intervalttimeRRR$tFalseR R+R(((s@/usr/lib/python2.7/dist-packages/landscape/monitor/memoryinfo.pyR
s		(
R=tlandscape.lib.monitorRtlandscape.lib.sysstatsRtlandscape.accumulateRtlandscape.monitor.pluginRR(((s@/usr/lib/python2.7/dist-packages/landscape/monitor/memoryinfo.pyt<module>s