Class: Remnant::Configuration
- Inherits:
-
Object
- Object
- Remnant::Configuration
- Defined in:
- lib/remnant/configuration.rb
Instance Attribute Summary collapse
-
#custom_hook ⇒ Object
readonly
allow applications to run custom code with stats.
-
#env ⇒ Object
readonly
environment of application.
-
#hostname ⇒ Object
readonly
hostname to send to.
-
#port_number ⇒ Object
readonly
port to send to.
-
#sample_rate ⇒ Object
readonly
how often to use results.
-
#tag ⇒ Object
readonly
api key to use with payloads.
Instance Method Summary collapse
- #defaults! ⇒ Object
- #environment(value) ⇒ Object
- #hook(&block) ⇒ Object
- #host(value) ⇒ Object
- #port(value) ⇒ Object
- #sample(value) ⇒ Object
- #tagged(value) ⇒ Object
Instance Attribute Details
#custom_hook ⇒ Object (readonly)
allow applications to run custom code with stats
19 20 21 |
# File 'lib/remnant/configuration.rb', line 19 def custom_hook @custom_hook end |
#env ⇒ Object (readonly)
environment of application
4 5 6 |
# File 'lib/remnant/configuration.rb', line 4 def env @env end |
#hostname ⇒ Object (readonly)
hostname to send to
7 8 9 |
# File 'lib/remnant/configuration.rb', line 7 def hostname @hostname end |
#port_number ⇒ Object (readonly)
port to send to
10 11 12 |
# File 'lib/remnant/configuration.rb', line 10 def port_number @port_number end |
#sample_rate ⇒ Object (readonly)
how often to use results
16 17 18 |
# File 'lib/remnant/configuration.rb', line 16 def sample_rate @sample_rate end |
#tag ⇒ Object (readonly)
api key to use with payloads
13 14 15 |
# File 'lib/remnant/configuration.rb', line 13 def tag @tag end |
Instance Method Details
#defaults! ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/remnant/configuration.rb', line 45 def defaults! # configure some defaults @hostname = '127.0.0.1' @port_number = 8125 @tag = 'remnant' @sample_rate = 10 self end |
#environment(value) ⇒ Object
33 34 35 |
# File 'lib/remnant/configuration.rb', line 33 def environment(value) @env = value end |
#hook(&block) ⇒ Object
41 42 43 |
# File 'lib/remnant/configuration.rb', line 41 def hook(&block) @custom_hook = block end |
#host(value) ⇒ Object
21 22 23 |
# File 'lib/remnant/configuration.rb', line 21 def host(value) @hostname = value end |
#port(value) ⇒ Object
25 26 27 |
# File 'lib/remnant/configuration.rb', line 25 def port(value) @port_number = value end |
#sample(value) ⇒ Object
37 38 39 |
# File 'lib/remnant/configuration.rb', line 37 def sample(value) @sample_rate = value end |
#tagged(value) ⇒ Object
29 30 31 |
# File 'lib/remnant/configuration.rb', line 29 def tagged(value) @tag = value end |