Class: MetOnTheMiddle::Configuration
- Inherits:
-
Object
- Object
- MetOnTheMiddle::Configuration
- Defined in:
- lib/met_on_the_middle/configuration.rb
Instance Attribute Summary collapse
-
#event_mode ⇒ Object
type of timer to use, valid options are :sleep (default), :eventmachine, or :synchrony.
-
#flush_interval ⇒ Object
Tempo in secondi ogni quanto eseguire un flush dei dati.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#mounting_enviroments ⇒ Object
Enviroments dove installare il middleware default a sola produzione.
-
#notifications_event_matcher ⇒ Object
Regular expression per selezionare l’event matcher.
-
#sender ⇒ Object
Definisce la classe da utilizzare per spedire/registrazione le informazioni Default a MetOnTheMiddle::Senders::FileSystem configurato per scrivere in un file dentro alla cartella log dell’applicativo Rails.
-
#tracker ⇒ Object
readonly
Returns the value of attribute tracker.
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #readers ⇒ Object
- #readers=(array) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/met_on_the_middle/configuration.rb', line 32 def initialize @notifications_event_matcher = /.*/ @event_mode= :sleep @tracker = nil @logger = Rails.logger @sender = Senders::FileSystem.new(Rails.root.join('log/met_on_the_middle.log')) @flush_interval = 60 @mounting_enviroments = [:production] self.readers = [:RequestCount, :TotalTime, :DatabaseTime, :ViewTime] end |
Instance Attribute Details
#event_mode ⇒ Object
type of timer to use, valid options are :sleep (default), :eventmachine, or :synchrony
10 11 12 |
# File 'lib/met_on_the_middle/configuration.rb', line 10 def event_mode @event_mode end |
#flush_interval ⇒ Object
Tempo in secondi ogni quanto eseguire un flush dei dati
14 15 16 |
# File 'lib/met_on_the_middle/configuration.rb', line 14 def flush_interval @flush_interval end |
#logger ⇒ Object
Returns the value of attribute logger.
27 28 29 |
# File 'lib/met_on_the_middle/configuration.rb', line 27 def logger @logger end |
#mounting_enviroments ⇒ Object
Enviroments dove installare il middleware default a sola produzione
19 20 21 |
# File 'lib/met_on_the_middle/configuration.rb', line 19 def mounting_enviroments @mounting_enviroments end |
#notifications_event_matcher ⇒ Object
Regular expression per selezionare l’event matcher
6 7 8 |
# File 'lib/met_on_the_middle/configuration.rb', line 6 def notifications_event_matcher @notifications_event_matcher end |
#sender ⇒ Object
Definisce la classe da utilizzare per spedire/registrazione le informazioni Default a MetOnTheMiddle::Senders::FileSystem configurato per scrivere in un file dentro alla cartella log dell’applicativo Rails
25 26 27 |
# File 'lib/met_on_the_middle/configuration.rb', line 25 def sender @sender end |
#tracker ⇒ Object (readonly)
Returns the value of attribute tracker.
30 31 32 |
# File 'lib/met_on_the_middle/configuration.rb', line 30 def tracker @tracker end |
Instance Method Details
#dump ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/met_on_the_middle/configuration.rb', line 44 def dump { notifications_event_matcher: :notifications_event_matcher, event_mode: :event_mode } end |
#readers ⇒ Object
64 65 66 |
# File 'lib/met_on_the_middle/configuration.rb', line 64 def readers @_readers end |
#readers=(array) ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/met_on_the_middle/configuration.rb', line 54 def readers=(array) @_readers = array.collect {|c| if c.is_a?(Symbol) Readers.const_get(c) else c end } end |