grr/server/grr_response_server/stats_store.py
def _GenerateStatsEntriesForMultiDimensionalMetric(
    process_id, metric_name, metadata,
    timestamp):
  """Generates StatsStoreEntries for the given multi-dimensional metric.

  Args:
    process_id: Process identifier to use for for the generated entries.
    metric_name: Name of the multi-dimensional metric.
    metadata: MetricMetadata for the metric.
    timestamp: Timestamp to use for the generated entries.

  Returns:
    A list of StatsStoreEntries containing current values for the metric's
    dimensions.
  """
  stats_entries = []
  for raw_field_values in stats_collector_instance.Get().GetMetricFields(
      metric_name):
    _ValidateFieldValues(raw_field_values, metadata)
    metric_value = stats_values.StatsStoreValue()
    for i, raw_field_value in enumerate(raw_field_values):
      field_value = stats_values.StatsStoreFieldValue()
      field_value.SetValue(raw_field_value, metadata.fields_defs[i].field_type)
      metric_value.fields_values.Append(field_value)
    raw_metric_value = stats_collector_instance.Get().GetMetricValue(
        metric_name, fields=raw_field_values)
    metric_value.SetValue(raw_metric_value, metadata.value_type)
    stats_entries.append(
        stats_values.StatsStoreEntry(
            process_id=process_id,
            metric_name=metric_name,
            metric_value=metric_value,
            timestamp=timestamp))
  return stats_entries
Generates StatsStoreEntries for the given multi-dimensional metric.

  Args:
    process_id: Process identifier to use for for the generated entries.
    metric_name: Name of the multi-dimensional metric.
    metadata: MetricMetadata for the metric.
    timestamp: Timestamp to use for the generated entries.

  Returns:
    A list of StatsStoreEntries containing current values for the metric's
    dimensions.
  
Generates StatsStoreEntries for the given multi-dimensional metric.
Generates StatsStoreEntries for the given multi - dimensional metric .
def _GenerateStatsEntriesForMultiDimensionalMetric(
    process_id, metric_name, metadata,
    timestamp):
  stats_entries = []
  for raw_field_values in stats_collector_instance.Get().GetMetricFields(
      metric_name):
    _ValidateFieldValues(raw_field_values, metadata)
    metric_value = stats_values.StatsStoreValue()
    for i, raw_field_value in enumerate(raw_field_values):
      field_value = stats_values.StatsStoreFieldValue()
      field_value.SetValue(raw_field_value, metadata.fields_defs[i].field_type)
      metric_value.fields_values.Append(field_value)
    raw_metric_value = stats_collector_instance.Get().GetMetricValue(
        metric_name, fields=raw_field_values)
    metric_value.SetValue(raw_metric_value, metadata.value_type)
    stats_entries.append(
        stats_values.StatsStoreEntry(
            process_id=process_id,
            metric_name=metric_name,
            metric_value=metric_value,
            timestamp=timestamp))
  return stats_entries
def _GenerateStatsEntriesForMultiDimensionalMetric ( process_id , metric_name , metadata , timestamp ) : stats_entries = [ ] for raw_field_values in stats_collector_instance . Get ( ) . GetMetricFields ( metric_name ) : _ValidateFieldValues ( raw_field_values , metadata ) metric_value = stats_values . StatsStoreValue ( ) for i , raw_field_value in enumerate ( raw_field_values ) : field_value = stats_values . StatsStoreFieldValue ( ) field_value . SetValue ( raw_field_value , metadata . fields_defs [ i ] . field_type ) metric_value . fields_values . Append ( field_value ) raw_metric_value = stats_collector_instance . Get ( ) . GetMetricValue ( metric_name , fields = raw_field_values ) metric_value . SetValue ( raw_metric_value , metadata . value_type ) stats_entries . append ( stats_values . StatsStoreEntry ( process_id = process_id , metric_name = metric_name , metric_value = metric_value , timestamp = timestamp ) ) return stats_entries
Generates StatsStoreEntries for the given multi-dimensional metric.
Generates StatsStoreEntries for the given multi - dimensional metric .
"""Generates StatsStoreEntries for the given multi-dimensional metric.

  Args:
    process_id: Process identifier to use for for the generated entries.
    metric_name: Name of the multi-dimensional metric.
    metadata: MetricMetadata for the metric.
    timestamp: Timestamp to use for the generated entries.

  Returns:
    A list of StatsStoreEntries containing current values for the metric's
    dimensions.
  """
A list of StatsStoreEntries containing current values for the metric's
dimensions.
A list of StatsStoreEntries containing current values for the metric ' s dimensions .
process_id
Process identifier to use for for the generated entries.
Process identifier to use for for the generated entries .
metric_name
Name of the multi-dimensional metric.
Name of the multi - dimensional metric .
metadata
MetricMetadata for the metric.
MetricMetadata for the metric .
timestamp
Timestamp to use for the generated entries.
Timestamp to use for the generated entries .