Skip to content

Commit

Permalink
feat(journal): reintroduce more of the happy path in the tj test
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Jan 13, 2022
1 parent 6298d8b commit 9933095
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/journal/src/Journal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ tj = do
opts = defaultOptions
allocateJournal fp opts
jour <- startJournal' fp opts
-- Just (five, claimBuf) <- tryClaim jour 5
-- print five
-- putBS claimBuf (BSChar8.pack "hello")
-- commit claimBuf
Just (sz, claimBuf) <- tryClaim jour 5
putStrLn ("sz: " ++ show sz)
putBS claimBuf (BSChar8.pack "hello")
commit claimBuf
dumpMetadata (jMetadata jour)
return ()
3 changes: 1 addition & 2 deletions src/journal/src/Journal/Internal/Metrics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ data MetricsSchema c h = MetricsSchema
-- TODO have a header in the file and check that schema is the same as existing in file?
newMetrics :: forall c h. (Enum c, Bounded c, Enum h, Bounded h) => MetricsSchema c h -> FilePath -> IO (Metrics c h)
newMetrics _ fp = do
bb <- mmapped fp (sizeOfCounters + sizeOfHistograms) -- mmap seems problematic
-- bb <- allocate (sizeOfCounters + sizeOfHistograms)
bb <- mmapped fp (sizeOfCounters + sizeOfHistograms)
cbuf <- wrapPart bb 0 sizeOfCounters
hbuf <- wrapPart bb sizeOfCounters sizeOfHistograms
return (Metrics cbuf hbuf)
Expand Down

0 comments on commit 9933095

Please sign in to comment.