Class: SqlMetrics::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/sql_metrics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/sql_metrics.rb', line 13

def initialize
  self.host = nil
  self.port = 5432
  self.options = nil
  self.tty = nil
  self.db_name = nil
  self.user = nil
  self.password = nil
  self.database_schema = 'public'
  self.event_table_name = 'events'

  self.bots_regex = /Googlebot|Pingdom|bing|Yahoo|Amazon|Twitter|Yandex|majestic12/i

  self.logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
end

Instance Attribute Details

#bots_regexObject

Returns the value of attribute bots_regex.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def bots_regex
  @bots_regex
end

#database_schemaObject

Returns the value of attribute database_schema.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def database_schema
  @database_schema
end

#db_nameObject

Returns the value of attribute db_name.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def db_name
  @db_name
end

#event_table_nameObject

Returns the value of attribute event_table_name.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def event_table_name
  @event_table_name
end

#hostObject

Returns the value of attribute host.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def host
  @host
end

#loggerObject

Returns the value of attribute logger.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def logger
  @logger
end

#optionsObject

Returns the value of attribute options.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def options
  @options
end

#passwordObject

Returns the value of attribute password.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def password
  @password
end

#portObject

Returns the value of attribute port.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def port
  @port
end

#ttyObject

Returns the value of attribute tty.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def tty
  @tty
end

#userObject

Returns the value of attribute user.



10
11
12
# File 'lib/sql_metrics.rb', line 10

def user
  @user
end