Processes a stats response from the client.
191384
def ProcessMessage(self, message):
    """"""
    self.ProcessResponse(message.source.Basename(), message.payload)
939456
def process_response(self, response):
        """"""
        self.response_headers = [(k, v) for k, v in sorted(response.headers.items())]
1241226
function statsMethod (query = {}) {
    const reqParams = Object.assign({}, defaults, query);

    debug("stats request", endpoint.url, reqParams);
    return transport(endpoint.url, reqParams).then(function (response) {
      if (response == null) return;

      // response is something like "GameID is required"
      if (typeof response === "string") throw new Error(response);

      return transform ? transform(response) : response;
    });
  }
1364553
public function processResponse()
    {

        // Make a new buffer out of all of the packets
        $buffer = new Buffer(implode('', $this->packets_response));

        // Check the header TS3
        if (($header = trim($buffer->readString("\n"))) !== 'TS3') {
            throw new Exception(__METHOD__ . " Expected header '{$header}' does not match expected 'TS3'.");
        }

        // Convert all the escaped characters
        $raw = str_replace(
            [
                '\\\\', // Translate escaped \
                '\\/', // Translate escaped /
            ],
            [
                '\\',
                '/',
            ],
            $buffer->getBuffer()
        );

        // Explode the sections and filter to remove empty, junk ones
        $sections = array_filter(explode("\n", $raw), function ($value) {

            $value = trim($value);

            // Not empty string or a message response for "error id=\d"
            return !empty($value) && substr($value, 0, 5) !== 'error';
        });

        // Trim up the values to remove extra whitespace
        $sections = array_map('trim', $sections);

        // Set the result to a new result instance
        $result = new Result();

        // Iterate over the sections and offload the parsing
        foreach ($sections as $section) {
            // Grab a snip of the data so we can figure out what it is
            $check = substr(trim($section), 0, 4);

            // Use the first part of the response to figure out where we need to go
            if ($check == 'virt') {
                // Server info
                $this->processDetails($section, $result);
            } elseif ($check == 'cid=') {
                // Channels
                $this->processChannels($section, $result);
            } elseif ($check == 'clid') {
                // Clients (players)
                $this->processPlayers($section, $result);
            }
        }

        unset($buffer, $sections, $section, $check);

        return $result->fetch();
    }
968350
def process_spider_input(self, response, spider):
        '''
        
        '''
        self.logger.debug("processing redis stats middleware")
        if self.settings['STATS_STATUS_CODES']:
            if spider.name not in self.stats_dict:
                self._setup_stats_status_codes(spider.name)

            if 'status_codes' in self.stats_dict[spider.name]:
                code = response.status
                if code in self.settings['STATS_RESPONSE_CODES']:
                    for key in self.stats_dict[spider.name]['status_codes'][code]:
                        try:
                            if key == 'lifetime':
                                unique = response.url + str(response.status)\
                                    + str(time.time())
                                self.stats_dict[spider.name]['status_codes'][code][key].increment(unique)
                            else:
                                self.stats_dict[spider.name]['status_codes'][code][key].increment()
                        except Exception as e:
                            self.logger.warn("Error in spider redis stats")
                    self.logger.debug("Incremented status_code '{c}' stats"\
                            .format(c=code))
506908
def _process_response(self):
        
        response = self.conn.getresponse()
        if response.status == 200 or response.status == 201:
            data = response.read()
        else:
            data = {
                "error":  {
                    "code": response.status,
                    "reason": response.reason,
                    "data": response.read()
                }
            }

        return data
333428
protected void handleStatsResetIfNeeded(StatusData<ApacheMetrics> status) {
        StatValue uptime = getStatValue(ApacheMetrics.SERVER_UPTIME);
        Long currUptime = Long.class.cast(status.get(ApacheMetrics.SERVER_UPTIME));
        if (uptime != null && currUptime != null && uptime.getValueAsLong() > currUptime) {
            for (ApacheMetrics metric : getAvailableMetrics()) {
                if (metric.getType() == StatValueTypes.DIFFLONG) {
                    StatValue stat = getStatValue(metric);
                    if (stat != null)
                        stat.reset();
                }
            }
        }
    }
