Skip to content
Browse files

consistently tracking duration for all syncers

  • Loading branch information...
1 parent aedc23a commit cb62c80709068724b37c498cd2aa55fd37f99702 @dhruvbansal dhruvbansal committed Sep 20, 2013
View
3 lib/wukong-load/syncers/ftp_syncer.rb
@@ -10,9 +10,6 @@ class FTPSyncer < Syncer
include Logging
- # Time taken to complete sync.
- attr_accessor :duration
-
# A mapping between protocal names and the standard ports
# those services run on.
PROTOCOLS = {
View
2 lib/wukong-load/syncers/prepare_syncer.rb
@@ -201,6 +201,7 @@ def after_sync
# sizes in the `input` directory, but will log a message at the
# `DEBUG` level for each file it would have processed.
def sync
+ started_at = Time.now
absolute_input_directory.find do |path|
next if path.directory?
self.files[:examined] += 1
@@ -210,6 +211,7 @@ def sync
end
same_size?(path) ? process!(path) : remember_size!(path)
end
+ self.duration = (Time.now - started_at)
ensure
save_file_state!
end
View
3 lib/wukong-load/syncers/s3_syncer.rb
@@ -15,9 +15,6 @@ class S3Syncer < Syncer
# Number of bytes synced.
attr_accessor :bytes
- # Number of seconds taken to complete sync.
- attr_accessor :duration
-
# Construct a new S3Syncer from the given `settings` for the
# given `source` with the given `name`.
#
View
3 lib/wukong-load/syncers/syncer.rb
@@ -12,6 +12,9 @@ class Syncer
# Name of this syncer.
attr_accessor :name
+ # Time taken to complete sync.
+ attr_accessor :duration
+
# Construct a new Syncer from the given `settings` for the given
# `source` with the given `name`.
#

0 comments on commit cb62c80

Please sign in to comment.
Something went wrong with that request. Please try again.