mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-08-01 06:55:41 +00:00
Add step information to the benchmark report
This commit is contained in:
@@ -107,6 +107,10 @@ impl ReportAggregator {
|
||||
self.handle_completion(*event);
|
||||
break;
|
||||
}
|
||||
/* Benchmarks Events */
|
||||
RunnerEvent::StepTransactionInformation(event) => {
|
||||
self.handle_step_transaction_information(*event)
|
||||
}
|
||||
}
|
||||
}
|
||||
debug!("Report aggregation completed");
|
||||
@@ -385,6 +389,17 @@ impl ReportAggregator {
|
||||
self.runner_rx.close();
|
||||
}
|
||||
|
||||
fn handle_step_transaction_information(&mut self, event: StepTransactionInformationEvent) {
|
||||
self.test_case_report(&event.execution_specifier.test_specifier)
|
||||
.steps
|
||||
.entry(event.step_path)
|
||||
.or_default()
|
||||
.transactions
|
||||
.entry(event.execution_specifier.platform_identifier)
|
||||
.or_default()
|
||||
.push(event.transaction_information);
|
||||
}
|
||||
|
||||
fn test_case_report(&mut self, specifier: &TestSpecifier) -> &mut ExecutionReport {
|
||||
self.report
|
||||
.execution_information
|
||||
@@ -466,6 +481,7 @@ pub struct ExecutionReport {
|
||||
pub metrics: Option<Metrics>,
|
||||
/// Information related to the execution on one of the platforms.
|
||||
pub platform_execution: PlatformKeyedInformation<Option<ExecutionInformation>>,
|
||||
/// Information tracked for each step that was executed.
|
||||
pub steps: BTreeMap<StepPath, StepReport>,
|
||||
}
|
||||
|
||||
@@ -566,7 +582,7 @@ pub enum CompilationStatus {
|
||||
}
|
||||
|
||||
/// Information on each step in the execution.
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
pub struct StepReport {
|
||||
/// Information on the transactions submitted as part of this step.
|
||||
transactions: PlatformKeyedInformation<Vec<TransactionInformation>>,
|
||||
@@ -579,7 +595,6 @@ pub struct TransactionInformation {
|
||||
pub submission_timestamp: u64,
|
||||
pub block_timestamp: u64,
|
||||
pub block_number: BlockNumber,
|
||||
pub gas_used: u64,
|
||||
}
|
||||
|
||||
/// The metrics we collect for our benchmarks.
|
||||
|
||||
@@ -10,9 +10,11 @@ use revive_dt_common::types::PlatformIdentifier;
|
||||
use revive_dt_compiler::{CompilerInput, CompilerOutput};
|
||||
use revive_dt_format::metadata::ContractInstance;
|
||||
use revive_dt_format::metadata::Metadata;
|
||||
use revive_dt_format::steps::StepPath;
|
||||
use semver::Version;
|
||||
use tokio::sync::{broadcast, oneshot};
|
||||
|
||||
use crate::TransactionInformation;
|
||||
use crate::{ExecutionSpecifier, ReporterEvent, TestSpecifier, common::MetadataFilePath};
|
||||
|
||||
macro_rules! __report_gen_emit_test_specific {
|
||||
@@ -609,7 +611,19 @@ define_event! {
|
||||
address: Address
|
||||
},
|
||||
/// Reports the completion of the run.
|
||||
Completion {}
|
||||
Completion {},
|
||||
|
||||
/* Benchmarks Events */
|
||||
/// An event emitted with information on a transaction that was submitted for a certain step
|
||||
/// of the execution.
|
||||
StepTransactionInformation {
|
||||
/// A specifier for the execution that's taking place.
|
||||
execution_specifier: Arc<ExecutionSpecifier>,
|
||||
/// The path of the step that this transaction belongs to.
|
||||
step_path: StepPath,
|
||||
/// Information about the transaction
|
||||
transaction_information: TransactionInformation
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user