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

module Gitlab
  module HealthChecks
    class GitalyCheck
      extend BaseAbstractCheck

      METRIC_PREFIX = 'gitaly_health_check'

      class << self
 
    
        def metrics
          Gitaly::Server.all.flat_map do |server|
            result, elapsed = with_timing { server.read_writeable? }
            labels = { shard: server.storage }

            [
              metric("#{metric_prefix}_success", result ? 1 : 0, **labels),
              metric("#{metric_prefix}_latency_seconds", elapsed, **labels)
            ]
          end
        end