Class: KalibroClient::Entities::Processor::MetricCollectorDetails
- Inherits:
-
Base
- Object
- Likeno::Entity
- Base
- Base
- KalibroClient::Entities::Processor::MetricCollectorDetails
show all
- Defined in:
- lib/kalibro_client/entities/processor/metric_collector_details.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
address
Methods inherited from Base
#kalibro_errors, module_name
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
21
22
23
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 21
def description
@description
end
|
#name ⇒ Object
Returns the value of attribute name.
21
22
23
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 21
def name
@name
end
|
#supported_metrics ⇒ Object
Returns the value of attribute supported_metrics.
21
22
23
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 21
def supported_metrics
@supported_metrics
end
|
Class Method Details
.all_names ⇒ Object
67
68
69
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 67
def self.all_names
request(:names, {}, :get)['metric_collector_names'].to_a
end
|
.find_by_name(metric_collector_name) ⇒ Object
55
56
57
58
59
60
61
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 55
def self.find_by_name(metric_collector_name)
begin
self.find_by_name!(metric_collector_name)
rescue Likeno::Errors::RecordNotFound
nil
end
end
|
.find_by_name!(metric_collector_name) ⇒ Object
63
64
65
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 63
def self.find_by_name!(metric_collector_name)
new request(:find, {name: metric_collector_name})["metric_collector_details"]
end
|
Instance Method Details
#find_metric_by_code(metric_code) ⇒ Object
45
46
47
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 45
def find_metric_by_code(metric_code)
@supported_metrics[metric_code]
end
|
#find_metric_by_code!(metric_code) ⇒ Object
49
50
51
52
53
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 49
def find_metric_by_code!(metric_code)
metric = self.find_metric_by_code(metric_code)
raise Likeno::Errors::RecordNotFound if metric.nil?
metric
end
|
#find_metric_by_name(name) ⇒ Object
34
35
36
37
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 34
def find_metric_by_name(name)
metric = self.supported_metrics.find {|code, metric| metric.name == name}
metric.nil? ? nil : metric.last
end
|
#find_metric_by_name!(name) ⇒ Object
39
40
41
42
43
|
# File 'lib/kalibro_client/entities/processor/metric_collector_details.rb', line 39
def find_metric_by_name!(name)
metric = self.find_metric_by_name(name)
raise Likeno::Errors::RecordNotFound if metric.nil?
metric
end
|