diff options
Diffstat (limited to 'ot_stats.c')
| -rw-r--r-- | ot_stats.c | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -1,6 +1,6 @@ | |||
| 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
| 2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
| 3 | 3 | ||
| 4 | $id$ */ | 4 | $id$ */ |
| 5 | 5 | ||
| 6 | /* System */ | 6 | /* System */ |
| @@ -85,7 +85,7 @@ static int stats_shift_down_network_count( stats_network_node **node, int depth, | |||
| 85 | int i, rest = 0; | 85 | int i, rest = 0; |
| 86 | if( !*node ) return 0; | 86 | if( !*node ) return 0; |
| 87 | 87 | ||
| 88 | if( ++depth == STATS_NETWORK_NODE_MAXDEPTH ) | 88 | if( ++depth == STATS_NETWORK_NODE_MAXDEPTH ) |
| 89 | for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i ) { | 89 | for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i ) { |
| 90 | rest += ((*node)->counters[i]>>=shift); | 90 | rest += ((*node)->counters[i]>>=shift); |
| 91 | return rest; | 91 | return rest; |
| @@ -487,7 +487,7 @@ static size_t stats_torrents_mrtg( char * reply ) | |||
| 487 | 487 | ||
| 488 | static size_t stats_httperrors_txt ( char * reply ) { | 488 | static size_t stats_httperrors_txt ( char * reply ) { |
| 489 | return sprintf( reply, "302 RED %llu\n400 ... %llu\n400 PAR %llu\n400 COM %llu\n403 IP %llu\n404 INV %llu\n500 SRV %llu\n", | 489 | return sprintf( reply, "302 RED %llu\n400 ... %llu\n400 PAR %llu\n400 COM %llu\n403 IP %llu\n404 INV %llu\n500 SRV %llu\n", |
| 490 | ot_failed_request_counts[0], ot_failed_request_counts[1], ot_failed_request_counts[2], | 490 | ot_failed_request_counts[0], ot_failed_request_counts[1], ot_failed_request_counts[2], |
| 491 | ot_failed_request_counts[3], ot_failed_request_counts[4], ot_failed_request_counts[5], | 491 | ot_failed_request_counts[3], ot_failed_request_counts[4], ot_failed_request_counts[5], |
| 492 | ot_failed_request_counts[6] ); | 492 | ot_failed_request_counts[6] ); |
| 493 | } | 493 | } |
| @@ -545,10 +545,10 @@ static void stats_make( int *iovec_entries, struct iovec **iovector, ot_tasktype | |||
| 545 | *iovector = NULL; | 545 | *iovector = NULL; |
| 546 | if( !( r = iovec_increase( iovec_entries, iovector, OT_STATS_TMPSIZE ) ) ) | 546 | if( !( r = iovec_increase( iovec_entries, iovector, OT_STATS_TMPSIZE ) ) ) |
| 547 | return; | 547 | return; |
| 548 | 548 | ||
| 549 | switch( mode & TASK_TASK_MASK ) { | 549 | switch( mode & TASK_TASK_MASK ) { |
| 550 | case TASK_STATS_TORRENTS: r += stats_torrents_mrtg( r ); break; | 550 | case TASK_STATS_TORRENTS: r += stats_torrents_mrtg( r ); break; |
| 551 | case TASK_STATS_PEERS: r += stats_peers_mrtg( r ); break; | 551 | case TASK_STATS_PEERS: r += stats_peers_mrtg( r ); break; |
| 552 | case TASK_STATS_SLASH24S: r += stats_slash24s_txt( r, 25, 16 ); break; | 552 | case TASK_STATS_SLASH24S: r += stats_slash24s_txt( r, 25, 16 ); break; |
| 553 | case TASK_STATS_TOP10: r += stats_top10_txt( r ); break; | 553 | case TASK_STATS_TOP10: r += stats_top10_txt( r ); break; |
| 554 | case TASK_STATS_MEMORY: r += stats_vector_usage( r ); break; | 554 | case TASK_STATS_MEMORY: r += stats_vector_usage( r ); break; |
| @@ -609,9 +609,9 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uint32_t event_ | |||
| 609 | static void * stats_worker( void * args ) { | 609 | static void * stats_worker( void * args ) { |
| 610 | int iovec_entries; | 610 | int iovec_entries; |
| 611 | struct iovec *iovector; | 611 | struct iovec *iovector; |
| 612 | 612 | ||
| 613 | args = args; | 613 | args = args; |
| 614 | 614 | ||
| 615 | while( 1 ) { | 615 | while( 1 ) { |
| 616 | ot_tasktype tasktype = TASK_STATS; | 616 | ot_tasktype tasktype = TASK_STATS; |
| 617 | ot_taskid taskid = mutex_workqueue_poptask( &tasktype ); | 617 | ot_taskid taskid = mutex_workqueue_poptask( &tasktype ); |
