code: def test_monitor_real_function_calls(self):
      # We want to actually make all of the real function calls under test, but
      # we of course don't know their values and can only do sanity checks.
      with resources.ResourceMonitor() as monitor:
          metrics = monitor.metrics()
          self.assertNotEmpty(metrics.host_name)
          self.assertGreater(metrics.physical_core_count, 0)
          self.assertGreater(metrics.total_memory_mb, 0)
          self.assertGreater(metrics.cpu_user_time_seconds, 0)
          self.assertGreater(metrics.cpu_system_time_seconds, 0)
          self.assertGreater(metrics.memory_peak_rss_mb, 0)
  
          # We unfortunately cannot make sure that read_bytes and write_bytes is
          # greater than zero, so these tests are commented out.
          # self.assertGreater(metrics.read_bytes, 0)
          # self.assertGreater(metrics.write_bytes, 0)
  
          # CPU frequency may not be available on all systems, so the value is
          # either a real frequency (> 0) or the magic value of 0.0 indicating that
          # the value could not be determined.
          self.assertGreaterEqual(metrics.cpu_frequency_mhz, 0.0)
  
file_path: deepvariant/deepvariant/resources_test.py
imports: import resource
  from unittest import mock
  from absl.testing import absltest
  import contextlib2
  from deepvariant import resources
label_desc: Use image node_id 1 for calling the ResourcesTest obj's underlying member method code with example usage: obj.test_monitor_real_function_calls() without return types