diff options
author | Christopher Baines <mail@cbaines.net> | 2021-11-22 22:48:27 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-11-22 22:48:27 +0000 |
commit | c1289fc75e99be0e783a4a5a6bee63bdc5df1dde (patch) | |
tree | dc2746cb8cd1773da3a67b5efb6dd717e030e570 | |
parent | 8690d84931d7f24362148285e3a9101b1569f21d (diff) | |
download | build-coordinator-c1289fc75e99be0e783a4a5a6bee63bdc5df1dde.tar build-coordinator-c1289fc75e99be0e783a4a5a6bee63bdc5df1dde.tar.gz |
Improve some way numbers are displayed
-rw-r--r-- | guix-build-coordinator/agent-messaging/http/server.scm | 31 | ||||
-rw-r--r-- | guix-build-coordinator/agent.scm | 11 |
2 files changed, 19 insertions, 23 deletions
diff --git a/guix-build-coordinator/agent-messaging/http/server.scm b/guix-build-coordinator/agent-messaging/http/server.scm index 3e9f6ee..f7cdbb5 100644 --- a/guix-build-coordinator/agent-messaging/http/server.scm +++ b/guix-build-coordinator/agent-messaging/http/server.scm @@ -463,12 +463,10 @@ port. Also, the port used can be changed by passing the --port option.\n" " (basename output-file-name) seconds-elapsed - (rationalize (exact->inexact (/ bytes-read 1000000)) - 0.1) + (format #f "~2,2f" (/ bytes-read 1000000)) bytes-read - (rationalize (/ (/ bytes-read 1000000) - seconds-elapsed) - 0.1)))) + (format #f "~2,2f" (/ (/ bytes-read 1000000) + seconds-elapsed))))) (begin (put-bytevector output-port bv) (loop (get-bytevector-some body) @@ -485,10 +483,9 @@ port. Also, the port used can be changed by passing the --port option.\n" ~AMB read so far... " (basename output-file-name) - (rationalize (exact->inexact - (/ bytes-read - 1000000)) - 0.1))) + (format #f "~2,2f" + (/ bytes-read + 1000000)))) bytes-read) last-progress-update-bytes-read)))))))) @@ -601,12 +598,11 @@ port. Also, the port used can be changed by passing the --port option.\n" " (basename output-file-name) seconds-elapsed - (rationalize (exact->inexact (/ bytes-read 1000000)) - 0.1) + (format #f "~2,2f" + (/ bytes-read 1000000)) bytes-read - (rationalize (/ (/ bytes-read 1000000) - seconds-elapsed) - 0.1)))) + (format #f "~2,2f" (/ (/ bytes-read 1000000) + seconds-elapsed))))) (begin (put-bytevector output-port bv) (loop (get-bytevector-some body) @@ -623,10 +619,9 @@ port. Also, the port used can be changed by passing the --port option.\n" ~AMB read so far... " (basename output-file-name) - (rationalize (exact->inexact - (/ bytes-read - 1000000)) - 0.1))) + (format #f "~2,2f" + (/ bytes-read + 1000000)))) bytes-read) last-progress-update-bytes-read)))))) (close-port output-port)) diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm index 366666e..f978988 100644 --- a/guix-build-coordinator/agent.scm +++ b/guix-build-coordinator/agent.scm @@ -160,11 +160,12 @@ (log-msg lgr 'INFO (upload-progress-file upload-progress) ": " - (rationalize (exact->inexact - (/ (upload-progress-bytes-sent - upload-progress) - 1000000)) - 0.1) + (format + #f + "~2,2f" + (/ (upload-progress-bytes-sent + upload-progress) + 1000000)) "MB sent"))) upload-slots))))) |