예제 #1
0
 def _config_wall_profiling(self, disable_wall_profiling, period_ms):
   """Adds wall profiler if wall profiling is supported and not disabled."""
   # The Python signal module in Python versions older than 3.6 doesn't handle
   # signals properly. See b/123783496. The signal module changed significantly
   # in Python 3.6 and the problem no longer exists. For Python 2, the problem
   # theoretically can happen, but is much less likely to manifest. Users can
   # use it at their own risk.
   wall_profiling_supported = (
       sys.version_info >= (3, 6) or sys.version_info < (3, 0))
   if not wall_profiling_supported:
     logger.info('Wall profiling is not supported on the current Python '
                 'version. Python 2 and Python 3.6 and higher are supported')
   elif disable_wall_profiling:
     logger.info('Wall profiling is disabled by disable_wall_profiling')
   else:
     self._profilers['WALL'] = pythonprofiler.WallProfiler(period_ms)
 def _config_wall_profiling(self, disable_wall_profiling, period_ms):
   """Adds wall profiler if wall profiling is supported and not disabled."""
   if disable_wall_profiling:
     logger.info('Wall profiling is disabled by disable_wall_profiling')
   else:
     self._profilers['WALL'] = pythonprofiler.WallProfiler(period_ms)