Skip to content

Commit

Permalink
[wip] Add test to check compression ratio hence correct interpretatio…
Browse files Browse the repository at this point in the history
…n of logs
  • Loading branch information
abailly-iohk committed Sep 24, 2021
1 parent 5124018 commit a4f7eae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions local-cluster/test/Test/LogFilterSpec.hs
Expand Up @@ -30,3 +30,10 @@ spec = parallel $ do
it "replaces transactions by their ids in ReqSn" $ do
(decode entry >>= filterLog >>= (^? key "message" . key "event" . key "message" . key "transactions"))
`shouldBe` Just (Array [String "6cba5394ec8a1a1161758a33089661383143283d0121e4a293ed51a0272cfbc4"])

prop "significantly reduces standard log messages size" $ \ logs ->
let bytes = map encode logs
filtered = map (encode .filterLog) bytes
in length filtered < length bytes
& cover 0.9 (filtered * 100 / bytes < 10) "reduces size by 90%"
& checkCoverage

0 comments on commit a4f7eae

Please sign in to comment.