Class: LogStash::Api::Service
- Inherits:
-
Object
- Object
- LogStash::Api::Service
- Includes:
- Util::Loggable
- Defined in:
- lib/logstash/api/service.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
Instance Method Summary collapse
- #extract_metrics(path, *keys) ⇒ Object
- #get_shallow(*path) ⇒ Object
-
#initialize(agent) ⇒ Service
constructor
A new instance of Service.
- #snapshot ⇒ Object
- #started? ⇒ Boolean
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
#agent ⇒ Object (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 |
#snapshot ⇒ Object
20 21 22 |
# File 'lib/logstash/api/service.rb', line 20 def snapshot agent.metric.collector.snapshot_metric end |
#started? ⇒ Boolean
16 17 18 |
# File 'lib/logstash/api/service.rb', line 16 def started? true end |