a ”ˆ«hj ã@s,ddlZej ¡ZdgZGdd„deƒZdS)éNÚMonitorc@sÐeZdZdZedd„ƒZedd„ƒZedd„ƒZedd „ƒZed d „ƒZ ed d „ƒZ edd„ƒZ edd„ƒZ edd„ƒZ d&dd„Zdd„Zdd„Zedd„ƒZejdd„ƒZdd„Zd d!„Zd"d#„Zd$d%„ZdS)'rzô Base class for all monitors. Monitors provide data about the running system to Plugin objects, which use the data to tune system parameters. Following methods require reimplementation: - _init_available_devices(cls) - update(cls) cCsLd|_tƒ|_tƒ|_tƒ|_i|_| ¡d|_t dd  |j¡¡dS)NFTzavailable devices: %sú, ) Ú_class_initializedÚsetÚ _instancesÚ_available_devicesÚ_updating_devicesÚ_loadÚ_init_available_devicesÚlogÚdebugÚjoin©Úcls©rú7/usr/lib/python3.9/site-packages/tuned/monitors/base.pyÚ _init_classszMonitor._init_classcCs tƒ‚dS©N©ÚNotImplementedErrorrrrrr !szMonitor._init_available_devicescCs"| ¡t dd |j¡¡dS)Nz available devices updated to: %sr)r r r r rrrrrÚ_update_available_devices%s ÿz!Monitor._update_available_devicescCs|jSr)rrrrrÚget_available_devices+szMonitor.get_available_devicescCs tƒ‚dSrrrrrrÚupdate/szMonitor.updatecCs|j |¡dSr)rÚadd©rÚinstancerrrÚ_register_instance3szMonitor._register_instancecCs|j |¡dSr)rÚremoverrrrÚ_deregister_instance7szMonitor._deregister_instancecCs6tƒ}|jD]}||jO}q |j ¡|j |¡dSr)rrÚdevicesrÚclearr)rZ new_updatingrrrrÚ_refresh_updating_devices;s    z!Monitor._refresh_updating_devicescCs|jSr)rrrrrÚ instancesCszMonitor.instancesNcCsBt|dƒs| ¡| |¡|dur,||_n | ¡|_| ¡dS)Nr)Úhasattrrrrrr)ÚselfrrrrÚ__init__Is   zMonitor.__init__cCsz | ¡Wn Yn0dSr)Úcleanup©r$rrrÚ__del__Ws zMonitor.__del__cCs| |¡| ¡dSr)rr!r'rrrr&]s zMonitor.cleanupcCs|jSr©Ú_devicesr'rrrraszMonitor.devicescCs |jt|ƒ@}||_| ¡dSr)rrr*r!)r$ÚvalueZ new_devicesrrrrescCs.| ¡||jvr*|j |¡|j |¡dSr)rrr*rr©r$ZdevicerrrÚ add_deviceks  zMonitor.add_devicecCs&||jvr"|j |¡|j |¡dSr)r*rrr,rrrÚ remove_devicers  zMonitor.remove_devicecs t‡fdd„tˆj ¡ƒDƒƒS)Ncsg|]}|dˆjvr|‘qS)rr))Ú.0Zdev_loadr'rrÚ yóz$Monitor.get_load..)ÚdictÚlistr Úitemsr'rr'rÚget_loadxszMonitor.get_loadcCs|j |d¡Sr)r Úgetr,rrrÚget_device_load{szMonitor.get_device_load)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú classmethodrr rrrrrr!r"r%r(r&ÚpropertyrÚsetterr-r.r5r7rrrrrs<             )Z tuned.logsZtunedZlogsr6r Ú__all__ÚobjectrrrrrÚs