  def testGetInstanceGpuUsage(self, mock_gcm_api):
    """Validates the parsing of GPU usage metrics."""
    services = mock_gcm_api.return_value.projects.return_value.timeSeries.return_value.list
    services.return_value.execute.return_value = gcp_mocks.MOCK_GCM_METRICS_GPU_INSTANCE
    gpu_usage = gcp_mocks.FAKE_MONITORING.GetInstanceGPUUsage()
    self.assertEqual(1, len(gpu_usage))
    self.assertListEqual(gpu_usage,
        [
          {
            'gpu_name': 'NVIDIA L4 (0)',
            'instance_id': '0000000000000000001',
            'gpu_usage':
              [
                {
                  'timestamp': '2021-01-01T00:00:00.000000Z',
                  'gpu_usage': 0.1
                }
              ] * 24 * 7
          }
        ])
Validates the parsing of GPU usage metrics.
tests/providers/gcp/internal/test_monitoring.py