added more details on performance monitoring

This commit is contained in:
crypro.zoidberg 2019-04-17 19:22:51 +02:00
parent f412f2e418
commit 5dec82a2fc
5 changed files with 32 additions and 3 deletions

View file

@ -567,6 +567,8 @@ bool handle_get_daemon_info(po::variables_map& vm)
<< "longhash_calculating_time_3: " << res.performance_data.longhash_calculating_time_3 << ENDL
<< "raise_block_core_event: " << res.performance_data.raise_block_core_event << ENDL
<< "target_calculating_time_2: " << res.performance_data.target_calculating_time_2 << ENDL
<< "target_calculating_enum_blocks: " << res.performance_data.target_calculating_enum_blocks << ENDL
<< "target_calculating_calc: " << res.performance_data.target_calculating_calc << ENDL
<< "all_txs_insert_time_5: " << res.performance_data.all_txs_insert_time_5 << ENDL
<< "tx_add_one_tx_time: " << res.performance_data.tx_add_one_tx_time << ENDL
<< "tx_check_inputs_time: " << res.performance_data.tx_check_inputs_time << ENDL

View file

@ -932,8 +932,13 @@ wide_difficulty_type blockchain_storage::get_next_diff_conditional2(bool pos, co
return false;
return true;
};
TIME_MEASURE_START_PD(target_calculating_enum_blocks);
enum_blockchain(cb, alt_chain, split_height);
return next_difficulty(timestamps, commulative_difficulties, pos ? DIFFICULTY_POS_TARGET : DIFFICULTY_POW_TARGET);
TIME_MEASURE_FINISH_PD(target_calculating_enum_blocks);
TIME_MEASURE_START_PD(target_calculating_calc);
wide_difficulty_type res = next_difficulty(timestamps, commulative_difficulties, pos ? DIFFICULTY_POS_TARGET : DIFFICULTY_POW_TARGET);
TIME_MEASURE_FINISH_PD(target_calculating_calc);
return res;
}
//------------------------------------------------------------------
wide_difficulty_type blockchain_storage::get_cached_next_difficulty(bool pos) const

View file

@ -68,6 +68,9 @@ namespace currency
epee::math_helper::average<uint64_t, 5> etc_stuff_6;
epee::math_helper::average<uint64_t, 5> insert_time_4;
epee::math_helper::average<uint64_t, 5> raise_block_core_event;
//target_calculating_time_2
epee::math_helper::average<uint64_t, 5> target_calculating_enum_blocks;
epee::math_helper::average<uint64_t, 5> target_calculating_calc;
//tx processing zone
epee::math_helper::average<uint64_t, 5> tx_check_inputs_time;

View file

@ -239,6 +239,7 @@ namespace currency {
wide_difficulty_type next_difficulty(vector<uint64_t>& timestamps, vector<wide_difficulty_type>& cumulative_difficulties, size_t target_seconds)
{
TIME_MEASURE_START_PD(target_calculating_enum_blocks);
// timestamps - first is latest, back - is oldest timestamps
if (timestamps.size() > DIFFICULTY_WINDOW)
{

View file

@ -12,6 +12,7 @@
using namespace epee;
#include "wallet/wallet2.h"
#include "currency_core/blockchain_storage.h"
#include "currency_core/basic_pow_helpers.h"
using std::size_t;
@ -321,8 +322,25 @@ void run_emulation(const std::string& path)
void run_difficulty_analysis(const std::string& path)
{
//hash_rate_analysis(path);
run_emulation(path);
// currency::block b = AUTO_VAL_INIT(b);
// std::string s("sdsccasc");
// b.miner_tx.extra.push_back(s);
//
// crypto::hash mining_hash = currency::null_hash;
// bool r = string_tools::parse_tpod_from_hex_string("7759031ee0f014fe45476724df268f61c890b4a4637df1489a6c94c0135efbd8", mining_hash);
// uint64_t nonce = 13704307308123612296;
// crypto::hash pow_hash = currency::get_block_longhash(6, mining_hash, nonce);
//
// std::cout << mining_hash << ENDL;
// std::cout << pow_hash << ENDL;
//crypto::hash mining_hash = currency::get_block_header_mining_hash(b);
crypto::hash id_hash = currency::get_block_hash(b);
hash_rate_analysis(path);
//run_emulation(path);
}