<commit_before>if defined?(NewRelic)
  require 'new_relic/agent/method_tracer'

  Ability.class_eval do
    include NewRelic::Agent::MethodTracer
    add_method_tracer :initialize
    add_method_tracer :can?
    add_method_tracer :cannot?
  end

  FactGraph.class_eval do
    include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
    add_transaction_tracer :recalculate, category: :task, name: 'recalculate'

    add_method_tracer :calculate_authority
    add_method_tracer :calculate_user_opinions_of_all_base_facts
    add_method_tracer :calculate_fact_relation_influencing_opinions
    add_method_tracer :calculate_fact_opinions
    add_method_tracer :cut_off_top
  end

  Pavlov::Operation.class_eval do
    include NewRelic::Agent::MethodTracer
    add_method_tracer :initialize, 'Pavlov/#{self.class.name}/initialize'
    add_method_tracer :call, 'Pavlov/#{self.class.name}/call'
  end

  Queries::ContainingChannelIdsForChannelAndUser.class_eval do
    add_method_tracer :graph_user_channels
    add_method_tracer :containing_channels
    add_method_tracer :union_ids
  end

  Roadie::Inliner.class_eval do
    include NewRelic::Agent::MethodTracer
    add_method_tracer :execute
  end

  AddFactToChannelJob.class_eval do
    include NewRelic::Agent::MethodTracer
    add_method_tracer :initialize
    add_method_tracer :add_to_channel
    add_method_tracer :add_to_unread
    add_method_tracer :propagate_to_channels
    add_method_tracer :can_perform
    add_method_tracer :should_perform
  end

  Mail.class_eval do
    class << self
      include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
      add_transaction_tracer :deliver, :category => :mail_delivery, name: 'Mail.deliver'
    end
  end
end
<commit_msg>Updated mail deliver function tracing, now doing method tracer instead of transaction.<commit_after>if defined?(NewRelic)
  require 'new_relic/agent/method_tracer'

  Ability.class_eval do
    include NewRelic::Agent::MethodTracer
    add_method_tracer :initialize
    add_method_tracer :can?
    add_method_tracer :cannot?
  end

  FactGraph.class_eval do
    include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
    add_transaction_tracer :recalculate, category: :task, name: 'recalculate'

    add_method_tracer :calculate_authority
    add_method_tracer :calculate_user_opinions_of_all_base_facts
    add_method_tracer :calculate_fact_relation_influencing_opinions
    add_method_tracer :calculate_fact_opinions
    add_method_tracer :cut_off_top
  end

  Pavlov::Operation.class_eval do
    include NewRelic::Agent::MethodTracer
    add_method_tracer :initialize, 'Pavlov/#{self.class.name}/initialize'
    add_method_tracer :call, 'Pavlov/#{self.class.name}/call'
  end

  Queries::ContainingChannelIdsForChannelAndUser.class_eval do
    add_method_tracer :graph_user_channels
    add_method_tracer :containing_channels
    add_method_tracer :union_ids
  end

  Roadie::Inliner.class_eval do
    include NewRelic::Agent::MethodTracer
    add_method_tracer :execute
  end

  AddFactToChannelJob.class_eval do
    include NewRelic::Agent::MethodTracer
    add_method_tracer :initialize
    add_method_tracer :add_to_channel
    add_method_tracer :add_to_unread
    add_method_tracer :propagate_to_channels
    add_method_tracer :can_perform
    add_method_tracer :should_perform
  end

  Mail.class_eval do
    class << self
      include ::NewRelic::Agent::MethodTracer
      add_method_tracer :deliver
    end
  end
end

{'fraction_non_alphanumeric': 0.0645898828236639, 'fraction_numerical': 0.0, 'mean_word_length': 5.238859180035651, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, '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': '6979032', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1149, 'n_words': 199}