code: def test_throughput_monitor_step():
      fabric_mock = Mock()
      fabric_mock.world_size = 1
      fabric_mock.strategy.precision = Precision()
      monitor = ThroughputMonitor(fabric_mock)
  
      # automatic step increase
      assert monitor.step == -1
      monitor.update(time=0.5, batches=1, samples=3)
      metrics = monitor.compute_and_log()
      assert metrics == {"time": 0.5, "batches": 1, "samples": 3}
      assert monitor.step == 0
  
      # manual step
      monitor.update(time=1.5, batches=2, samples=4)
      metrics = monitor.compute_and_log(step=5)
      assert metrics == {"time": 1.5, "batches": 2, "samples": 4}
      assert monitor.step == 5
      assert fabric_mock.log_dict.mock_calls == [
          call(
              metrics={"time": 0.5, "batches": 1, "samples": 3}, step=0
          ),
          call(
              metrics={"time": 1.5, "batches": 2, "samples": 4}, step=5
          ),
      ]
  
file_path: pytorch-lightning/tests/tests_fabric/utilities/test_throughput.py
imports: from unittest import mock
  from unittest.mock import Mock, call
  import pytest
  import torch
  from lightning.fabric import Fabric
  from lightning.fabric.plugins import Precision
  from lightning.fabric.utilities.throughput import Throughput, ThroughputMonitor, _MonotonicWindow, get_available_flops, measure_flops
  from tests_fabric.helpers.runif import RunIf
  from tests_fabric.test_fabric import BoringModel
label_desc: Use image node_id 7 for calling a global function with example usage: test_throughput_monitor_step() without return types