class_docstr: Actor which tests will report metrics to.
code: def submit(self, test_name: str, latency: float):
      print(f"got latency {latency} s for test {test_name}")
      self.measurements[test_name].append(latency)
      results = self.create_results_dict_from_measurements(
          self.measurements, self.expected_measurements_per_test
      )
      safe_write_to_results_json(results)
  
      assert (
          len(self.measurements[test_name])
          <= self.expected_measurements_per_test
      ), (
          f"Expected {self.measurements[test_name]} to not have more elements than "
          f"{self.expected_measurements_per_test}"
      )
  
imports: from collections import defaultdict
  from dataclasses import dataclass
  from ray._private.test_utils import safe_write_to_results_json
  from ray.job_submission import JobSubmissionClient, JobStatus
  import argparse
  import asyncio
  import random
  import ray
  import statistics
  import subprocess
  import sys
label_desc: Use image node_id 2 for calling the MetricsActor obj's underlying member method code with example usage: obj.submit(test_name, latency) without return types