Skip to content

Commit

Permalink
@ #465 | add logging timer
Browse files Browse the repository at this point in the history
  • Loading branch information
hoatle committed Oct 12, 2018
1 parent 550fbc1 commit e90308d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/teracy-dev/extension/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ def initialize
end

def install(extensions)
@logger.debug("install: #{extensions}")
@logger.debug("extensions: #{extensions}")
timer_start = Time.now
extensions.each do |extension|
sync(extension)
validate(extension)
end
timer_end = Time.now
@logger.debug("installation finished in #{timer_end - timer_start}s of extensions: #{extensions}")
end

private
Expand Down
6 changes: 6 additions & 0 deletions lib/teracy-dev/location/manager.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
require_relative '../logging'

require_relative 'git_synch'

module TeracyDev
module Location
class Manager
@@synch_list = [GitSynch.new]
@@logger = TeracyDev::Logging.logger_for(self)

# return true if location is updated, otherwise, return false (no sync)
def self.sync(location, sync_existing = true)
updated = false
timer_start = Time.now
@@synch_list.each do |synch|
if synch.sync(location, sync_existing) == true
updated = true
end
end
timer_end = Time.now
@@logger.debug("sync finished in #{timer_end - timer_start}s with updated: #{updated}, location: #{location}")
updated
end
end
Expand Down

0 comments on commit e90308d

Please sign in to comment.