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

Termui updates #2212

Merged
merged 29 commits into from
Aug 28, 2020
Merged

Termui updates #2212

merged 29 commits into from
Aug 28, 2020

Conversation

miiu96
Copy link
Contributor

@miiu96 miiu96 commented Aug 7, 2020

Modified termui gui:

  • added a gouge with epoch info (shows how many rounds passed in current epoch and time remained from current epoch)
  • added a gouge with epoch traffic (show an estimation of how many bytes was send/received in current epoch)

2*secondsInAMinute + second: "2 minutes 1 second ",
2*secondsInAMinute + 10*second: "2 minutes 10 seconds ",
59*secondsInAMinute + 59*second: "59 minutes 59 seconds ",
secondsInAHour: "1 hour ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an hour*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@miiu96 miiu96 marked this pull request as ready for review August 11, 2020 07:18
@miiu96 miiu96 changed the title Termui updates [WIP] Termui updates Aug 11, 2020
@iulianpascalau iulianpascalau self-requested a review August 11, 2020 14:00
iulianpascalau
iulianpascalau previously approved these changes Aug 11, 2020
Copy link
Contributor

@iulianpascalau iulianpascalau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should think about how to change the cpu stats

)

// StartMachineStatisticsPolling will start read information about current running machini
func StartMachineStatisticsPolling(ash core.AppStatusHandler, pollingInterval time.Duration) error {
// StartMachineStatisticsPolling will start read information about current running machine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove a blank space between current and running

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@@ -119,3 +138,13 @@ func (ns *NetStatistics) PercentSent() uint64 {
func (ns *NetStatistics) PercentRecv() uint64 {
return atomic.LoadUint64(&ns.percentRecv)
}

// TotalBytesSendInCurrentEpoch returns total bytes send in current epoch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// TotalBytesSendInCurrentEpoch returns the number of bytes sent in the current epoch *
also rename func name to Sent instead of Send

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@@ -53,3 +53,13 @@ func (psh *PresenterStatusHandler) GetNetworkSentBps() uint64 {
func (psh *PresenterStatusHandler) GetNetworkSentBpsPeak() uint64 {
return psh.getFromCacheAsUint64(core.MetricNetworkSentBpsPeak)
}

// GetNetworkSendBytesInEpoch will return total bytes send in current epoch
func (psh *PresenterStatusHandler) GetNetworkSendBytesInEpoch() uint64 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sent*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

wr.epochLoad.Percent = epochLoadPercent
wr.epochLoad.Label = fmt.Sprintf("%d / %d rounds (~%sremaining)", currentEpochRound, currentEpochFinishRound, remainingTime)

totalBytesSendInEpoch := wr.presenter.GetNetworkSendBytesInEpoch()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sent*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.


wr.networkBytesInEpoch.Title = "Epoch - traffic:"
wr.networkBytesInEpoch.Percent = 0
wr.networkBytesInEpoch.Label = fmt.Sprintf("send: %s / received: %s", core.ConvertBytes(totalBytesSendInEpoch), core.ConvertBytes(totalBytesReceivedInEpoch))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sent*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

bogdan-rosianu
bogdan-rosianu previously approved these changes Aug 12, 2020
Copy link
Contributor

@iulianpascalau iulianpascalau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As suggested by @LucianMincu we might make it obvious that the network stats are per host, not per process.

@LucianMincu
Copy link
Contributor

I suggest to provide a screenshot of the changes implemented among a short documentation about each metric that should be proposed to the validator community for peer review. 🙏

@miiu96
Copy link
Contributor Author

miiu96 commented Aug 24, 2020

image

Also was added new 2 metrics in API route /node/status:

  • erd_network_recv_bytes_in_epoch - provides an estimation of total bytes that was received in current epoch
  • erd_network_sent_bytes_in_epoch - provides an estimation of total bytes that was sent in current epoch

@iulianpascalau
Copy link
Contributor

image

Also was added new 2 metrics in API route /node/status:

  • erd_network_recv_bytes_in_epoch - provides an estimation of total bytes that was received in current epoch
  • erd_network_sent_bytes_in_epoch - provides an estimation of total bytes that was sent in current epoch

maybe change Epoch - traffic: to Epoch - traffic per host: and Network - sent per host: and Network - receive per host: also, might rename the constants retrieved in the API routes?

@miiu96
Copy link
Contributor Author

miiu96 commented Aug 25, 2020

image

Constants name was changed:

erd_network_recv_bytes_in_epoch_per_host
erd_network_sent_bytes_in_epoch_per_host

iulianpascalau
iulianpascalau previously approved these changes Aug 25, 2020
@mihaib79
Copy link
Collaborator

I keep getting: termui websocket terminated: close 1006 (abnormal closure): unexpected EOF
Screenshot from 2020-08-25 10-35-33

Also the network traffic percents are overlapping the windows' borders. It gets even worse when shrinking the terminal window.

@mihaib79
Copy link
Collaborator

sent per host
receive per host

should be sent/received or send/receive ... use the same verb tense, please

@mihaib79
Copy link
Collaborator

traffic per host shows 0 / 0

@miiu96
Copy link
Contributor Author

miiu96 commented Aug 27, 2020

Done.

@miiu96 miiu96 self-assigned this Aug 27, 2020
Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@LucianMincu LucianMincu merged commit 27d4298 into development Aug 28, 2020
@LucianMincu LucianMincu deleted the EN-7225-termui-updates branch August 28, 2020 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants