Class: CloudwatchQuery::Parsers::Rails::ProcessingSubParser

Inherits:
Object
  • Object
show all
Includes:
SubParser
Defined in:
lib/cloudwatch_query/parsers/rails/sub_parsers.rb

Overview

Parses: "Processing by Controller#action as FORMAT"

Constant Summary collapse

PROCESSING_REGEX =
/Processing by\s+(?<controller>\w+)#(?<action>\w+)\s+as\s+(?<format>\w+)/

Class Method Summary collapse

Methods included from SubParser

included

Class Method Details

.matches?(message) ⇒ Boolean

Returns:

  • (Boolean)


133
134
135
# File 'lib/cloudwatch_query/parsers/rails/sub_parsers.rb', line 133

def self.matches?(message)
  message.include?("Processing by ")
end

.parse(message, _base_data) ⇒ Object



137
138
139
140
141
142
143
144
145
146
147
# File 'lib/cloudwatch_query/parsers/rails/sub_parsers.rb', line 137

def self.parse(message, _base_data)
  match = message.match(PROCESSING_REGEX)
  return {} unless match

  {
    line_type: :processing,
    controller: match[:controller],
    action: match[:action],
    format: match[:format]
  }
end