Class: PEClient::Resource::MetricsV2

Inherits:
BaseWithPort show all
Defined in:
lib/pe_client/resources/metrics.v2.rb

Overview

The Metrics v2 endpoints use the Jolokia library for Java Management Extension (JMX) metrics to query Orchestrator service metrics.

Constant Summary collapse

BASE_PATH =

The base path for Metrics API v2 endpoints.

"/metrics/v2"
PORT =

Default Metrics v2 API Port

8081

Instance Method Summary collapse

Methods inherited from BaseWithPort

#initialize

Constructor Details

This class inherits a constructor from PEClient::Resource::BaseWithPort

Instance Method Details

#complex_read(body) ⇒ Hash

Use more complicated queries to retrieve orchestrator service metrics data or metadata.

Parameters:

  • body (Hash, Array<Hash>)

    Request body as per Jolokia protocol.

Returns:

  • (Hash)

See Also:



60
61
62
# File 'lib/pe_client/resources/metrics.v2.rb', line 60

def complex_read(body)
  @client.post "#{BASE_PATH}/read", body:
end

#listHash

Get a list of all valid MBeans

Returns:

  • (Hash)


34
35
36
# File 'lib/pe_client/resources/metrics.v2.rb', line 34

def list
  @client.get "#{BASE_PATH}/list"
end

#read(mbean_names:, attributes:, inner_path_filter: nil) ⇒ Hash

Retrieve orchestrator service metrics data or metadata.

Parameters:

  • mbean_names (String)

    MBean names are created by joining the first two keys in the list response’s value object with a colon (which are the domain and prop list, in Jolokia terms). Such as “java.util.logging:type=Logging” If you specify multiple MBean names or attributes, use comma separation, such as: “java.lang:name=*,type=GarbageCollector”

  • attributes (String)

    Attributes are derived from the attr object, which is within the value object in the list response.

  • inner_path_filter (String) (defaults to: nil)

    Depends on the MBeans and attributes you are querying.

Returns:

  • (Hash)


47
48
49
50
51
# File 'lib/pe_client/resources/metrics.v2.rb', line 47

def read(mbean_names:, attributes:, inner_path_filter: nil)
  path = "#{BASE_PATH}/read/#{mbean_names}/#{attributes}"
  path += "/#{inner_path_filter}" if inner_path_filter
  @client.get path
end