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: varz.rb
    path of file: ./repos/nats.rb/lib/nats/server
    
    the code of the file until where you have to start completion: module NATSD #:nodoc: all

  class Varz
    def call(env)
      varz_json = JSON.pretty_generate(Server.update_varz) + "\n"
      hdrs = RACK_JSON_HDR.dup
      hdrs['Content-Length'] = varz_json.bytesize.to_s
      [200, hdrs, varz_json]
    end
  end

    
      def update_varz
        # Snapshot uptime
        @varz[:uptime] = uptime_string(Time.now - @varz[:start])

        # Grab current cpu and memory usage.
        rss, pcpu = `ps -o rss=,pcpu= -p #{Process.pid}`.split
        @varz[:mem] = rss.to_i
        @varz[:cpu] = pcpu.to_f
        @varz[:connections] = num_connections
        @varz[:in_msgs] = in_msgs
        @varz[:out_msgs] = out_msgs
        @varz[:in_bytes] = in_bytes
        @varz[:out_bytes] = out_bytes
        @varz[:routes] = num_routes
        @last_varz_update = Time.now.to_f
        varz
      end