@@ -2609,6 +2609,8 @@ UniValue zc_benchmark(const UniValue& params, bool fHelp)
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, "Benchmark must be run in regtest mode");
|
||||
}
|
||||
sample_times.push_back(benchmark_loadwallet());
|
||||
} else if (benchmarktype == "listunspent") {
|
||||
sample_times.push_back(benchmark_listunspent());
|
||||
} else {
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid benchmarktype");
|
||||
}
|
||||
|
||||
@@ -465,3 +465,12 @@ double benchmark_loadwallet()
|
||||
post_wallet_load();
|
||||
return res;
|
||||
}
|
||||
|
||||
double benchmark_listunspent()
|
||||
{
|
||||
UniValue params(UniValue::VARR);
|
||||
struct timeval tv_start;
|
||||
timer_start(tv_start);
|
||||
auto unspent = listunspent(params, false);
|
||||
return timer_stop(tv_start);
|
||||
}
|
||||
|
||||
@@ -18,5 +18,6 @@ extern double benchmark_increment_note_witnesses(size_t nTxs);
|
||||
extern double benchmark_connectblock_slow();
|
||||
extern double benchmark_sendtoaddress(CAmount amount);
|
||||
extern double benchmark_loadwallet();
|
||||
extern double benchmark_listunspent();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user