Module: Elasticsearch::API::Profiling::Actions

Included in:
ProfilingClient
Defined in:
lib/elasticsearch/api/namespace/profiling.rb,
lib/elasticsearch/api/actions/profiling/status.rb,
lib/elasticsearch/api/actions/profiling/flamegraph.rb,
lib/elasticsearch/api/actions/profiling/stacktraces.rb,
lib/elasticsearch/api/actions/profiling/topn_functions.rb

Instance Method Summary collapse

Instance Method Details

#flamegraph(arguments = {}) ⇒ Object

Extracts a UI-optimized structure to render flamegraphs from Universal Profiling.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The filter conditions for the flamegraph (Required)

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/api/actions/profiling/flamegraph.rb', line 32

def flamegraph(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'profiling.flamegraph' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_profiling/flamegraph'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#stacktraces(arguments = {}) ⇒ Object

Extracts raw stacktrace information from Universal Profiling.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The filter conditions for stacktraces (Required)

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/api/actions/profiling/stacktraces.rb', line 32

def stacktraces(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'profiling.stacktraces' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_profiling/stacktraces'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#status(arguments = {}) ⇒ Object

Returns basic information about the status of Universal Profiling.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :timeout (Time)

    Explicit operation timeout

  • :wait_for_resources_created (Boolean)

    Whether to return immediately or wait until resources have been created

  • :headers (Hash)

    Custom HTTP headers

See Also:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/api/actions/profiling/status.rb', line 34

def status(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'profiling.status' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_profiling/status'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#topn_functions(arguments = {}) ⇒ Object

Extracts a list of topN functions from Universal Profiling.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The filter conditions for stacktraces (Required)

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/api/actions/profiling/topn_functions.rb', line 32

def topn_functions(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'profiling.topn_functions' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_profiling/topn/functions'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end