code: def test_throughput_monitor_world_size():
      logger_mock = Mock()
      fabric = Fabric(devices=1, loggers=logger_mock)
      with mock.patch(
          "lightning.fabric.utilities.throughput.get_available_flops",
          return_value=100,
      ):
          monitor = ThroughputMonitor(fabric, window_size=4)
          # simulate that there are 2 devices
          monitor.world_size = 2
      mock_train_loop(monitor)
      assert logger_mock.log_metrics.mock_calls == [
          call(
              metrics={
                  "time": 1.5,
                  "batches": 1,
                  "samples": 3,
                  "lengths": 6,
              },
              step=0,
          ),
          call(
              metrics={
                  "time": 2.5,
                  "batches": 2,
                  "samples": 6,
                  "lengths": 12,
              },
              step=1,
          ),
          call(
              metrics={
                  "time": 3.5,
                  "batches": 3,
                  "samples": 9,
                  "lengths": 18,
              },
              step=2,
          ),
          call(
              metrics={
                  "time": 4.5,
                  "batches": 4,
                  "samples": 12,
                  "lengths": 24,
                  "device/batches_per_sec": 1.0,
                  "device/samples_per_sec": 3.0,
                  "batches_per_sec": 2.0,
                  "samples_per_sec": 6.0,
                  "items_per_sec": 12.0,
                  "device/items_per_sec": 6.0,
                  "flops_per_sec": 20.0,
                  "device/flops_per_sec": 10.0,
                  "device/mfu": 0.1,
              },
              step=3,
          ),
          call(
              metrics={
                  "time": 5.5,
                  "batches": 5,
                  "samples": 15,
                  "lengths": 30,
                  "device/batches_per_sec": 1.0,
                  "device/samples_per_sec": 3.0,
                  "batches_per_sec": 2.0,
                  "samples_per_sec": 6.0,
                  "items_per_sec": 12.0,
                  "device/items_per_sec": 6.0,
                  "flops_per_sec": 20.0,
                  "device/flops_per_sec": 10.0,
                  "device/mfu": 0.1,
              },
              step=4,
          ),
      ]
  
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 8 for calling a global function with example usage: test_throughput_monitor_world_size() without return types