<commit_before>collection @machines

attributes :uuid,
           :external_vm_id,
           :external_host_id,
           :cpu_count,
           :cpu_speed,
           :maximum_memory,
           :system,
           :guest_agent,
           :power_state,
           :hostname,
           :data_center_uuid,
           :description,
           :host_uuid
attribute :name => :virtual_name

_interval = params[:interval].blank? ? 300 : params[:interval]
_since = params[:since].blank? ? 5.minutes.ago.utc : Time.iso8601(params[:since])
_until = params[:until].blank? ? Time.now.utc : Time.iso8601(params[:until])

child :disks => :disks do
  attributes :uuid, :name, :maximum_size, :type, :thin

  node :readings do |r|
    r.readings(@inode, _interval, _since, _until).map do |r|
      {
        :usage => r.usage,
        :read => r.read,
        :write => r.write,
        :date_time => r.date_time
      }
    end
  end
end

child :nics => :nics do
  attributes :uuid, :name, :mac_address, :ip_address

  node :readings do |r|
    r.readings(@inode, _interval, _since, _until).map do |r|
      {
        :date_time => r.date_time,
        :receive => r.receive,
        :transmit => r.transmit
      }
    end
  end
end

node :readings do |o|
  o.readings(_interval, _since, _until).map do |r|
    {
      :interval => r.interval,
      :date_time => r.date_time,
      :cpu_usage => r.cpu_usage,
      :memory_bytes => r.memory_bytes
    }
  end
end<commit_msg>Need to add account_id to the list of values returned for machines/readings<commit_after>collection @machines

attributes :uuid,
           :external_vm_id,
           :external_host_id,
           :cpu_count,
           :cpu_speed,
           :maximum_memory,
           :system,
           :guest_agent,
           :power_state,
           :hostname,
           :data_center_uuid,
           :description,
           :host_uuid,
           :account_id
attribute :name => :virtual_name

_interval = params[:interval].blank? ? 300 : params[:interval]
_since = params[:since].blank? ? 5.minutes.ago.utc : Time.iso8601(params[:since])
_until = params[:until].blank? ? Time.now.utc : Time.iso8601(params[:until])

child :disks => :disks do
  attributes :uuid, :name, :maximum_size, :type, :thin

  node :readings do |r|
    r.readings(@inode, _interval, _since, _until).map do |r|
      {
        :usage => r.usage,
        :read => r.read,
        :write => r.write,
        :date_time => r.date_time
      }
    end
  end
end

child :nics => :nics do
  attributes :uuid, :name, :mac_address, :ip_address

  node :readings do |r|
    r.readings(@inode, _interval, _since, _until).map do |r|
      {
        :date_time => r.date_time,
        :receive => r.receive,
        :transmit => r.transmit
      }
    end
  end
end

node :readings do |o|
  o.readings(_interval, _since, _until).map do |r|
    {
      :interval => r.interval,
      :date_time => r.date_time,
      :cpu_usage => r.cpu_usage,
      :memory_bytes => r.memory_bytes
    }
  end
end
{'fraction_non_alphanumeric': 0.1309681697612732, 'fraction_numerical': 0.007957559681697613, 'mean_word_length': 2.2829162132752994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3808038', 'n_tokens_mistral': 1056, 'n_tokens_neox': 1023, 'n_words': 229}