lib/bolt/executor.rb in bolt-0.20.6 vs lib/bolt/executor.rb in bolt-0.20.7
- old
+ new
@@ -121,10 +121,14 @@
name = transport.class.name.split('::').last.downcase
@analytics&.event('Transport', 'initialize', name, count) unless @reported_transports.include?(name)
@reported_transports.add(name)
end
+ def report_function_call(function)
+ @analytics&.event('Plan', 'call_function', function)
+ end
+
def with_node_logging(description, batch)
@logger.info("#{description} on #{batch.map(&:uri)}")
result = yield
@logger.info(result.to_json)
result
@@ -168,9 +172,10 @@
def run_task(targets, task, arguments, options = {}, &callback)
description = options.fetch('_description', "task #{task.name}")
log_action(description, targets) do
notify = proc { |event| @notifier.notify(callback, event) if callback }
options = { '_run_as' => run_as }.merge(options) if run_as
+ arguments['_task'] = task.name
results = batch_execute(targets) do |transport, batch|
with_node_logging("Running task #{task.name} with '#{arguments}' via #{task.input_method}", batch) do
transport.batch_task(batch, task, arguments, options, ¬ify)
end