|
|
@ -29,7 +29,7 @@ struct LP_millistats |
|
|
|
double lastmilli,millisum,threshold; |
|
|
|
uint32_t count; |
|
|
|
char name[64]; |
|
|
|
} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloopBTC_stats,LP_coinsloopKMD_stats,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats; |
|
|
|
} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloopBTC_stats,LP_coinsloopKMD_stats,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats,LP_gcloop_stats; |
|
|
|
extern int32_t IAMLP; |
|
|
|
|
|
|
|
void LP_millistats_update(struct LP_millistats *mp) |
|
|
@ -52,6 +52,7 @@ void LP_millistats_update(struct LP_millistats *mp) |
|
|
|
mp = &LP_pubkeysloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); |
|
|
|
mp = &LP_privkeysloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); |
|
|
|
mp = &LP_swapsloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); |
|
|
|
mp = &LP_gcloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -65,7 +66,7 @@ void LP_millistats_update(struct LP_millistats *mp) |
|
|
|
mp->millisum += elapsed; |
|
|
|
if ( mp->threshold != 0. && elapsed > mp->threshold ) |
|
|
|
{ |
|
|
|
if ( IAMLP == 0 ) |
|
|
|
//if ( IAMLP == 0 )
|
|
|
|
printf("%32s elapsed %10.2f millis > threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); |
|
|
|
} |
|
|
|
mp->lastmilli = millis; |
|
|
@ -74,7 +75,7 @@ void LP_millistats_update(struct LP_millistats *mp) |
|
|
|
} |
|
|
|
|
|
|
|
#include "LP_include.h" |
|
|
|
portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex; |
|
|
|
portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex,LP_gcmutex; |
|
|
|
int32_t LP_canbind; |
|
|
|
char *Broadcaststr,*Reserved_msgs[2][1000]; |
|
|
|
int32_t num_Reserved_msgs[2],max_Reserved_msgs[2]; |
|
|
@ -994,6 +995,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu |
|
|
|
portable_mutex_init(&LP_swaplistmutex); |
|
|
|
portable_mutex_init(&LP_cachemutex); |
|
|
|
portable_mutex_init(&LP_networkmutex); |
|
|
|
portable_mutex_init(&LP_gcmutex); |
|
|
|
portable_mutex_init(&LP_forwardmutex); |
|
|
|
portable_mutex_init(&LP_psockmutex); |
|
|
|
portable_mutex_init(&LP_coinmutex); |
|
|
@ -1112,6 +1114,11 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu |
|
|
|
printf("error launching queue_loop for port.%u\n",myport); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) |
|
|
|
{ |
|
|
|
printf("error launching gc_loop for port.%u\n",myport); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) |
|
|
|
{ |
|
|
|
printf("error launching prices_loop for port.%u\n",myport); |
|
|
|