Sets up the plugin stats collectors
182981
def _setup_stats_plugins(self):
        '''
        
        '''
        self.stats_dict['plugins'] = {}
        for key in self.plugins_dict:
            plugin_name = self.plugins_dict[key]['instance'].__class__.__name__
            temp_key = 'stats:redis-monitor:{p}'.format(p=plugin_name)
            self.stats_dict['plugins'][plugin_name] = {}
            for item in self.settings['STATS_TIMES']:
                try:
                    time = getattr(StatsCollector, item)

                    self.stats_dict['plugins'][plugin_name][time] = StatsCollector \
                            .get_rolling_time_window(
                                    redis_conn=self.redis_conn,
                                    key='{k}:{t}'.format(k=temp_key, t=time),
                                    window=time,
                                    cycle_time=self.settings['STATS_CYCLE'])
                    self.logger.debug("Set up {p} plugin Stats Collector '{i}'"\
                            .format(p=plugin_name, i=item))
                except AttributeError as e:
                    self.logger.warning("Unable to find Stats Time '{s}'"\
                            .format(s=item))
            total = StatsCollector.get_hll_counter(redis_conn=self.redis_conn,
                            key='{k}:lifetime'.format(k=temp_key),
                            cycle_time=self.settings['STATS_CYCLE'],
                            roll=False)
            self.logger.debug("Set up {p} plugin Stats Collector 'lifetime'"\
                            .format(p=plugin_name))
            self.stats_dict['plugins'][plugin_name]['lifetime'] = total
423390
def apply_plugin_settings(self, options):
        """"""
        for fig_browser in list(self.shellwidgets.values()):
            fig_browser.setup(**self.get_settings())
897629
def update(self,
               stats,
               duration=3):
        
        for plugin, attribute in self.plugins_list:
            # Check if the plugin exist and is enable
            if plugin in stats.getPluginsList() and \
               stats.get_plugin(plugin).is_enable():
                stat = stats.get_plugin(plugin).get_export()
            else:
                continue
            # Display stats
            if attribute is not None:
                # With attribute
                try:
                    printandflush("{}.{}: {}".format(plugin, attribute,
                                                     stat[attribute]))
                except KeyError as err:
                    logger.error("Can not display stat {}.{} ({})".format(plugin, attribute, err))
            else:
                # Without attribute
                printandflush("{}: {}".format(plugin, stat))

        # Wait until next refresh
        if duration > 0:
            time.sleep(duration)
846224
function addStats(collection, pkg) {
      var coverageType, stat;
      for (coverageType in collection) {
        if (collection.hasOwnProperty(coverageType)) {
          for (stat in collection[coverageType]) {
            if (collection[coverageType].hasOwnProperty(stat)) {
              collection[coverageType][stat] = collection[coverageType][stat] +
              pkg[coverageType][stat];
            }
          }
        }
      }
    }
466002
def update(self, stats):
        """"""

        if self.generate_every != 0 and self._timer.finished():
            self.args.generate_graph = True
            self._timer.reset()

        if not self.args.generate_graph:
            return

        plugins = stats.getPluginsList()
        for plugin_name in plugins:
            plugin = stats._plugins[plugin_name]
            if plugin_name in self.plugins_to_export():
                self.export(plugin_name, plugin.get_export_history())

        logger.info("Graphs created in the folder {}".format(self.path))
        self.args.generate_graph = False
483944
private void populateCumulatedStats(final StatDecoratorBean decoratorBean, final List<StatLineAO> allStatLines) {
		if (allStatLines == null || allStatLines.isEmpty()) {
			LOGGER.warn("Producer's stats are empty");
			return;
		}

		final int cumulatedIndex = getCumulatedIndex(allStatLines);
		if (cumulatedIndex == -1)
			return;

		final StatLineAO cumulatedStatLineAO = allStatLines.get(cumulatedIndex);

		final StatBean cumulatedStat = new StatBean();
		cumulatedStat.setName(cumulatedStatLineAO.getStatName());
		cumulatedStat.setValues(cumulatedStatLineAO.getValues());

		decoratorBean.setCumulatedStat(cumulatedStat);
	}
