Class: NewRelic::Agent::Utilization::GCP
- Defined in:
- lib/new_relic/agent/utilization/gcp.rb
Constant Summary collapse
- MACH_TYPE =
'machineType'.freeze
- ZONE =
'zone'.freeze
Constants inherited from Vendor
Instance Attribute Summary
Attributes inherited from Vendor
Instance Method Summary collapse
Methods inherited from Vendor
#detect, endpoint, headers, #initialize, key_transforms, keys, processed_headers, vendor_name
Constructor Details
This class inherits a constructor from NewRelic::Agent::Utilization::Vendor
Instance Method Details
permalink #prepare_response(response) ⇒ Object
[View source]
20 21 22 23 24 25 |
# File 'lib/new_relic/agent/utilization/gcp.rb', line 20 def prepare_response(response) body = JSON.parse(response.body) body[MACH_TYPE] = trim_leading(body[MACH_TYPE]) body[ZONE] = trim_leading(body[ZONE]) body end |
permalink #trim_leading(value) ⇒ Object
[View source]
27 28 29 |
# File 'lib/new_relic/agent/utilization/gcp.rb', line 27 def trim_leading(value) value.split(NewRelic::SLASH).last end |