Class: ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyMetricsTask

Inherits:
Object
  • Object
show all
Includes:
Task
Defined in:
lib/3scale_toolbox/commands/service_command/copy_command/copy_metrics_task.rb

Instance Attribute Summary

Attributes included from Task

#context

Instance Method Summary collapse

Methods included from Task

#delete_mapping_rules, #find_source_service, #force_delete_mapping_rules, #initialize, #invalidate_target_methods, #invalidate_target_metrics, #option_target_system_name, #source, #source_hits, #source_methods, #source_metrics, #source_metrics_and_methods, #source_remote, #source_service_ref, #target, #target=, #target_hits, #target_methods, #target_metrics, #target_metrics_and_methods, #target_remote

Instance Method Details

#callObject



8
9
10
11
12
13
14
# File 'lib/3scale_toolbox/commands/service_command/copy_command/copy_metrics_task.rb', line 8

def call
  puts "original service has #{source_metrics.size} metrics"
  puts "target service has #{target_metrics.size} metrics"
  missing_metrics.each(&method(:create_metric))
  puts "created #{missing_metrics.size} metrics on the target service"
  invalidate_target_metrics if missing_metrics.size.positive?
end