Mercurial > hg > Members > toma > Jungle-haskell
changeset 18:8d4e37c1a86a
Print attrSize in ParWrite
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 22 Jan 2014 16:08:13 +0900 |
parents | 7360fbfc7e62 |
children | 824543aea6fc |
files | test/ParWrite.hs |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/test/ParWrite.hs Wed Jan 22 15:32:11 2014 +0900 +++ b/test/ParWrite.hs Wed Jan 22 16:08:13 2014 +0900 @@ -10,6 +10,7 @@ import qualified Data.ByteString.Lazy.Char8 as B import Control.Exception import System.Environment +import Control.Monad.IO.Class treeId :: String treeId = "test_tree" @@ -31,7 +32,7 @@ jungle <- createTree jungle treeId2 node <- getRootNode jungle treeId - node2 <- getRootNode jungle treeId + node2 <- getRootNode jungle treeId2 let miniTree = testTree node treeDepth miniTree2 = testTree node2 treeDepth @@ -45,7 +46,8 @@ t0 <- getCurrentTime printTimeSince t0 - sequence_ $ runEval $ dualWrite jungle + a <- sequence$ runEval $ dualWrite jungle + print a printTimeSince t0 @@ -58,11 +60,11 @@ test jungle id = do updateRootNodeWith (writeFunctions writeCount) jungle id tree <- getRootNode jungle id - print $ fromJust (getAttributes tree lastPos (show (writeCount-1))) + return (attrSize tree) -- generate functions to node update writeFunctions :: Int -> Node -> Node -writeFunctions writeCount node = foldl' apply node [0..writeCount] +writeFunctions writeCount node = foldl' apply node [0..writeCount] where apply node x = putAttribute node lastPos (show x) (B.pack . show $ x)