# HG changeset patch # User Yasutaka Higa # Date 1390374493 -32400 # Node ID 8d4e37c1a86aebdbb7335d0675d5b69bf37c055e # Parent 7360fbfc7e6260685405df22b0dba8b5a6d40b0b Print attrSize in ParWrite diff -r 7360fbfc7e62 -r 8d4e37c1a86a test/ParWrite.hs --- 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)