Class: NewRelic::Agent::Utilization::GCP
- Defined in:
- lib/new_relic/agent/utilization/gcp.rb
Constant Summary collapse
- MACH_TYPE =
'machineType'.freeze
- ZONE =
'zone'.freeze
- SLASH =
'/'.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
#prepare_response(response) ⇒ Object
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 |
#trim_leading(value) ⇒ Object
29 30 31 |
# File 'lib/new_relic/agent/utilization/gcp.rb', line 29 def trim_leading(value) value.split(SLASH).last end |