Module: Appstats

Defined in:
lib/appstats.rb,
lib/appstats/host.rb,
lib/appstats/audit.rb,
lib/appstats/entry.rb,
lib/appstats/query.rb,
lib/appstats/tasks.rb,
lib/appstats/action.rb,
lib/appstats/logger.rb,
lib/appstats/parser.rb,
lib/appstats/result.rb,
lib/appstats/context.rb,
lib/appstats/version.rb,
lib/appstats/date_range.rb,
lib/appstats/entry_date.rb,
lib/appstats/result_job.rb,
lib/appstats/sub_result.rb,
lib/appstats/test_query.rb,
lib/appstats/benchmarker.rb,
lib/appstats/context_key.rb,
lib/appstats/test_object.rb,
lib/appstats/context_value.rb,
lib/appstats/log_collector.rb,
lib/appstats/appstats_query.rb,
lib/appstats/friendly_timer.rb,
lib/appstats/inmemory_redis.rb,
lib/appstats/action_context_key.rb

Defined Under Namespace

Modules: Core Classes: Action, ActionContextKey, AppstatsQuery, Audit, BadGroupTestQuery, BadTestQuery, Benchmarker, Context, ContextKey, ContextValue, DateRange, Entry, EntryDate, FriendlyTimer, Host, InmemoryRedis, InvalidTestQuery, LogCollector, Logger, Parser, Query, Result, ResultJob, SubResult, Tasks, TestObject, TestQuery

Constant Summary collapse

VERSION =
"0.25.1"

Class Method Summary collapse

Class Method Details

.connectionObject



79
80
81
# File 'lib/appstats.rb', line 79

def self.connection
  Appstats::Entry.new.connection
end

.log(type, raw_message) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/appstats.rb', line 62

def self.log(type,raw_message)
  message = "VERSION #{Appstats::VERSION} : #{raw_message}"
  if !$logger.nil?
    $logger.send(type,message)
  elsif defined?(Rails)
    Rails.logger.send(type,message) unless Rails.logger.nil?
  elsif defined?(RAILS_DEFAULT_LOGGER)
    RAILS_DEFAULT_LOGGER.send(type,message)
  else
    # puts "LOCAL LOG #{type}: #{message}"
  end
end

.rails3?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/appstats.rb', line 75

def self.rails3?
  Appstats::Action.respond_to?(:where)
end

.table_nameObject



6
# File 'lib/appstats/tasks.rb', line 6

def self.table_name() "mice" end