-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sut): add write size and metrics memory usage to metrics output
- Loading branch information
1 parent
d6cc664
commit 6d7fa72
Showing
8 changed files
with
65 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Dumblog.Common.Utils where | ||
|
||
import Data.Word (Word64) | ||
import Text.Printf (printf) | ||
|
||
------------------------------------------------------------------------ | ||
|
||
-- Stolen from `tasty-bench`. | ||
showBytes :: Word64 -> String | ||
showBytes i | ||
| t < 1000 = printf "%3.0f B " t | ||
| t < 10189 = printf "%3.1f KB" (t / 1024) | ||
| t < 1023488 = printf "%3.0f KB" (t / 1024) | ||
| t < 10433332 = printf "%3.1f MB" (t / 1048576) | ||
| t < 1048051712 = printf "%3.0f MB" (t / 1048576) | ||
| t < 10683731149 = printf "%3.1f GB" (t / 1073741824) | ||
| t < 1073204953088 = printf "%3.0f GB" (t / 1073741824) | ||
| t < 10940140696372 = printf "%3.1f TB" (t / 1099511627776) | ||
| t < 1098961871962112 = printf "%3.0f TB" (t / 1099511627776) | ||
| t < 11202704073084108 = printf "%3.1f PB" (t / 1125899906842624) | ||
| t < 1125336956889202624 = printf "%3.0f PB" (t / 1125899906842624) | ||
| t < 11471568970838126592 = printf "%3.1f EB" (t / 1152921504606846976) | ||
| otherwise = printf "%3.0f EB" (t / 1152921504606846976) | ||
where | ||
t = word64ToDouble i | ||
|
||
word64ToDouble :: Word64 -> Double | ||
word64ToDouble = fromIntegral |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters