New in 6.0: Get current custom statistic settings
198377
@Override
    public String getCustomSetString() {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "getCustomSetString");

        String ret = PmiRegistry.getInstrumentationLevelString60();

        if (tc.isEntryEnabled())
            Tr.exit(tc, "getCustomSetString");

        return ret;
    }
198252
async def x_get_ics_statistics(self) -> Tuple[int, int, int, int, str, str]:
        """"""
        return await self.gateway.commands.X_GetICSStatistics()
416660
static function isTemplatesUsageStatisticsEnabled()
    {
        if ( !isset( $GLOBALS['eZTemplateDebugTemplatesUsageStatisticsEnabled'] ) )
        {
            $ini = eZINI::instance();
            $GLOBALS['eZTemplateDebugTemplatesUsageStatisticsEnabled'] = $ini->variable( 'TemplateSettings', 'ShowUsedTemplates' ) == 'enabled';
        }
        return ( $GLOBALS['eZTemplateDebugTemplatesUsageStatisticsEnabled'] );
    }
740986
def get_default_config(self):
        
        config = super(IPMISensorCollector, self).get_default_config()
        config.update({
            'bin':              '/usr/bin/ipmitool',
            'use_sudo':         False,
            'sudo_cmd':         '/usr/bin/sudo',
            'path':             'ipmi.sensors',
            'thresholds':       False,
            'delimiter':        '.'
        })
        return config
970420
def restoreSettings(self, settings):
        
        value = unwrapVariant(settings.value('recent_files'))
        if value:
            self.setFilenames(value.split(os.path.pathsep))
1102833
def get_icinga_stats(self, app_stats):
        
        stats = {}
        stats = dict(stats.items() + self._get_active_stats(app_stats).items())
        stats = dict(stats.items() + self._get_cached_stats(app_stats).items())
        stats = dict(
            stats.items() + self._get_command_execution(app_stats).items())
        stats = dict(
            stats.items() + self._get_externalcmd_stats(app_stats).items())
        stats["uptime"] = self._get_uptime(app_stats)
        return stats
650081
function getStatsAdapter() {

    ///
  // Get Stats using the older API. Used by all current versions
  // of Chrome.
  //
    function getStatsOldAPI(peerConnection, completion) {

      peerConnection.getStats(function(rtcStatsReport) {

        var stats = [];
        rtcStatsReport.result().forEach(function(rtcStat) {

          var stat = {};

          rtcStat.names().forEach(function(name) {
            stat[name] = rtcStat.stat(name);
          });

          // fake the structure of the "new" RTC stat object
          stat.id = rtcStat.id;
          stat.type = rtcStat.type;
          stat.timestamp = rtcStat.timestamp;
          stats.push(stat);
        });

        completion(null, stats);
      });
    }

  ///
  // Get Stats using the newer API.
  //
    function getStatsNewAPI(peerConnection, completion) {

      peerConnection.getStats(null, function(rtcStatsReport) {

        var stats = [];
        rtcStatsReport.forEach(function(rtcStats) {
          stats.push(rtcStats);
        });

        completion(null, stats);
      }, completion);
    }

    if (OT.$.browserVersion().name === 'Firefox' || OTPlugin.isInstalled()) {
      return getStatsNewAPI;
    } else {
      return getStatsOldAPI;
    }
  }
1272840
def available_settings(self):
        """"""
        available = {}
        if not self.status_data:
            return available

        for (key, val) in self.status_data.get('avail', {}).items():
            available[key] = []
            for subval in val:
                try:
                    subval = float(subval)
                except ValueError:
                    subval = subval

                if val in ('on', 'off'):
                    subval = (subval == 'on')

                available[key].append(subval)

        return available
1190963
def get_default_config(self):
        
        config = super(ProcessStatCollector, self).get_default_config()
        config.update({
            'path':     'proc'
        })
        return config
240412
def get_default_config(self):
        
        config = super(UDPCollector, self).get_default_config()
        config.update({
            'path':          'udp',
            'allowed_names': 'InDatagrams, NoPorts, InErrors, ' +
                             'OutDatagrams, RcvbufErrors, SndbufErrors'
        })
        return config
1007112
def update_stats(stats, start_time, data):
    '''
    
    '''
    end_time = time.time()
    cmd = data['cmd']
    # the jid is used as the create time
    try:
        jid = data['jid']
    except KeyError:
        try:
            jid = data['data']['__pub_jid']
        except KeyError:
            log.info('jid not found in data, stats not updated')
            return stats
    create_time = int(time.mktime(time.strptime(jid, '%Y%m%d%H%M%S%f')))
    latency = start_time - create_time
    duration = end_time - start_time

    stats[cmd]['runs'] += 1
    stats[cmd]['latency'] = (stats[cmd]['latency'] * (stats[cmd]['runs'] - 1) + latency) / stats[cmd]['runs']
    stats[cmd]['mean'] = (stats[cmd]['mean'] * (stats[cmd]['runs'] - 1) + duration) / stats[cmd]['runs']

    return stats
394637
def ConvCnstrMODOptionsDefaults(method='fista'):
    

    dflt = copy.deepcopy(ccmod_class_label_lookup(method).Options.defaults)
    if method == 'fista':
        dflt.update({'MaxMainIter': 1, 'BackTrack':
                     {'gamma_u': 1.2, 'MaxIter': 50}})
    else:
        dflt.update({'MaxMainIter': 1, 'AutoRho':
                     {'Period': 10, 'AutoScaling': False,
                      'RsdlRatio': 10.0, 'Scaling': 2.0,
                      'RsdlTarget': 1.0}})
    return dflt
1184897
def get_settings_list(self):
        """"""
        return [
            self.source,
            self.output,
            self.kwargs,
            self.post_processors,
        ]
272155
def update_stat(self, mode='open', infostr='', stat=''):
        
        self._update_stat[mode](mode, infostr, stat)
1333282
def settings(self):
        """"""
        _settings = {
            'action': self._action,
            # not supported in v2 batch
            # 'attributeWriteType': self._attribute_write_type,
            'attributeWriteType': 'Replace',
            'haltOnError': str(self._halt_on_error).lower(),
            'owner': self._owner,
            'version': 'V2',
        }
        if self._playbook_triggers_enabled is not None:
            _settings['playbookTriggersEnabled'] = str(self._playbook_triggers_enabled).lower()
        if self._hash_collision_mode is not None:
            _settings['hashCollisionMode'] = self._hash_collision_mode
        if self._file_merge_mode is not None:
            _settings['fileMergeMode'] = self._file_merge_mode
        return _settings
6619
def init_stats_history(self):
        """"""
        if self.history_enable():
            init_list = [a['name'] for a in self.get_items_history_list()]
            logger.debug("Stats history activated for plugin {} (items: {})".format(self.plugin_name, init_list))
        return GlancesHistory()
872289
def get_default_values(data):
    """"""
    request = data.get('request')
    result = {}
    result['__datetime__'] = datetime.now()
    result['__ip_address__'] = request and get_ip(request) or '0.0.0.0'
    return result