grr/server/grr_response_server/stats_store.py
def _GenerateStatsEntries(
    process_id,
    timestamp = None
):
  # TODO: pyformat: enable
  """Returns StatsStoreEntries with current data-points for all defined metrics.

  Args:
    process_id: Process identifier to use for for the generated entries.
    timestamp: Timestamp to use for the generated entries. If not provided, all
      generated StatsStoreEntries will use the current timestamp.
  """
  if timestamp is None:
    timestamp = rdfvalue.RDFDatetime.Now()

  stats_entries = []
  for metric_name, metadata in iteritems(
      stats_collector_instance.Get().GetAllMetricsMetadata()):
    if metadata.fields_defs:
      stats_entries.extend(
          _GenerateStatsEntriesForMultiDimensionalMetric(
              process_id, metric_name, metadata, timestamp))
    else:
      stats_entries.append(
          _GenerateStatsEntryForSingleDimensionalMetric(process_id, metric_name,
                                                        metadata, timestamp))

  return stats_entries
Returns StatsStoreEntries with current data-points for all defined metrics.

  Args:
    process_id: Process identifier to use for for the generated entries.
    timestamp: Timestamp to use for the generated entries. If not provided, all
      generated StatsStoreEntries will use the current timestamp.
  
Returns StatsStoreEntries with current data-points for all defined metrics.
Returns StatsStoreEntries with current data - points for all defined metrics .
def _GenerateStatsEntries(
    process_id,
    timestamp = None
):
  if timestamp is None:
    timestamp = rdfvalue.RDFDatetime.Now()
  stats_entries = []
  for metric_name, metadata in iteritems(
      stats_collector_instance.Get().GetAllMetricsMetadata()):
    if metadata.fields_defs:
      stats_entries.extend(
          _GenerateStatsEntriesForMultiDimensionalMetric(
              process_id, metric_name, metadata, timestamp))
    else:
      stats_entries.append(
          _GenerateStatsEntryForSingleDimensionalMetric(process_id, metric_name,
                                                        metadata, timestamp))
  return stats_entries
def _GenerateStatsEntries ( process_id , timestamp = None ) : if timestamp is None : timestamp = rdfvalue . RDFDatetime . Now ( ) stats_entries = [ ] for metric_name , metadata in iteritems ( stats_collector_instance . Get ( ) . GetAllMetricsMetadata ( ) ) : if metadata . fields_defs : stats_entries . extend ( _GenerateStatsEntriesForMultiDimensionalMetric ( process_id , metric_name , metadata , timestamp ) ) else : stats_entries . append ( _GenerateStatsEntryForSingleDimensionalMetric ( process_id , metric_name , metadata , timestamp ) ) return stats_entries
Returns StatsStoreEntries with current data-points for all defined metrics.
Returns StatsStoreEntries with current data - points for all defined metrics .
# TODO: pyformat: enable """Returns StatsStoreEntries with current data-points for all defined metrics.

  Args:
    process_id: Process identifier to use for for the generated entries.
    timestamp: Timestamp to use for the generated entries. If not provided, all
      generated StatsStoreEntries will use the current timestamp.
  """
process_id
Process identifier to use for for the generated entries.
Process identifier to use for for the generated entries .
timestamp
Timestamp to use for the generated entries. If not provided, all
generated StatsStoreEntries will use the current timestamp.
Timestamp to use for the generated entries . If not provided all generated StatsStoreEntries will use the current timestamp .