mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-24 06:07:46 +00:00
Added days uptime to the status message
Also broke down the time calculations for legibility
This commit is contained in:
parent
4629ead8c5
commit
084aef700b
1 changed files with 6 additions and 4 deletions
|
@ -368,7 +368,7 @@ bool t_rpc_command_executor::show_status() {
|
||||||
|
|
||||||
std::time_t uptime = std::time(nullptr) - ires.start_time;
|
std::time_t uptime = std::time(nullptr) - ires.start_time;
|
||||||
|
|
||||||
tools::success_msg_writer() << boost::format("Height: %llu/%llu (%.1f%%) on %s, %s, net hash %s, v%u%s, %s, %u+%u connections, uptime %uh %um %us")
|
tools::success_msg_writer() << boost::format("Height: %llu/%llu (%.1f%%) on %s, %s, net hash %s, v%u%s, %s, %u+%u connections, uptime %ud %uh %um %us")
|
||||||
% (unsigned long long)ires.height
|
% (unsigned long long)ires.height
|
||||||
% (unsigned long long)(ires.target_height >= ires.height ? ires.target_height : ires.height)
|
% (unsigned long long)(ires.target_height >= ires.height ? ires.target_height : ires.height)
|
||||||
% get_sync_percentage(ires)
|
% get_sync_percentage(ires)
|
||||||
|
@ -378,9 +378,11 @@ bool t_rpc_command_executor::show_status() {
|
||||||
% (unsigned)hfres.version
|
% (unsigned)hfres.version
|
||||||
% get_fork_extra_info(hfres.earliest_height, ires.height, ires.target)
|
% get_fork_extra_info(hfres.earliest_height, ires.height, ires.target)
|
||||||
% (hfres.state == cryptonote::HardFork::Ready ? "up to date" : hfres.state == cryptonote::HardFork::UpdateNeeded ? "update needed" : "out of date, likely forked")
|
% (hfres.state == cryptonote::HardFork::Ready ? "up to date" : hfres.state == cryptonote::HardFork::UpdateNeeded ? "update needed" : "out of date, likely forked")
|
||||||
% (unsigned)ires.outgoing_connections_count % (unsigned)ires.incoming_connections_count
|
% (unsigned)ires.outgoing_connections_count
|
||||||
% (unsigned int)floor(uptime / 3600.0)
|
% (unsigned)ires.incoming_connections_count
|
||||||
% (unsigned int)floor(fmod(uptime, 3600.0) / 60.0)
|
% (unsigned int)floor(uptime / 60.0 / 60.0 / 24.0)
|
||||||
|
% (unsigned int)floor(fmod((uptime / 60.0 / 60.0), 24.0)
|
||||||
|
% (unsigned int)floor(fmod((uptime / 60.0), 60.0)
|
||||||
% (unsigned int)fmod(uptime, 60.0)
|
% (unsigned int)fmod(uptime, 60.0)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue