grr/server/grr_response_server/stats_store.py
def _TimeSeriesFromData(self, data, attr=None):
    """Build time series from StatsStore data."""

    series = timeseries.Timeseries()

    for value, timestamp in data:
      if attr:
        try:
          series.Append(getattr(value, attr), timestamp)
        except AttributeError:
          raise ValueError(
              "Can't find attribute %s in value %s." % (attr, value))
      else:
        if hasattr(value, "sum") or hasattr(value, "count"):
          raise ValueError(
              "Can't treat complext type as simple value: %s" % value)
        series.Append(value, timestamp)

    return series
Build time series from StatsStore data.
Build time series from StatsStore data.
Build time series from StatsStore data .
def _TimeSeriesFromData(self, data, attr=None):
    series = timeseries.Timeseries()
    for value, timestamp in data:
      if attr:
        try:
          series.Append(getattr(value, attr), timestamp)
        except AttributeError:
          raise ValueError(
              "Can't find attribute %s in value %s." % (attr, value))
      else:
        if hasattr(value, "sum") or hasattr(value, "count"):
          raise ValueError(
              "Can't treat complext type as simple value: %s" % value)
        series.Append(value, timestamp)
    return series
def _TimeSeriesFromData ( self , data , attr = None ) : series = timeseries . Timeseries ( ) for value , timestamp in data : if attr : try : series . Append ( getattr ( value , attr ) , timestamp ) except AttributeError : raise ValueError ( "Can't find attribute %s in value %s." % ( attr , value ) ) else : if hasattr ( value , "sum" ) or hasattr ( value , "count" ) : raise ValueError ( "Can't treat complext type as simple value: %s" % value ) series . Append ( value , timestamp ) return series
Build time series from StatsStore data.
Build time series from StatsStore data .
"""Build time series from StatsStore data."""
self
data
attr