545155
def setup_instrumentation(self):
        
        if not self.config.get('stats') and not self.config.get('statsd'):
            return

        if 'stats' not in self.config:
            self.config['stats'] = {}

        # Backwards compatible statsd config support
        if self.config.get('statsd'):
            warnings.warn('Deprecated statsd configuration detected',
                          DeprecationWarning)
            self.config['stats'].setdefault('statsd',
                                            self.config.get('statsd'))

        if self.config['stats'].get('statsd'):
            if self.config['stats']['statsd'].get('enabled', True):
                self.statsd = statsd.Client(self.consumer_name,
                                            self.config['stats']['statsd'])
            LOGGER.debug('statsd measurements configured')

        # InfluxDB support
        if influxdb and self.config['stats'].get('influxdb'):
            if self.config['stats']['influxdb'].get('enabled', True):
                self.influxdb = self.setup_influxdb(
                    self.config['stats']['influxdb'])
            LOGGER.debug('InfluxDB measurements configured: %r', self.influxdb)
600722
def persist_compilestats(run, session, stats):
    
    for stat in stats:
        stat.run_id = run.id
        session.add(stat)
436644
def _initialize_plugins(self):
        
        logger.debug('Initializing plugins')
        plugins = self._pm.hook.plugins(loop=self._loop)
        if plugins:
            for plugin in plugins:
                name = plugin.__name__
                registry_name = plugin.__registry__ or plugin.__name__
                config = self.config.get(name, {})

                priority = config.get('priority', 50)

                if priority:
                    self._plugins[name] = {
                        'plugin': plugin,
                        'config': config,
                        'priority': priority,
                        'factory': registry_name
                    }

                    self._start_priority[priority].append(name)
        else:
            logger.error('No plugins found')
360247
function StatsPlugin (output, options, cache) {
  this.output = output
  this.options = options
  this.cache = cache
}
1133605
function setupFPS() {
  stats.showPanel(0);  // 0: fps, 1: ms, 2: mb, 3+: custom
  if (guiState.showFps) {
    document.body.appendChild(stats.dom);
  }
}
266858
function _setupDebugHelpers() {
        window.ld = LiveDevelopment;
        window.i = Inspector;
        window.report = function report(params) { window.params = params; console.info(params); };
    }
794645
def add_stats(self, args):
        """"""
        bg_name, stats = args
        logger.debug("Stats: %s %s", bg_name, stats)
        
        for motif_id in stats.keys():
            if motif_id not in self.stats:
                self.stats[motif_id] = {}
        
            self.stats[motif_id][bg_name] = stats[motif_id]
