def gather_sample(self):
        try:
            for idx, metric in enumerate(METRICS):
                metric_name = metric.config['metric_name']
                for (metric_value, extra_fields) in metric.dispatch():
                    # We might get this metric value if we were doing the io counters metrics and the user has
                    # not turned on disk performance yet.
                    if metric_value == __NO_DISK_PERF__:
                        self._logger.warn('disk.io metrics disabled.  You may need to run "diskperf -y" on machine'
                                          'to enable IO counters', limit_once_per_x_secs=3600, limit_key='win_diskperf',
                                          error_code='win32DiskPerDisabled')
                    else:
                        if extra_fields is None:
                            extra_fields = metric.config['extra_fields']
                        self._logger.emit_value(
                            metric_name,
                            metric_value,
                            extra_fields=extra_fields
                    )
        except:
            self._logger.exception('Failed to gather sample due to exception')
Comments and Likes/Dislikes box for an object
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/builtin_monitors/windows_system_metrics.py/SystemMonitor.gather_sample--crossover with--dataset/ETHPy150Open treeio/treeio/treeio/core/templatetags/object.py/comments_likes