lib/eco/api/microcases/people_cache.rb in eco-helpers-2.0.16 vs lib/eco/api/microcases/people_cache.rb in eco-helpers-2.0.17
- old
+ new
@@ -7,12 +7,12 @@
def people_cache(filename = enviro.config.people.cache)
logger.info("Going to get all the people via API")
start = Time.now
people = session.batch.get_people
- secs = Time.now - start
+ secs = (Time.now - start).round(3)
cnt = people.count
- per_sec = (cnt.to_f / secs).floor
+ per_sec = (cnt.to_f / secs).round(2)
logger.info("Loaded #{cnt} people in #{secs} seconds (#{per_sec} people/sec)")
file = file_manager.save_json(people, filename, :timestamp)
logger.info("#{people.length} people loaded and saved locally to #{file}.")
Eco::API::Organization::People.new(people)