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

Methods included from Util::Loggable

included, #logger, #slow_logger

Constructor Details

#initialize(agent) ⇒ Service

Returns a new instance of Service.



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

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.



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

def agent
  @agent
end

Instance Method Details

#extract_metrics(path, *keys) ⇒ Object



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

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

#get_shallow(*path) ⇒ Object



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

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

#snapshotObject



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

def snapshot
  agent.metric.collector.snapshot_metric
end

#started?Boolean

Returns:

  • (Boolean)


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

def started?
  true
end