code: def test_compaction_max(self):
      s = InMemoryMetricsStore()
  
      s.add_metrics_point({"m1": 1}, timestamp=2)
      s.add_metrics_point({"m1": 2}, timestamp=1)
  
      assert (
          s.max("m1", window_start_timestamp_s=0, do_compact=False) == 2
      )
  
      s.window_average(
          "m1", window_start_timestamp_s=1.1, do_compact=True
      )
  
      assert (
          s.window_average(
              "m1", window_start_timestamp_s=0, do_compact=False
          )
          == 1
      )
  
file_path: ray/python/ray/serve/tests/test_autoscaling_metrics.py
imports: import ray
  from ray import serve
  from ray._private.test_utils import SignalActor, wait_for_condition
  from ray.serve._private.autoscaling_metrics import InMemoryMetricsStore
  from ray.serve._private.common import DeploymentID, ReplicaState
label_desc: Use image node_id 5 for calling the TestInMemoryMetricsStore obj's underlying member method code with example usage: obj.test_compaction_max() without return types