Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
9acda28c
Commit
9acda28c
authored
6 years ago
by
asynchronous rob
Committed by
Gav Wood
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
informant: display finalized height and hash (#1387)
parent
0c8755a2
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/core/cli/src/informant.rs
+12
-7
12 additions, 7 deletions
substrate/core/cli/src/informant.rs
with
12 additions
and
7 deletions
substrate/core/cli/src/informant.rs
+
12
−
7
View file @
9acda28c
...
...
@@ -48,10 +48,10 @@ pub fn start<C>(service: &Service<C>, exit: ::exit_future::Exit, handle: TaskExe
let
display_notifications
=
interval
.map_err
(|
e
|
debug!
(
"Timer error: {:?}"
,
e
))
.for_each
(
move
|
_
|
{
let
sync_status
=
network
.status
();
if
let
Ok
(
best_block
)
=
client
.best_block_header
()
{
let
hash
=
best_block
.hash
();
if
let
Ok
(
info
)
=
client
.info
()
{
let
best_number
:
u64
=
info
.chain.best_number
.as_
();
let
best_hash
=
info
.chain.best_hash
;
let
num_peers
=
sync_status
.num_peers
;
let
best_number
:
u64
=
best_block
.number
()
.as_
();
let
speed
=
move
||
speed
(
best_number
,
last_number
);
let
(
status
,
target
)
=
match
(
sync_status
.sync.state
,
sync_status
.sync.best_seen_block
)
{
(
SyncState
::
Idle
,
_
)
=>
(
"Idle"
.into
(),
""
.into
()),
...
...
@@ -60,14 +60,17 @@ pub fn start<C>(service: &Service<C>, exit: ::exit_future::Exit, handle: TaskExe
};
last_number
=
Some
(
best_number
);
let
txpool_status
=
txpool
.status
();
let
finalized_number
:
u64
=
info
.chain.finalized_number
.as_
();
info!
(
target
:
"substrate"
,
"{}{} ({} peers), best: #{} ({})"
,
"{}{} ({} peers), best: #{}
({}), finalized #{}
({})"
,
Colour
::
White
.bold
()
.paint
(
&
status
),
target
,
Colour
::
White
.bold
()
.paint
(
format!
(
"{}"
,
sync_status
.num_peers
)),
Colour
::
White
.paint
(
format!
(
"{}"
,
best_number
)),
hash
best_hash
,
Colour
::
White
.paint
(
format!
(
"{}"
,
finalized_number
)),
info
.chain.finalized_hash
,
);
// get cpu usage and memory usage of this process
...
...
@@ -81,10 +84,12 @@ pub fn start<C>(service: &Service<C>, exit: ::exit_future::Exit, handle: TaskExe
"status"
=>
format!
(
"{}{}"
,
status
,
target
),
"peers"
=>
num_peers
,
"height"
=>
best_number
,
"best"
=>
?
hash
,
"best"
=>
?
best_
hash
,
"txcount"
=>
txpool_status
.ready
,
"cpu"
=>
cpu_usage
,
"memory"
=>
memory
"memory"
=>
memory
,
"finalized_height"
=>
finalized_number
,
"finalized_hash"
=>
?
info
.chain.finalized_hash
,
);
}
else
{
warn!
(
"Error getting best block information"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment