Module: Cucumber::Newrelic
- Defined in:
- lib/cucumber/newrelic.rb,
lib/cucumber/newrelic/version.rb
Constant Summary collapse
- VERSION =
'0.0.2'
Class Attribute Summary collapse
-
.new_relic_application_id ⇒ Object
Returns the value of attribute new_relic_application_id.
Class Method Summary collapse
- .new_relic_application ⇒ Object
- .new_relic_license_key=(key) ⇒ Object
- .new_relic_metric(name) ⇒ Object
Instance Method Summary collapse
Class Attribute Details
.new_relic_application_id ⇒ Object
Returns the value of attribute new_relic_application_id.
9 10 11 |
# File 'lib/cucumber/newrelic.rb', line 9 def new_relic_application_id @new_relic_application_id end |
Class Method Details
.new_relic_application ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/cucumber/newrelic.rb', line 26 def self.new_relic_application if self.new_relic_application_id @application ||= NewRelicApi::Account.find(:first).applications.find { |a| a.id = self.new_relic_application_id } else @application ||= NewRelicApi::Account.find(:first).applications.first end end |
.new_relic_license_key=(key) ⇒ Object
18 19 20 |
# File 'lib/cucumber/newrelic.rb', line 18 def self.new_relic_license_key=(key) NewRelicApi.license_key = key end |
.new_relic_metric(name) ⇒ Object
22 23 24 |
# File 'lib/cucumber/newrelic.rb', line 22 def self.new_relic_metric(name) new_relic_values.find { |v| v.name.downcase == name.to_s.downcase }.metric_value end |
Instance Method Details
#included ⇒ Object
12 13 14 15 16 |
# File 'lib/cucumber/newrelic.rb', line 12 def included #kludge to use the NewRelic API outside of rails NewRelicApi.host = "rpm.newrelic.com" NewRelicApi.port = 80 end |