Skip to content

Commit

Permalink
feat(sut): make journal variant work with 400 clients by making the j…
Browse files Browse the repository at this point in the history
…ournal larger
  • Loading branch information
symbiont-stevan-andjelkovic committed Mar 14, 2022
1 parent d258e15 commit 3ade558
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/journal/src/Journal/Internal/ByteBufferPtr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ newByteBuffer fptr capa lim pos mSli
<*> maybe (newIORef 0) return mSli

-- This is a hack, don't use.
unsafefromBS :: BS.ByteString -> IO ByteBuffer
unsafeFromBS :: BS.ByteString -> IO ByteBuffer
unsafeFromBS bs
= ByteBuffer fptr (Capacity len)
<$> newIORef (Limit len)
Expand Down
24 changes: 18 additions & 6 deletions src/sut/dumblog/src/Dumblog/Journal/Main.hs
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}

module Dumblog.Journal.Main where

import Control.Concurrent.Async (withAsync, link)
import Control.Concurrent.Async (link, withAsync)
import Control.Concurrent.MVar (MVar)
import qualified Data.Aeson as Aeson
import qualified Data.Text as Text
import qualified Data.Text.Lazy as LText
import Data.Text.Encoding (decodeUtf8)
import qualified Data.Text.Lazy as LText
import qualified Data.Text.Lazy.Encoding as LEncoding
import Data.Vector (Vector)
import qualified Data.Vector as Vector
import Debugger.State (InstanceStateRepr(..), DebEvent(..))
import Journal (defaultOptions, allocateJournal, startJournal)
import Journal.Types (Journal, Options, Subscriber(..), oLogger, oMaxSubscriber, readBytesConsumed, writeBytesConsumed, jMetadata)
import qualified Journal.MP as Journal
import Debugger.State (DebEvent(..), InstanceStateRepr(..))
import Journal (allocateJournal, defaultOptions, startJournal)
import Journal.Internal.Logger as Logger
import qualified Journal.Internal.Metrics as Metrics
import qualified Journal.MP as Journal
import Journal.Types
( Journal
, Options
, Subscriber(..)
, jMetadata
, oLogger
, oMaxSubscriber
, oTermBufferLength
, readBytesConsumed
, writeBytesConsumed
)
import Ltl.Json (mergePatch)
import Options.Generic

Expand Down Expand Up @@ -128,6 +139,7 @@ dumblogOptions :: Options
dumblogOptions = defaultOptions
{ oLogger = Logger.nullLogger
, oMaxSubscriber = Sub2
, oTermBufferLength = 512 * 1024 * 1024
}

dUMBLOG_JOURNAL :: FilePath
Expand Down

0 comments on commit 3ade558

Please sign in to comment.