Skip to content

Commit

Permalink
cardano-tracer: incorporate code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Icelandjack committed Jul 19, 2024
1 parent dade1e6 commit 238d56a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ runMonitoringServer tracerEnv (endpoint@(Endpoint listHost listPort), monitorEP)
, ttMonitoringType = "list"
}
simpleHttpServe config do
route
route
[ ("/", renderEkg)
]
where
Expand All @@ -117,7 +117,6 @@ runMonitoringServer tracerEnv (endpoint@(Endpoint listHost listPort), monitorEP)
renderEkg :: Snap ()
renderEkg = do
nodes <- liftIO $ S.toList <$> readTVarIO teConnectedNodes

-- HACK
case nodes of
[] ->
Expand All @@ -129,6 +128,10 @@ runMonitoringServer tracerEnv (endpoint@(Endpoint listHost listPort), monitorEP)
ekgHtml monitorEP nodes

{-# NOINLINE currentServerHack #-}
-- | There is supposed to be one EKG server per port. The desired EKG
-- server for the connected node gets restarted always on the same
-- port. We limit functionality to only run one EKG server, this will
-- be resolved in a future PR.
currentServerHack :: CurrentEKGServer
currentServerHack = unsafePerformIO newEmptyTMVarIO

Expand All @@ -140,7 +143,6 @@ ekgHtml (Endpoint monitorHost monitorPort) = \case
[] ->
toHtml @T.Text "ekgHtml: There are no connected nodes yet"
connectedNodes -> do
li do toHtml @T.Text "OKAY"
for_ connectedNodes \(NodeId anId) ->
li do
a ! href (fromString ("http://" <> monitorHost <> ":" <> show monitorPort))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import qualified Data.Text as T

-- import Crypto.Cipher.AES ()
-- import Crypto.Cipher.Types ()
-- import Crypto.Error ()

readSavedEmailSettings :: Maybe FilePath -> IO EmailSettings
readSavedEmailSettings rtvSD = do
(pathToEmailSettings, _) <- getPathsToNotificationsSettings rtvSD
Expand Down
3 changes: 0 additions & 3 deletions cardano-tracer/src/Cardano/Tracer/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ showProblemIfAny verb action =
logTrace :: String -> IO ()
logTrace = traceWith stdoutTracer

-- logTrace :: String -> IO ()
-- logTrace = traceWith $ showTracing stdoutTracer

connIdToNodeId :: Show addr => ConnectionId addr -> NodeId
connIdToNodeId ConnectionId{remoteAddress} = NodeId preparedAddress
where
Expand Down

0 comments on commit 238d56a

Please sign in to comment.