block_reporter.py 文件源码

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

项目:stackimpact-python 作者: stackimpact 项目源码 文件源码
def record(self, duration):
        self.agent.log('Activating block profiler.')

        signal.setitimer(signal.ITIMER_REAL, self.SAMPLING_RATE, self.SAMPLING_RATE)
        time.sleep(duration)
        signal.setitimer(signal.ITIMER_REAL, 0)

        self.agent.log('Deactivating block profiler.')

        self.profile_duration += duration

        self.agent.log('Block profiler CPU overhead per activity second: {0} seconds'.format(self.profile._overhead / self.profile_duration))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号