Class: Rets::ClientProgressReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/rets/client_progress_reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger, stats, stats_prefix) ⇒ ClientProgressReporter

Returns a new instance of ClientProgressReporter.



15
16
17
18
19
# File 'lib/rets/client_progress_reporter.rb', line 15

def initialize(logger, stats, stats_prefix)
  @logger = logger
  @stats = stats || NullStatsReporter.new
  @stats_prefix = stats_prefix
end

Instance Method Details

#bad_cached_metadata(cached_metadata) ⇒ Object



40
41
42
# File 'lib/rets/client_progress_reporter.rb', line 40

def ()
  @logger.info  ? "Rets::Client: Cached metadata out of date" : "Rets::Client: Cached metadata unavailable"
end

#could_not_resolve_find_metadata(key) ⇒ Object



31
32
33
34
# File 'lib/rets/client_progress_reporter.rb', line 31

def (key)
  @stats.count("#{@stats_prefix}could_not_resolve_find_metadata")
  @logger.warn "Rets::Client: Can't resolve find metadata for #{key.inspect}"
end

#find_with_retries_exceeded_retry_count(exception) ⇒ Object



27
28
29
# File 'lib/rets/client_progress_reporter.rb', line 27

def find_with_retries_exceeded_retry_count(exception)
  @stats.count("#{@stats_prefix}find_with_retries_exceeded_retry_count")
end

#find_with_retries_failed_a_retry(exception, retries) ⇒ Object



21
22
23
24
25
# File 'lib/rets/client_progress_reporter.rb', line 21

def find_with_retries_failed_a_retry(exception, retries)
  @stats.count("#{@stats_prefix}find_with_retries_failed_retry")
  @logger.warn("Rets::Client: Failed with message: #{exception.message}")
  @logger.info("Rets::Client: Retry #{retries}/3")
end

#use_cached_metadataObject



36
37
38
# File 'lib/rets/client_progress_reporter.rb', line 36

def 
  @logger.info "Rets::Client: Use cached metadata"
end