Class: Fluent::Plugin::Input
- Defined in:
- lib/fluent/plugin/input.rb
Direct Known Subclasses
Compat::Input, DebugAgentInput, ExecInput, ForwardInput, GCStatInput, HttpInput, MonitorAgentInput, ObjectSpaceInput, SampleInput, SyslogInput, TailInput, TcpInput, UdpInput, UnixInput
Constant Summary
Constants included from Configurable
Configurable::CONFIG_TYPE_REGISTRY
Instance Attribute Summary
Attributes included from Fluent::PluginLoggerMixin
Attributes inherited from Base
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #emit_records ⇒ Object
- #emit_size ⇒ Object
-
#initialize ⇒ Input
constructor
A new instance of Input.
- #metric_callback(es) ⇒ Object
- #multi_workers_ready? ⇒ Boolean
- #statistics ⇒ Object
Methods included from Fluent::PluginHelper::Mixin
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, #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 ⇒ Input
Returns a new instance of Input.
32 33 34 35 36 37 38 |
# File 'lib/fluent/plugin/input.rb', line 32 def initialize super @emit_records_metrics = nil @emit_size_metrics = nil @counter_mutex = Mutex.new @enable_size_metrics = false end |
Instance Method Details
#configure(conf) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/fluent/plugin/input.rb', line 48 def configure(conf) super @emit_records_metrics = metrics_create(namespace: "fluentd", subsystem: "input", name: "emit_records", help_text: "Number of count emit records") @emit_size_metrics = metrics_create(namespace: "fluentd", subsystem: "input", name: "emit_size", help_text: "Total size of emit events") @enable_size_metrics = !!system_config.enable_size_metrics end |
#emit_records ⇒ Object
40 41 42 |
# File 'lib/fluent/plugin/input.rb', line 40 def emit_records @emit_records_metrics.get end |
#emit_size ⇒ Object
44 45 46 |
# File 'lib/fluent/plugin/input.rb', line 44 def emit_size @emit_size_metrics.get end |
#metric_callback(es) ⇒ Object
65 66 67 68 |
# File 'lib/fluent/plugin/input.rb', line 65 def metric_callback(es) @emit_records_metrics.add(es.size) @emit_size_metrics.add(es.to_msgpack_stream.bytesize) if @enable_size_metrics end |
#multi_workers_ready? ⇒ Boolean
70 71 72 |
# File 'lib/fluent/plugin/input.rb', line 70 def multi_workers_ready? false end |
#statistics ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/fluent/plugin/input.rb', line 56 def statistics stats = { 'emit_records' => @emit_records_metrics.get, 'emit_size' => @emit_size_metrics.get, } { 'input' => stats } end |