<commit_before>class Metric
  @@paths = []

  def self.all
    @@paths
  end

  def self.find(search)
    results = []
    @@paths.each do |p|
      results << p if p.match(/#{search}/i)
    end
   results 
  end

  def self.load
    self.update
  end

  def self.update
    response = RestClient.get("#{ENV['GRAPHITE_URL']}/metrics/index.json")
    @@paths = JSON.parse(response)
  end
end<commit_msg>resque class for updating the metric list<commit_after>class Metric
  @@paths = []

  def self.all
    @@paths
  end

  def self.find(search)
    results = []
    @@paths.each do |p|
      results << p if p.match(/#{search}/i)
    end
   results 
  end

  def self.load
    self.update
  end

  def self.update
    response = RestClient.get("#{ENV['GRAPHITE_URL']}/metrics/index.json")
    @@paths = JSON.parse(response)
  end
end

class MetricListUpdate
  def self.perform
    Metric.update
  end
end
{'fraction_non_alphanumeric': 0.12846068660022147, 'fraction_numerical': 0.0, 'mean_word_length': 2.6305220883534135, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '4309183', 'n_tokens_mistral': 330, 'n_tokens_neox': 310, 'n_words': 76}