ó ¼ä Kc@s2ddladdladefd„ƒYZdS(iÿÿÿÿNt dstat_plugincBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(s Time from an NTP server. BEWARE: this dstat plugin typically takes a lot longer to run than system plugins and for that reason it is important to use an NTP server located nearby as well as make sure that it does not impact your other counters too much. cCs¹d|_d |_d |_tjdƒp-d|_tjdƒpEd|_d|_tt j |jt j ƒƒƒ|_ d |_ d |_tjtjtjƒ|_|jjd ƒdS(Ntntps date/timettimet DSTAT_TIMEFMTs%d-%m %H:%M:%StDSTAT_NTPSERVERs0.fedora.pool.ntp.orgtsil€~TgÐ?(s date/time(stime(tnametnicktvarstostgetenvttimefmtt ntpserverttypetlenRtstrftimet localtimetwidthtscaletepochtsockettAF_INETt SOCK_DGRAMt settimeout(tself((s/usr/share/dstat/dstat_ntp.pyt__init__s    $  cCsW|jjddd|jdfƒ|jjdƒ\}}tjd|ƒd|jS(Nsi/ti{is!12Ii (RtsendtoR trecvfromtstructtunpackR(Rtdatataddress((s/usr/share/dstat/dstat_ntp.pytgettime$s$cCs\y|jƒWnGtjk r4td|j‚n$tjk rWtd|j‚nXdS(Ns#Failed to connect to NTP server %s.s"Error connecting to NTP server %s.(R!Rtgaierrort ExceptionR terror(R((s/usr/share/dstat/dstat_ntp.pytcheck)s cCsfy/tj|jtj|jƒƒƒ|jds