Class: CircleciDeploymentNotifier::NewRelic

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

Overview

Sends deployment notification to New Relic. Builds the message using a BuildInfo object.

Instance Method Summary collapse

Constructor Details

#initialize(new_relic_api_key:, new_relic_app_id:, build_info:) ⇒ NewRelic

Returns a new instance of NewRelic.

Parameters:

  • new_relic_api_key (String)

    New Relic API Key

  • new_relic_app_id (String)

    New Relic Application ID

  • build_info (BuildInfo)


14
15
16
17
18
# File 'lib/circleci_deployment_notifier/new_relic.rb', line 14

def initialize(new_relic_api_key:, new_relic_app_id:, build_info:)
  self.new_relic_api_key = new_relic_api_key
  self.new_relic_app_id = new_relic_app_id
  self.build_info = build_info
end

Instance Method Details

#sendBoolean

Sends the deployment notification to New Relic.

Returns:

  • (Boolean)

    Whether the request was successful.



23
24
25
# File 'lib/circleci_deployment_notifier/new_relic.rb', line 23

def send
  http_response.code == 201
end