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

Add an EventLog for collecting metrics on hbbft performance #335

Open
alyjak opened this issue Nov 12, 2018 · 0 comments
Open

Add an EventLog for collecting metrics on hbbft performance #335

alyjak opened this issue Nov 12, 2018 · 0 comments

Comments

@alyjak
Copy link
Contributor

alyjak commented Nov 12, 2018

In order to propagate performance information into an hbbft caller, add an event_log to Steps definition. Events will implement failure::Fault, simply because it is a convenient interface for defining event types as well as annotating them formatted Display messages.

By including event_log in Step, logs will be naturally extended across calls and provided to the initial caller.

EventLog has a similar signature to FaultLog

pub struct `EventLog(pub Vec<Event>);

Events are similar to the Fault struct, but instead of node_id, they record a timestamp:

pub struct Event<L: Fail> {
    logtime: std::time::Instant,
    content: L
};

This way, the caller can record duration between two events using std::time::Instant::duration_since. Instants are monotonically increasing. They can be mapped to system time by logging a message who's contents is current OS system time. This way both clocks can be synchronized.

Besides measuring performance, event logs can be used by hbbft calling applications to detect soft failures, like a validator going off line, by collecting and monitoring logs over time.

If EventLog is added, a nice use case would be to add event logs to DistAlgorithm calls. So, the first time foo.handle_message is called it issues a log event, and when foo.handle_output produces an output a log event is also issued. Comparing this data between runs can be used to benchmark performance.

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

No branches or pull requests

1 participant