Class: CloudwatchQuery::Parsers::Rails::RailsLog

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudwatch_query/parsers/rails/rails_log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RailsLog

Returns a new instance of RailsLog.



23
24
25
26
27
28
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 23

def initialize(attributes = {})
  attributes.each do |key, value|
    instance_variable_set("@#{key}", value) if respond_to?(key)
  end
  @line_type ||= :unknown
end

Instance Attribute Details

#action ⇒ Object (readonly)

Returns the value of attribute action.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def action
  @action
end

#arguments ⇒ Object (readonly)

Returns the value of attribute arguments.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def arguments
  @arguments
end

#controller ⇒ Object (readonly)

Returns the value of attribute controller.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def controller
  @controller
end

#duration_ms ⇒ Object (readonly)

Returns the value of attribute duration_ms.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def duration_ms
  @duration_ms
end

#format ⇒ Object (readonly)

Returns the value of attribute format.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def format
  @format
end

#http_method ⇒ Object (readonly)

Returns the value of attribute http_method.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def http_method
  @http_method
end

#ip_address ⇒ Object (readonly)

Returns the value of attribute ip_address.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def ip_address
  @ip_address
end

#job_class ⇒ Object (readonly)

Returns the value of attribute job_class.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def job_class
  @job_class
end

#job_id ⇒ Object (readonly)

Returns the value of attribute job_id.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def job_id
  @job_id
end

#line_type ⇒ Object (readonly)

Returns the value of attribute line_type.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def line_type
  @line_type
end

#params ⇒ Object (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def params
  @params
end

#path ⇒ Object (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def path
  @path
end

#process_id ⇒ Object (readonly)

Returns the value of attribute process_id.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def process_id
  @process_id
end

#queue ⇒ Object (readonly)

Returns the value of attribute queue.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def queue
  @queue
end

#raw_message ⇒ Object (readonly)

Returns the value of attribute raw_message.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def raw_message
  @raw_message
end

#redirect_url ⇒ Object (readonly)

Returns the value of attribute redirect_url.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def redirect_url
  @redirect_url
end

#request_id ⇒ Object (readonly)

Returns the value of attribute request_id.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def request_id
  @request_id
end

#request_timestamp ⇒ Object (readonly)

Returns the value of attribute request_timestamp.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def request_timestamp
  @request_timestamp
end

#server ⇒ Object (readonly)

Returns the value of attribute server.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def server
  @server
end

#status_code ⇒ Object (readonly)

Returns the value of attribute status_code.



7
8
9
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 7

def status_code
  @status_code
end

Instance Method Details

#[](key) ⇒ Object



66
67
68
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 66

def [](key)
  instance_variable_get("@#{key}")
end

#active_job? ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 46

def active_job?
  line_type == :active_job
end

#completed? ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 54

def completed?
  line_type == :completed
end

#parameters? ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 38

def parameters?
  line_type == :parameters
end

#processing? ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 50

def processing?
  line_type == :processing
end

#redirect? ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 42

def redirect?
  line_type == :redirect
end

#request? ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 34

def request?
  line_type == :request
end

#to_h ⇒ Object



58
59
60
61
62
63
64
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 58

def to_h
  instance_variables.each_with_object({}) do |var, hash|
    key = var.to_s.delete("@").to_sym
    value = instance_variable_get(var)
    hash[key] = value unless value.nil?
  end
end

#type ⇒ Object



30
31
32
# File 'lib/cloudwatch_query/parsers/rails/rails_log.rb', line 30

def type
  :rails
end