Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTView: node type. #4323

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cardano-tracer/docs/cardano-rtview.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RTView is a part of `cardano-tracer` [service](https://github.com/input-output-h
5. [UI](#UI)
1. [Security Alert](#Security-Alert)
2. [Missing Metrics](#Missing-Metrics)
3. [Producer or Relay?](#Producer-or-Relay?)

# Introduction

Expand Down Expand Up @@ -180,3 +181,10 @@ When the node connects to `cardano-tracer` and RTView's page displays the first
2. The node _cannot_ provide corresponding metrics. For example, forging-related metrics make sense only for producer node, not for relay node.
3. The node doesn't provide corresponding metrics because of node's configuration. For example, it can specify severity filter for particular metric, so it just filtered out.
4. The node is incompatible with `cardano-tracer` (they were built from different branches of `cardano-node` repository). For example, particular metric may be renamed in the node, but `cardano-tracer` is still using outdated name.

## Producer or Relay?

If the node is configured as a _producer_ - i.e. it can forge the new blocks - you will see a hammer icon near the node's name. So, there are two possible reasons if you don't see this hammer icon:

1. The node is configured as a relay, not as a producer.
2. The node is not reported about its "producer status" yet.
12 changes: 12 additions & 0 deletions cardano-tracer/src/Cardano/Tracer/Handlers/RTView/UI/CSS/Own.hs
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,12 @@ span[data-tooltip] {
color: #f7967f;
}

.dark .rt-view-node-producer-label svg {
width: 22px;
margin-left: 10px;
color: lightgreen;
}

/********************* Light Theme *********************/

.light {
Expand Down Expand Up @@ -1125,6 +1131,12 @@ span[data-tooltip] {
.light .rt-view-test-status-message-fail {
color: #e6380d;
}

.light .rt-view-node-producer-label svg {
width: 22px;
margin-left: 10px;
color: green;
}
|]

chartTextLight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ addNodeColumn tracerEnv loggingConfig nodesErrors updateErrorsTimer nodeId@(Node
# set text "Node"
, image "has-tooltip-multiline has-tooltip-bottom rt-view-what-icon" whatSVG
# set dataTooltip "Node's name, taken from its configuration file"
, image "rt-view-node-producer-label has-tooltip-multiline has-tooltip-right" forgeSVG
## (id' <> "__node-producer-label")
# set dataTooltip "This node is a producer"
# hideIt
]
addNodeCell "basic-info" bi
addNodeCell "era" [ UI.span ## (id' <> "__node-era") #. "has-text-weight-semibold" # set text "—"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ updateNodesUI tracerEnv@TracerEnv{teConnectedNodes, teAcceptedMetrics, teSavedTO
setBlockReplayProgress connected teAcceptedMetrics
setChunkValidationProgress connected teSavedTO
setLedgerDBProgress connected teSavedTO
setProducerMode connected teAcceptedMetrics
setLeadershipStats connected displayedElements teAcceptedMetrics
setEraEpochInfo connected displayedElements teAcceptedMetrics nodesEraSettings

Expand Down Expand Up @@ -254,6 +255,26 @@ setLedgerDBProgress connected savedTO = do
_ -> return ()
_ -> return ()

setProducerMode
:: Set NodeId
-> AcceptedMetrics
-> UI ()
setProducerMode connected acceptedMetrics = do
allMetrics <- liftIO $ readTVarIO acceptedMetrics
forM_ connected $ \nodeId@(NodeId anId) ->
whenJust (M.lookup nodeId allMetrics) $ \(ekgStore, _) ->
forMM_ (liftIO $ getListOfMetrics ekgStore) $ \(mName, _) ->
case mName of
"Forge.NodeIsLeader" -> showProducerMode anId
"Forge.NodeIsLeaderNum" -> showProducerMode anId
_ -> return ()
where
-- The presence of these metrics is a proof that this node is
-- configured as a producer, so display corresponding icon.
showProducerMode anId = do
window <- askWindow
findAndSet showInline window (anId <> "__node-producer-label")

setLeadershipStats
:: Set NodeId
-> DisplayedElements
Expand Down