-
Notifications
You must be signed in to change notification settings - Fork 247
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
Start adding farmer metrics. #2358
Conversation
if let Some(audit_event_handler) = audit_event_handler { | ||
let duration = Instant::now().duration_since(start); | ||
let duration_secs = duration.as_secs_f64(); | ||
|
||
audit_event_handler.call_simple(&AuditEvent { | ||
duration: duration_secs, | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is happening at the end of the audit_plot_sync
call, you might as well surface it to subspace-farmer
and not change subspace-farmer-components
at all. Ideally we wouldn't need to change anything in this crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed change will also include additional time for PoT generation. Please, confirm that you want to measure the audit()
call timing instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PoT generation is Timekeeper's responsibility, can you clarify what you mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant this line: https://github.com/subspace/subspace/blob/f76fb316a42728ff15dc39b00d6475fb910220f7/crates/subspace-farmer/src/single_disk_farm/farming.rs#L170
Should I measure the whole audit()
method or just audit_plot_sync()
invocation within it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is PoSpace table. And no, I don't think that is necessary to measure it, that is too detailed just audit_plot_sync
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW that callback with table generator is only called when proving is done. I guess it might have been confusing to see it in this file, but it is not actually running just yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the kind of thing I expected.
Suggested a few improvements to make it a bit better.
# Conflicts: # crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert changes in subspace-farmer-components
crate (Cargo.toml
and auditing.rs
), they are not necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll squash merge once CI passed
This PR adds the audit event and farmer metrics of that event. Relates to autonomys/space-acres#34
This is PoC and will be later extended to other events starting from proving events.
Code contributor checklist: