def METHOD_NAME(self, mock_global_log, mock_psutil):
    mock_psutil.NoSuchProcess = MockNoSuchProcess
    mock_logger = mock.Mock()
    # 1. pid specified
    monitor_config = {
        "module": "scalyr_agent.builtin_monitors.windows_process_metrics",
        "id": "id1",
        "pid": "$$",
    }
    monitor = ProcessMonitor(monitor_config, logger=mock_logger)
    monitor._select_target_process = mock.Mock(
        side_effect=MockNoSuchProcess("error")
    )
    self.assertEqual(mock_global_log.warn.call_count, 0)
    monitor.gather_sample()
    mock_global_log.warn.assert_called_with('Unable to find process with pid "$$"')
    self.assertEqual(mock_global_log.warn.call_count, 1)
    # 2. commandline specified
    mock_global_log.reset_mock()
    mock_logger.reset_mock()
    monitor_config = {
        "module": "scalyr_agent.builtin_monitors.windows_process_metrics",
        "id": "id1",
        "commandline": "apache",
    }
    monitor = ProcessMonitor(monitor_config, logger=mock_logger)
    monitor._select_target_process = mock.Mock(
        side_effect=MockNoSuchProcess("error")
    )
    self.assertEqual(mock_global_log.warn.call_count, 0)
    monitor.gather_sample()
    mock_global_log.warn.assert_called_with(
        'Unable to find process with commandline "apache"'
    )
    self.assertEqual(mock_global_log.warn.call_count, 1)