Skip to content

Commit

Permalink
perf: avoid using merge for a single key/val tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
isimluk committed Sep 18, 2023
1 parent 6939f2f commit a3da628
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/fluent/command/binlog_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def initialize(argv = ARGV)
private

def configure_option_parser
@options.merge!(config_params: {})
@options[:config_params] = {}

@opt_parser.banner = "Usage: fluent-binlog-reader #{self.class.to_s.split('::').last.downcase} [options] file"

Expand Down
4 changes: 2 additions & 2 deletions lib/fluent/plugin_helper/metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def metrics_create(namespace: "fluentd", subsystem: "metrics", name:, help_text:
metrics.configure(config)
# For multi workers environment, cmetrics should be distinguish with static labels.
if Fluent::Engine.system_config.workers > 1
labels.merge!(worker_id: fluentd_worker_id.to_s)
labels[:worker_id] = fluentd_worker_id.to_s
end
labels.merge!(plugin: @plugin_type_or_id)
labels[:plugin] = @plugin_type_or_id
metrics.create(namespace: namespace, subsystem: subsystem, name: name, help_text: help_text, labels: labels)

@_metrics["#{@plugin_type_or_id}_#{namespace}_#{subsystem}_#{name}"] = metrics
Expand Down

0 comments on commit a3da628

Please sign in to comment.