676265
function plugin(hydro, utils, root){
  var stats = track(hydro)
  var stat = domify(statsTemplate)
  var items = stat.getElementsByTagName('li')
  var passes = items[1].getElementsByTagName('em')[0]
  var passesLink = items[1].getElementsByTagName('a')[0]
  var failures = items[2].getElementsByTagName('em')[0]
  var failuresLink = items[2].getElementsByTagName('a')[0]
  var duration = items[3].getElementsByTagName('em')[0]
  var progress = new Progress().size(40).text('%d%')
  var report = domify('<ul id=hydro-report></ul>')
  var stack = [report]

  root = root
    || document.getElementById('hydro')
    || document.body.appendChild(domify('<div id=hydro></div>'))

  items[0].appendChild(progress.el)
  root.appendChild(stat)
  root.appendChild(report)

  // pass toggle
  bind(passesLink, 'click', function(){
    unhide()
    classes.remove('fail', report)
    classes.toggle('pass', report)
    classes.has('pass', report) && hideSuitesWithout('test pass')
  })

  // failure toggle
  bind(failuresLink, 'click', function(){
    unhide()
    classes.remove('pass', report)
    classes.toggle('fail', report)
    classes.has('fail', report) && hideSuitesWithout('test fail')
  })

  hydro.on('pre:suite', function(suite){
    var el = fragment(
      '<li class="suite"><h1><a href="%s">%e</a></h1></li>',
      grep(suite),
      suite.title)

    stack[0].appendChild(el)
    stack.unshift(document.createElement('ul'))
    el.appendChild(stack[0])
  })

  hydro.on('post:suite', function(){
    stack.shift()
  })

  hydro.on('post:test', function(test){
    progress.update(stats.percent)

    // update stats
    text(passes, stats.passes)
    text(failures, stats.failures)
    text(duration, (stats.elapsed / 1000).toFixed(2))

    // test
    switch (test.status) {
      case 'passed':
        var el = fragment(
          '<li class="test pass %s"><h2>%e<span class=duration>%sms</span></h2></li>',
          test.speed || 'fast',
          test.title,
          test.time)
        break
      case 'pending':
      case 'skipped':
        var el = fragment(
          '<li class="test pass pending"><h2>%e</h2></li>',
          test.title)
        break
      case 'failed':
        var str = test.error.stack || test.error.toString()

        // FF / Opera do not add the message
        if (!~str.indexOf(test.error.message)) {
          str = test.error.message + '\n' + str
        }

        // Safari doesn't give you a stack. Let's at least provide a source line.
        if (!test.error.stack && test.error.sourceURL && test.error.line !== undefined) {
          str += "\n(" + test.error.sourceURL + ":" + test.error.line + ")"
        }

        var el = fragment(
          '<li class="test fail"><h2>%e</h2><pre class=error>%e</pre></li>',
          test.title,
          str)
    }

    // hide code
    if (test.status != 'pending') {
      var h2 = el.getElementsByTagName('h2')[0]
      var pre = fragment('<pre><code>%s</code></pre>', highlight(trim(clean(test.fn))))
      el.appendChild(pre)
      pre.style.display = 'none'

      bind(h2, 'dblclick', function(){
        location.search = grep(test)
      })

      bind(h2, 'click', function(){
        pre.style.display = 'none' == pre.style.display
          ? 'block'
          : 'none'
      })
    }

    stack[0].appendChild(el)
  })

  // grep tests
  var query = location.search.replace(/^\?/, '')
  var focus = qs.parse(query).focus
  if (focus) hydro.on('pre:test', function(test) {
    if (test.fullTitle().indexOf(focus) < 0) test.skip()
  })
}
458340
public void setup(PluginParameters parameters) {
        this.pomFile = parameters.pomFile;
        this.backupFileExtension = parameters.backupFileExtension;
        this.encoding = parameters.encoding;
        this.customSortOrderFile = parameters.customSortOrderFile;
        this.predefinedSortOrder = parameters.predefinedSortOrder;
        this.violationFilename = parameters.violationFilename;
    }
679568
def update_stats_history(self):
        """"""
        # If the plugin data is a dict, the dict's key should be used
        if self.get_key() is None:
            item_name = ''
        else:
            item_name = self.get_key()
        # Build the history
        if self.get_export() and self.history_enable():
            for i in self.get_items_history_list():
                if isinstance(self.get_export(), list):
                    # Stats is a list of data
                    # Iter throught it (for exemple, iter throught network
                    # interface)
                    for l in self.get_export():
                        self.stats_history.add(
                            nativestr(l[item_name]) + '_' + nativestr(i['name']),
                            l[i['name']],
                            description=i['description'],
                            history_max_size=self._limits['history_size'])
                else:
                    # Stats is not a list
                    # Add the item to the history directly
                    self.stats_history.add(nativestr(i['name']),
                                           self.get_export()[i['name']],
                                           description=i['description'],
                                           history_max_size=self._limits['history_size'])
245590
function setup() {
        $dataStore = new PersonalDataStoreStub();
        $this->eventStore = new TestEventStoreSpy();

        $this->container = new ContainerStub();
        $this->container->set(EventStore::class, $this->eventStore);

        $this->classMap  = new DomainEventClassMap();
        $this->commandBus = new ReflectionResolutionCommandBus($this->container);

        $this->serializer = new ReflectionBasedDomainEventSerializer(
            $this->classMap,
            new ValueSerializer($dataStore),
            $dataStore
        );
    }