gatherer_manager.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:opserv-backend 作者: OpServ-Monitoring 项目源码 文件源码
def handle_gathering_event(cls, gather_obj):
        '''
            This is the method called by the scheduler when an event expires
            This basically takes the gatherer instance given as args to the scheduler
            And calls its measurement function.
            To avoid timing issues while measuring a new event for the next call is
            created before the measurement call.
        '''
        delay_in_sec = ms_to_sec(gather_obj.delayms)
        new_gather_event = cls.scheduler.enter(delay_in_sec, GATHERING_EVENT_PRIORITY,
                                               cls.handle_gathering_event,
                                               kwargs={
                                                   "gather_obj": gather_obj
                                               })

        gather_obj.set_event(new_gather_event)

        gather_obj.measure()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号