summaryrefslogtreecommitdiff
path: root/ot_stats.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_stats.c')
-rw-r--r--ot_stats.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ot_stats.c b/ot_stats.c
index 5d9dab2..5427f1f 100644
--- a/ot_stats.c
+++ b/ot_stats.c
@@ -46,6 +46,7 @@ static unsigned long long ot_full_scrape_count = 0;
46static unsigned long long ot_full_scrape_request_count = 0; 46static unsigned long long ot_full_scrape_request_count = 0;
47static unsigned long long ot_full_scrape_size = 0; 47static unsigned long long ot_full_scrape_size = 0;
48static unsigned long long ot_failed_request_counts[CODE_HTTPERROR_COUNT]; 48static unsigned long long ot_failed_request_counts[CODE_HTTPERROR_COUNT];
49static unsigned long long ot_renewed[OT_POOLS_COUNT];
49 50
50static time_t ot_start_time; 51static time_t ot_start_time;
51 52
@@ -492,6 +493,15 @@ static size_t stats_httperrors_txt ( char * reply ) {
492 ot_failed_request_counts[6] ); 493 ot_failed_request_counts[6] );
493} 494}
494 495
496static size_t stats_return_renew_bucket( char * reply ) {
497 char *r = reply;
498 int i;
499
500 for( i=0; i<OT_BUCKET_COUNT; ++i )
501 r+=sprintf(r,"%02i %llu\n", i, ot_renewed[i] );
502 return r - reply;
503}
504
495extern const char 505extern const char
496*g_version_opentracker_c, *g_version_accesslist_c, *g_version_clean_c, *g_version_fullscrape_c, *g_version_http_c, 506*g_version_opentracker_c, *g_version_accesslist_c, *g_version_clean_c, *g_version_fullscrape_c, *g_version_http_c,
497*g_version_iovec_c, *g_version_mutex_c, *g_version_stats_c, *g_version_sync_c, *g_version_udp_c, *g_version_vector_c, 507*g_version_iovec_c, *g_version_mutex_c, *g_version_stats_c, *g_version_sync_c, *g_version_udp_c, *g_version_vector_c,
@@ -525,6 +535,8 @@ size_t return_stats_for_tracker( char *reply, int mode, int format ) {
525 return stats_httperrors_txt( reply ); 535 return stats_httperrors_txt( reply );
526 case TASK_STATS_VERSION: 536 case TASK_STATS_VERSION:
527 return stats_return_tracker_version( reply ); 537 return stats_return_tracker_version( reply );
538 case TASK_STATS_RENEW:
539 return stats_return_renew_bucket( reply );
528#ifdef WANT_LOG_NETWORKS 540#ifdef WANT_LOG_NETWORKS
529 case TASK_STATS_BUSY_NETWORKS: 541 case TASK_STATS_BUSY_NETWORKS:
530 return stats_return_busy_networks( reply ); 542 return stats_return_busy_networks( reply );
@@ -596,6 +608,9 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uint32_t event_
596 case EVENT_FAILED: 608 case EVENT_FAILED:
597 ot_failed_request_counts[event_data]++; 609 ot_failed_request_counts[event_data]++;
598 break; 610 break;
611 case EVENT_RENEW:
612 ot_renewed[event_data]++;
613 break;
599 case EVENT_SYNC_IN_REQUEST: 614 case EVENT_SYNC_IN_REQUEST:
600 case EVENT_SYNC_IN: 615 case EVENT_SYNC_IN:
601 case EVENT_SYNC_OUT_REQUEST: 616 case EVENT_SYNC_OUT_REQUEST: