Class: LogStash::Api::Service

Inherits:
Object
  • Object
show all
Includes:
Util::Loggable
Defined in:
lib/logstash/api/service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(agent) ⇒ Service

Returns a new instance of Service.



11
12
13
14
# File 'lib/logstash/api/service.rb', line 11

def initialize(agent)
  @agent = agent
  logger.debug("[api-service] start") if logger.debug?
end

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent.



9
10
11
# File 'lib/logstash/api/service.rb', line 9

def agent
  @agent
end

Instance Method Details

#extract_metrics(path, *keys) ⇒ Object



28
29
30
# File 'lib/logstash/api/service.rb', line 28

def extract_metrics(path, *keys)
  snapshot.metric_store.extract_metrics(path, *keys)
end

#get_shallow(*path) ⇒ Object



24
25
26
# File 'lib/logstash/api/service.rb', line 24

def get_shallow(*path)
  snapshot.metric_store.get_shallow(*path)
end

#snapshotObject



20
21
22
# File 'lib/logstash/api/service.rb', line 20

def snapshot
  agent.metric.collector.snapshot_metric
end

#started?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/logstash/api/service.rb', line 16

def started?
  true
end