grr/server/grr_response_server/client_report_utils.py
def FetchAllGraphSeries(
    label,
    report_type,
    period = None,
    token = None
):
  """Fetches graph series for the given label and report-type from the DB.

  Args:
    label: Client label to fetch data for.
    report_type: rdf_stats.ClientGraphSeries.ReportType to fetch data for.
    period: rdfvalue.Duration specifying how far back in time to fetch data. If
      not provided, all data for the given label and report-type will be
      returned.
    token: ACL token to use for reading from the legacy (non-relational)
      datastore.

  Raises:
    AFF4AttributeTypeError: If, when reading to the legacy DB, an unexpected
    report-data type is encountered.

  Returns:
    A dict mapping timestamps to graph-series. The timestamps
    represent when the graph-series were written to the datastore.
  """
  if _ShouldUseLegacyDatastore():
    return _FetchAllGraphSeriesFromTheLegacyDB(
        label, report_type, period=period, token=token)

  if period is None:
    time_range = None
  else:
    range_end = rdfvalue.RDFDatetime.Now()
    time_range = time_utils.TimeRange(range_end - period, range_end)
  return data_store.REL_DB.ReadAllClientGraphSeries(
      label, report_type, time_range=time_range)
Fetches graph series for the given label and report-type from the DB.

  Args:
    label: Client label to fetch data for.
    report_type: rdf_stats.ClientGraphSeries.ReportType to fetch data for.
    period: rdfvalue.Duration specifying how far back in time to fetch data. If
      not provided, all data for the given label and report-type will be
      returned.
    token: ACL token to use for reading from the legacy (non-relational)
      datastore.

  Raises:
    AFF4AttributeTypeError: If, when reading to the legacy DB, an unexpected
    report-data type is encountered.

  Returns:
    A dict mapping timestamps to graph-series. The timestamps
    represent when the graph-series were written to the datastore.
  
Fetches graph series for the given label and report-type from the DB.
Args:
label: Client label to fetch data for.

If, when reading to the legacy DB, an unexpected
report-data type is encountered.

A dict mapping timestamps to graph-series. The timestamps
represent when the graph-series were written to the datastore.
Fetches graph series for the given label and report - type from the DB . Args : label : Client label to fetch data for . If when reading to the legacy DB an unexpected report - data type is encountered . A dict mapping timestamps to graph - series . The timestamps represent when the graph - series were written to the datastore .
def FetchAllGraphSeries(
    label,
    report_type,
    period = None,
    token = None
):
  if _ShouldUseLegacyDatastore():
    return _FetchAllGraphSeriesFromTheLegacyDB(
        label, report_type, period=period, token=token)
  if period is None:
    time_range = None
  else:
    range_end = rdfvalue.RDFDatetime.Now()
    time_range = time_utils.TimeRange(range_end - period, range_end)
  return data_store.REL_DB.ReadAllClientGraphSeries(
      label, report_type, time_range=time_range)
def FetchAllGraphSeries ( label , report_type , period = None , token = None ) : if _ShouldUseLegacyDatastore ( ) : return _FetchAllGraphSeriesFromTheLegacyDB ( label , report_type , period = period , token = token ) if period is None : time_range = None else : range_end = rdfvalue . RDFDatetime . Now ( ) time_range = time_utils . TimeRange ( range_end - period , range_end ) return data_store . REL_DB . ReadAllClientGraphSeries ( label , report_type , time_range = time_range )
Fetches graph series for the given label and report-type from the DB.
Fetches graph series for the given label and report - type from the DB .
"""Fetches graph series for the given label and report-type from the DB.

  Args:
    label: Client label to fetch data for.
    report_type: rdf_stats.ClientGraphSeries.ReportType to fetch data for.
    period: rdfvalue.Duration specifying how far back in time to fetch data. If
      not provided, all data for the given label and report-type will be
      returned.
    token: ACL token to use for reading from the legacy (non-relational)
      datastore.

  Raises:
    AFF4AttributeTypeError: If, when reading to the legacy DB, an unexpected
    report-data type is encountered.

  Returns:
    A dict mapping timestamps to graph-series. The timestamps
    represent when the graph-series were written to the datastore.
  """
label
report_type
period
token