class_docstr: A very simple, in memory time series database
class_docstr_tok: ["A","very","simple",",","in","memory","time","series","database"]
docstr: Perform a max operation for metric `key`.
  
  Args:
      key: the metric name.
      window_start_timestamp_s: the unix epoch timestamp for the
        start of the window. The computed average will use all datapoints
        from this timestamp until now.
      do_compact: whether or not to delete the datapoints that's
        before `window_start_timestamp_s` to save memory. Default is
        true.
  Returns:
      Max value of the data points for the key on and after time
      window_start_timestamp_s, or None if there are no such points.
docstr_tok: ["Perform","a","max","operation","for","metric","`","key","`",".","Args",":","key",":","the","metric","name",".","window_start_timestamp_s",":","the","unix","epoch","timestamp","for","the","start","of","the","window",".","The","computed","average","will","use","all","datapoints","from","this","timestamp","until","now",".","do_compact",":","whether","or","not","to","delete","the","datapoints","that's","before","`","window_start_timestamp_s","`","to","save","memory",".","Default","is","true",".","Returns",":","Max","value","of","the","data","points","for","the","key","on","and","after","time","window_start_timestamp_s",",","or","None","if","there","are","no","such","points","."]
code: def max(
      self,
      key: str,
      window_start_timestamp_s: float,
      do_compact: bool = True,
  ):
      """Perform a max operation for metric `key`.
  
      Args:
          key: the metric name.
          window_start_timestamp_s: the unix epoch timestamp for the
            start of the window. The computed average will use all datapoints
            from this timestamp until now.
          do_compact: whether or not to delete the datapoints that's
            before `window_start_timestamp_s` to save memory. Default is
            true.
      Returns:
          Max value of the data points for the key on and after time
          window_start_timestamp_s, or None if there are no such points.
      """
      points_after_idx = self._get_datapoints(
          key, window_start_timestamp_s
      )
  
      if do_compact:
          self.data[key] = points_after_idx
  
      return max(
          (point.value for point in points_after_idx), default=None
      )
  
file_path: ray/python/ray/serve/_private/autoscaling_metrics.py
imports: import bisect
  import logging
  from collections import defaultdict
  from dataclasses import dataclass, field
  from typing import DefaultDict, Dict, List, Optional
  from ray.serve._private.constants import SERVE_LOGGER_NAME
label_desc: Use image node_id 5 for calling the InMemoryMetricsStore obj's underlying member method code with example usage: obj.max(key, window_start_timestamp_s, do_compact) and returns: max