You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: batch_metrics.rb
    path of file: ./repos/gitlabhq/lib/gitlab/database/background_migration
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Gitlab
  module Database
    module BackgroundMigration
      class Batch
    
        def instrument_operation(label, instrument_affected_rows: true)
          start_time = monotonic_time

          count = yield

          timings_for_label(label) << monotonic_time - start_time
          affected_rows_for_label(label) << count if instrument_affected_rows && count.is_a?(Integer)
        end