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: puma_sampler.rb
    path of file: ./repos/gitlabhq/lib/gitlab/metrics/samplers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Gitlab
  module Metrics
    module Samplers
      class PumaSampler < BaseSampler
        DEFAULT_SAMPLING_INTERVAL_SECONDS = 5

        def metrics
          @metrics ||= init_metrics
        end

        def init_metrics
          {
            puma_w
    
        def set_worker_metrics(stats, labels = {})
          metrics[:puma_running].set(labels, stats['running'])
          metrics[:puma_queued_connections].set(labels, stats['backlog'])
          metrics[:puma_active_connections].set(labels, stats['max_threads'] - stats['pool_capacity'])
          metrics[:puma_pool_capacity].set(labels, stats['pool_capacity'])
          metrics[:puma_max_threads].set(labels, stats['max_threads'])
          metrics[:puma_idle_threads].set(labels, stats['running'] + stats['pool_capacity'] - stats['max_threads'])
        end