1205831
def process_response(self, request, response):
        
        self._set_request_auth_type_metric(request)
        self._set_request_user_agent_metrics(request)
        self._set_request_referer_metric(request)
        self._set_request_user_id_metric(request)

        return response
1180772
def stats(contents={}, &callback)
      send_request Request::Stats.new(contents) do |result|
        callback.call result

        if result[:status] == Errors::NO_ERROR && result[:key] != ''
          :proceed
        end
      end
    end
1318423
def _process_response(self, request, response):
        """"""
        log_format = self._get_log_format(request)
        if not log_format:
            return response

        params = self._get_parameters_from_request(request)
        # log a message displayed to user
        messages = django_messages.get_messages(request)
        result_message = None
        if messages:
            result_message = ', '.join('%s: %s' % (message.tags, message)
                                       for message in messages)
        elif 'action' in request.POST:
            result_message = request.POST['action']
        params['message'] = result_message
        params['http_status'] = response.status_code

        self.OPERATION_LOG.info(log_format, params)

        return response
179220
def wait_for_stats(self):
        """"""
        logging.debug("waiting for statistics to finish")
        for job in self.stat_jobs:
            job.get()
        sleep(2)
123349
def process_response(self, request, response):
        
        if hasattr(threadlocal, 'auditlog'):
            pre_save.disconnect(sender=LogEntry, dispatch_uid=threadlocal.auditlog['signal_duid'])

        return response
68439
def get_stats(self, request, context):
        """"""
        _log_request(request, context)
        m = self.listener.memory
        return clearly_pb2.StatsMessage(
            task_count=m.task_count,
            event_count=m.event_count,
            len_tasks=len(m.tasks),
            len_workers=len(m.workers)
        )
839210
def RenderHttpResponse(request):
  """"""

  start_time = time.time()
  response = HTTP_REQUEST_HANDLER.HandleRequest(request)
  total_time = time.time() - start_time

  method_name = response.headers.get("X-API-Method", "unknown")
  if response.status_code == 200:
    status = "SUCCESS"
  elif response.status_code == 403:
    status = "FORBIDDEN"
  elif response.status_code == 404:
    status = "NOT_FOUND"
  elif response.status_code == 501:
    status = "NOT_IMPLEMENTED"
  else:
    status = "SERVER_ERROR"

  if request.method == "HEAD":
    metric_name = "api_access_probe_latency"
  else:
    metric_name = "api_method_latency"

  stats_collector_instance.Get().RecordEvent(
      metric_name, total_time, fields=(method_name, "http", status))

  return response
1139355
def async_stats_job_data(klass, account, url, **kwargs):
        
        resource = urlparse(url)
        domain = '{0}://{1}'.format(resource.scheme, resource.netloc)

        response = Request(account.client, 'get', resource.path, domain=domain,
                           raw_body=True, stream=True).perform()

        return response.body
321582
def stats(self):
        
        response = self.requester.get(
            '/{endpoint}/{id}/stats',
            endpoint=self.endpoint, id=self.id
        )
        return response.json()
1255956
def statsHandler(serverName, path=''):
  """"""
  path = path.lstrip('/')
  parts = path.split('/')
  if not parts[0]:
    parts = parts[1:]
  statDict = util.lookup(scales.getStats(), parts)

  if statDict is None:
    abort(404, 'No stats found with path /%s' % '/'.join(parts))

  output = StringIO()
  outputFormat = request.args.get('format', 'html')
  query = request.args.get('query', None)
  if outputFormat == 'json':
    formats.jsonFormat(output, statDict, query)
  elif outputFormat == 'prettyjson':
    formats.jsonFormat(output, statDict, query, pretty=True)
  else:
    formats.htmlHeader(output, '/' + path, serverName, query)
    formats.htmlFormat(output, tuple(parts), statDict, query)

  return output.getvalue()