<commit_before>defmodule Admin.HostStatus do
  import ShortMaps
  @instance Application.get_env(:admin, :instance, "jd")

  def collection, do: "host_status-#{@instance}"

  def get_all() do
    Mongo.find(:mongo, collection(), %{})
    |> Enum.map(&Map.drop(&1, ["_id"]))
  end

  def get_for(event_id) do
    Mongo.find_one(:mongo, collection(), ~m(event_id))
  end

  def set_for(event_id, result) do
    Mongo.update_many(:mongo, collection(), ~m(event_id), %{"$set" => ~m(result)}, upsert: true)
  end
end<commit_msg>include updated at in host status<commit_after>defmodule Admin.HostStatus do
  import ShortMaps
  @instance Application.get_env(:admin, :instance, "jd")

  def collection, do: "host_status-#{@instance}"

  def get_all() do
    Mongo.find(:mongo, collection(), %{})
    |> Enum.map(&Map.drop(&1, ["_id"]))
  end

  def get_for(event_id) do
    Mongo.find_one(:mongo, collection(), ~m(event_id))
  end

  def set_for(event_id, result) do
    updated_at = DateTime.utc_now()

    Mongo.update_many(
      :mongo,
      collection(),
      ~m(event_id),
      %{"$set" => ~m(result updated_at)},
      upsert: true
    )
  end
end
{'fraction_non_alphanumeric': 0.16376306620209058, 'fraction_numerical': 0.0017421602787456446, 'mean_word_length': 3.9956521739130433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7214729', 'n_tokens_mistral': 426, 'n_tokens_neox': 416, 'n_words': 90}