class Pod::TimeProfiler
Attributes
instance[W]
time_line[RW]
Hash {
stage:{ :start => Date, step => { :start :end } }
}
Public Class Methods
instance()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 139 def instance @instance ||= new end
Public Instance Methods
add_milestone_start(stage, step)
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 14 def add_milestone_start stage, step @time_line ||= Hash.new @time_line[stage] ||= begin rs = Hash.new rs end @time_line[stage][step] = { :start => Time.new.getutc.to_i } end
add_milestone_stop(stage, step)
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 25 def add_milestone_stop stage, step raise "timeline is not start" unless @time_line raise "stage #{stage} is not start" unless @time_line[stage] raise "step #{step} is not start" unless @time_line[stage][step] @time_line[stage][step][:stop] = Time.new.getutc.to_i end
default_step()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 88 def default_step "default_step" end
format()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 68 def format result = Hash.new total_line = @time_line[total_stage] if total_line result["total"] = total_line[default_step][:stop] - total_line[default_step][:start] end stages.each do |stage| stage_line = @time_line[stage] if stage_line stage_cost = stage_line[default_step][:stop] - stage_line[default_step][:start] result[stage] = stage_cost end end result end
format_prints()
click to toggle source
-
total: 1s
– prepare: 0s – resolve_dependencies: 0s — run_source_provider_hooks: 0s — create_analyzer: 0s — analyze: 1s – download_dependencies: 0s — install_pod_sources: 0s — run_podfile_pre_install_hooks: 0s — clean_pod_sources: 0s – validate_targets: 0s – integrate: 0s — generate_pods_project: 0s — integrate_user_project: 0s – write_lockfiles: 0s – perform_post_install_actions: 0s
# File lib/cocoapods-pdk8/time_profiler.rb, line 47 def format_prints result = [] total_line = @time_line[total_stage] if total_line result << "- total: #{total_line[default_step][:stop] - total_line[default_step][:start]}s".yellow end stages.each do |stage| stage_line = @time_line[stage] if stage_line stage_cost = stage_line[default_step][:stop] - stage_line[default_step][:start] result << "-- #{stage}: #{stage_cost}s".yellow stage_line.each do |step, values| if step != default_step result << "--- #{step}: #{values[:stop] - values[:start]}s" end end end end result end
stage_download_dependencies()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 113 def stage_download_dependencies "download_dependencies" end
stage_integrate()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 125 def stage_integrate "integrate" end
stage_perform_post_install_actions()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 133 def stage_perform_post_install_actions "perform_post_install_actions" end
stage_prepare()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 105 def stage_prepare "prepare" end
stage_resolve_dependencies()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 109 def stage_resolve_dependencies "resolve_dependencies" end
stage_show_skip_pods_project_generation_message()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 121 def stage_show_skip_pods_project_generation_message "show_skip_pods_project_generation_message" end
stage_validate_targets()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 117 def stage_validate_targets "validate_targets" end
stage_write_lockfiles()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 129 def stage_write_lockfiles "write_lockfiles" end
stages()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 92 def stages [ stage_prepare, stage_resolve_dependencies, stage_download_dependencies, stage_validate_targets, stage_show_skip_pods_project_generation_message, stage_integrate, stage_write_lockfiles, stage_perform_post_install_actions ] end
total_stage()
click to toggle source
# File lib/cocoapods-pdk8/time_profiler.rb, line 84 def total_stage "total_stage" end