Class: Fluent::Plugin::Metrics
- Includes:
- Fluent::PluginId, Fluent::PluginLoggerMixin, UniqueId::Mixin
- Defined in:
- lib/fluent/plugin/metrics.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_TYPE =
'local'
Constants included from Configurable
Configurable::CONFIG_TYPE_REGISTRY
Instance Attribute Summary collapse
-
#has_methods_for_counter ⇒ Object
readonly
Returns the value of attribute has_methods_for_counter.
-
#has_methods_for_gauge ⇒ Object
readonly
Returns the value of attribute has_methods_for_gauge.
-
#use_gauge_metric ⇒ Object
Returns the value of attribute use_gauge_metric.
Attributes included from Fluent::PluginLoggerMixin
Attributes inherited from Base
Instance Method Summary collapse
- #add(value) ⇒ Object
- #configure(conf) ⇒ Object
- #create(namespace:, subsystem:, name:, help_text:, labels: {}) ⇒ Object
- #dec ⇒ Object
- #get ⇒ Object
- #inc ⇒ Object
-
#initialize ⇒ Metrics
constructor
A new instance of Metrics.
- #set(value) ⇒ Object
- #sub(value) ⇒ Object
Methods included from UniqueId::Mixin
#dump_unique_id_hex, #generate_unique_id
Methods included from Fluent::PluginLoggerMixin
Methods included from Fluent::PluginId
#plugin_id, #plugin_id_configured?, #plugin_id_for_test?, #plugin_root_dir, #stop
Methods inherited from Base
#acquire_worker_lock, #after_shutdown, #after_shutdown?, #after_start, #after_started?, #before_shutdown, #before_shutdown?, #called_in_test?, #close, #closed?, #configured?, #context_router, #context_router=, #fluentd_worker_id, #get_lock_path, #has_router?, #inspect, #multi_workers_ready?, #plugin_root_dir, #reloadable_plugin?, #shutdown, #shutdown?, #start, #started?, #stop, #stopped?, #string_safe_encoding, #terminate, #terminated?
Methods included from SystemConfig::Mixin
#system_config, #system_config_override
Methods included from Configurable
#config, #configure_proxy_generate, #configured_section_create, included, lookup_type, register_type
Constructor Details
#initialize ⇒ Metrics
Returns a new instance of Metrics.
42 43 44 45 46 47 48 |
# File 'lib/fluent/plugin/metrics.rb', line 42 def initialize super @has_methods_for_counter = false @has_methods_for_gauge = false @use_gauge_metric = false end |
Instance Attribute Details
#has_methods_for_counter ⇒ Object (readonly)
Returns the value of attribute has_methods_for_counter.
40 41 42 |
# File 'lib/fluent/plugin/metrics.rb', line 40 def has_methods_for_counter @has_methods_for_counter end |
#has_methods_for_gauge ⇒ Object (readonly)
Returns the value of attribute has_methods_for_gauge.
40 41 42 |
# File 'lib/fluent/plugin/metrics.rb', line 40 def has_methods_for_gauge @has_methods_for_gauge end |
#use_gauge_metric ⇒ Object
Returns the value of attribute use_gauge_metric.
39 40 41 |
# File 'lib/fluent/plugin/metrics.rb', line 39 def use_gauge_metric @use_gauge_metric end |
Instance Method Details
#add(value) ⇒ Object
82 83 84 |
# File 'lib/fluent/plugin/metrics.rb', line 82 def add(value) raise NotImplementedError, "Implement this method in child class" end |
#configure(conf) ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/fluent/plugin/metrics.rb', line 50 def configure(conf) super if use_gauge_metric @has_methods_for_gauge = has_methods_for_gauge? else @has_methods_for_counter = has_methods_for_counter? end end |
#create(namespace:, subsystem:, name:, help_text:, labels: {}) ⇒ Object
66 67 68 |
# File 'lib/fluent/plugin/metrics.rb', line 66 def create(namespace:, subsystem:,name:,help_text:,labels: {}) # This API is for cmetrics type. end |
#dec ⇒ Object
78 79 80 |
# File 'lib/fluent/plugin/metrics.rb', line 78 def dec raise NotImplementedError, "Implement this method in child class" end |
#get ⇒ Object
70 71 72 |
# File 'lib/fluent/plugin/metrics.rb', line 70 def get raise NotImplementedError, "Implement this method in child class" end |
#inc ⇒ Object
74 75 76 |
# File 'lib/fluent/plugin/metrics.rb', line 74 def inc raise NotImplementedError, "Implement this method in child class" end |
#set(value) ⇒ Object
90 91 92 |
# File 'lib/fluent/plugin/metrics.rb', line 90 def set(value) raise NotImplementedError, "Implement this method in child class" end |
#sub(value) ⇒ Object
86 87 88 |
# File 'lib/fluent/plugin/metrics.rb', line 86 def sub(value) raise NotImplementedError, "Implement this method in child class" end |