def METHOD_NAME(capsys, test_settings):
    # test that the metrics monitor is able to robustly sample metrics
    mock_metric = MockMetric()
    mock_broken_metric = MockBrokenMetric()
    metrics = [mock_metric, mock_broken_metric]
    interface = AssetInterface()
    settings = SettingsStatic(
        test_settings(
            dict(
                _stats_sample_rate_seconds=0.1,
                _stats_samples_to_average=2,
            )
        ).to_proto()
    )
    shutdown_event = threading.Event()
    metrics_monitor = MetricsMonitor(
        asset_name="test_metrics_monitor",
        metrics=metrics,
        interface=interface,
        settings=settings,
        shutdown_event=shutdown_event,
    )
    metrics_monitor.start()
    time.sleep(1)
    shutdown_event.set()
    metrics_monitor.finish()
    while not interface.metrics_queue.empty():
        metric_record = interface.metrics_queue.get()
        assert metric_record == {mock_metric.name: 42}
    assert len(mock_metric.samples) == 0