Browse Source

Make woodpecker spotting more usable by adjusting count every 2 minutes

master
Dirk Engling 9 years ago
parent
commit
f8ebe3e7c8
  1. 4
      ot_clean.c
  2. 10
      ot_stats.c
  3. 1
      ot_stats.h

4
ot_clean.c

@ -16,6 +16,7 @@
#include "ot_mutex.h"
#include "ot_vector.h"
#include "ot_clean.h"
#include "ot_stats.h"
/* Returns amount of removed peers */
static ssize_t clean_single_bucket( ot_peer *peers, size_t peer_count, time_t timedout, int *removed_seeders ) {
@ -121,6 +122,7 @@ static void * clean_worker( void * args ) {
return NULL;
usleep( OT_CLEAN_SLEEP );
}
stats_cleanup();
}
return NULL;
}
@ -134,4 +136,4 @@ void clean_deinit( void ) {
pthread_cancel( thread_id );
}
const char *g_version_clean_c = "$Source: /home/cvsroot/opentracker/ot_clean.c,v $: $Revision: 1.20 $\n";
const char *g_version_clean_c = "$Source: /home/cvsroot/opentracker/ot_clean.c,v $: $Revision: 1.21 $\n";

10
ot_stats.c

@ -731,6 +731,14 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event
}
}
void stats_cleanup() {
#ifdef WANT_SPOT_WOODPECKER
pthread_mutex_lock( &g_woodpeckers_mutex );
stats_shift_down_network_count( &stats_woodpeckers_tree, 0, 1 );
pthread_mutex_unlock( &g_woodpeckers_mutex );
#endif
}
static void * stats_worker( void * args ) {
int iovec_entries;
struct iovec *iovector;
@ -761,4 +769,4 @@ void stats_deinit( ) {
pthread_cancel( thread_id );
}
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.71 $\n";
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.72 $\n";

1
ot_stats.h

@ -39,6 +39,7 @@ enum {
void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event_data );
void stats_deliver( int64 sock, int tasktype );
void stats_cleanup();
size_t return_stats_for_tracker( char *reply, int mode, int format );
size_t stats_return_tracker_version( char *reply );
void stats_init( );

Loading…
Cancel
Save