Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make job status less chatty #326

Merged
merged 3 commits into from Sep 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions bot/job_status_generation.rb
Expand Up @@ -2,7 +2,7 @@ module JobStatusGeneration
def to_status
rep = []

rep << "Job #{ident} <#{url}>:"
rep << "Job #{ident} <#{url}>."

if started_by
if note
Expand All @@ -19,22 +19,21 @@ def to_status
elsif pending?
rep << "In queue."
elsif in_progress?
rep << "In progress. Downloaded #{mb_downloaded.round(2)} MB, #{error_count.to_i} errors encountered, #{item_count} items queued."
rep << "#{concurrency.to_i} workers, delay: [#{delay_min.to_f}, #{delay_max.to_f}] ms."
rep << "See the ArchiveBot dashboard for more information."
rep << "In progress. Downloaded #{mb_downloaded.round(2)} MiB, #{error_count.to_i} errors, #{item_count} queued."
rep << "#{concurrency.to_i} workers, delay: #{delay_min.to_f}, #{delay_max.to_f} ms."
end

if (t = ttl) && (t != -1)
rep << "Eligible for rearchival in #{formatted_ttl(t)}."
end

rep
[rep.join(" ")]
end

private

def mb_downloaded
bytes_downloaded.to_f / (1000 * 1000)
bytes_downloaded.to_f / (1024 * 1024)
end

def item_count
Expand Down