Skip to content

Commit

Permalink
Remove perf-test sys-info feature (#1192)
Browse files Browse the repository at this point in the history
* Terminate sys-info with extreme prejudice

* cargo fmt

* Update Cargo.lock
  • Loading branch information
notlesh authored Feb 24, 2022
1 parent f67d018 commit 026859c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 380 deletions.
154 changes: 3 additions & 151 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,25 +449,19 @@ pub fn run() -> Result<()> {
#[cfg(feature = "moonbeam-native")]
spec if spec.is_moonbeam() => runner.sync_run(|config| {
cmd.run::<service::moonbeam_runtime::RuntimeApi, service::MoonbeamExecutor>(
&working_dir,
&cmd,
config,
&cmd, config,
)
}),
#[cfg(feature = "moonriver-native")]
spec if spec.is_moonriver() => runner.sync_run(|config| {
cmd.run::<service::moonriver_runtime::RuntimeApi, service::MoonriverExecutor>(
&working_dir,
&cmd,
config,
&cmd, config,
)
}),
#[cfg(feature = "moonbase-native")]
spec if spec.is_moonbase() => runner.sync_run(|config| {
cmd.run::<service::moonbase_runtime::RuntimeApi, service::MoonbaseExecutor>(
&working_dir,
&cmd,
config,
&cmd, config,
)
}),
_ => {
Expand Down
7 changes: 0 additions & 7 deletions node/perf-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ serde_json = "1.0"
sha3 = { version = "0.8" }
structopt = "0.3.8"

heim = { git = "https://github.com/heim-rs/heim", rev = "1fb090576629cd2788dff993cc6ef77547f3df18" }
heim-common = { git = "https://github.com/heim-rs/heim", rev = "1fb090576629cd2788dff993cc6ef77547f3df18" }
heim-cpu = { git = "https://github.com/heim-rs/heim", rev = "1fb090576629cd2788dff993cc6ef77547f3df18" }
# TODO: heim-host generates a conflict for crate 'platforms'
# heim-host = { git = "https://github.com/heim-rs/heim", rev = "1fb090576629cd2788dff993cc6ef77547f3df18" }
heim-memory = { git = "https://github.com/heim-rs/heim", rev = "1fb090576629cd2788dff993cc6ef77547f3df18" }

# Moonbeam

cli-opt = { package = "moonbeam-cli-opt", path = "../cli-opt", default-features = false }
Expand Down
26 changes: 2 additions & 24 deletions node/perf-test/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.

use crate::{
sysinfo::{query_partition_info, query_system_info, PartitionInfo, SystemInfo},
tests::{BlockCreationPerfTest, FibonacciPerfTest, StoragePerfTest, TestResults, TestRunner},
txn_signer::UnsignedTransaction,
PerfCmd,
Expand All @@ -35,7 +34,7 @@ use sc_service::{Configuration, TFullBackend, TFullClient, TaskManager, Transact
use sp_api::{BlockId, ConstructRuntimeApi, ProvideRuntimeApi};
use sp_core::{H160, H256, U256};
use sp_runtime::transaction_validity::TransactionSource;
use std::{fs::File, io::prelude::*, marker::PhantomData, path::PathBuf, sync::Arc};
use std::{fs::File, io::prelude::*, marker::PhantomData, sync::Arc};

use futures::{
channel::{mpsc, oneshot},
Expand Down Expand Up @@ -451,12 +450,7 @@ impl CliConfiguration for PerfCmd {

impl PerfCmd {
// taking a different approach and starting a full dev service
pub fn run<RuntimeApi, Executor>(
&self,
path: &PathBuf,
cmd: &PerfCmd,
config: Configuration,
) -> CliResult<()>
pub fn run<RuntimeApi, Executor>(&self, cmd: &PerfCmd, config: Configuration) -> CliResult<()>
where
RuntimeApi:
ConstructRuntimeApi<Block, FullClient<RuntimeApi, Executor>> + Send + Sync + 'static,
Expand Down Expand Up @@ -496,29 +490,13 @@ impl PerfCmd {
all_test_results.append(&mut results);
}

let (system_info, partition_info) = if cmd.disable_sysinfo {
(None, None)
} else {
let sys = query_system_info()?;
let part = query_partition_info(path).unwrap_or_else(|_| {
// TODO: this is inconsistent with behavior of query_system_info...
eprintln!("query_partition_info() failed, ignoring...");
Default::default()
});
(Some(sys), Some(part))
};

#[derive(Serialize)]
struct AllResults {
test_results: Vec<TestResults>,
system_info: Option<SystemInfo>,
partition_info: Option<PartitionInfo>,
}

let all_results = AllResults {
test_results: all_test_results.clone(),
system_info,
partition_info,
};
let results_str = serde_json::to_string_pretty(&all_results).unwrap();

Expand Down
7 changes: 0 additions & 7 deletions node/perf-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// limitations under the License.

mod command;
pub mod sysinfo;
mod tests;
mod txn_signer;

Expand Down Expand Up @@ -45,12 +44,6 @@ pub struct PerfCmd {
#[structopt(long, value_name = "CHAIN_SPEC", default_value = "dev")]
pub chain: String,

#[structopt(
long = "disable-sysinfo",
help = "Do not attempt to query system info."
)]
pub disable_sysinfo: bool,

#[structopt(
long = "tests",
help = "Comma-separated list of tests to run (if omitted, runs all tests)"
Expand Down
Loading

0 comments on commit 026859c

Please sign in to comment.