static unsigned long long ot_overall_udp_successfulannounces = 0;
static unsigned long long ot_overall_tcp_successfulscrapes = 0;
static unsigned long long ot_overall_udp_successfulscrapes = 0;
+static unsigned long long ot_overall_tcp_connects = 0;
+static unsigned long long ot_overall_udp_connects = 0;
static unsigned long long ot_full_scrape_count = 0;
static unsigned long long ot_full_scrape_size = 0;
return sprintf( reply,
"%llu\n%llu\n%i seconds (%i hours)\nopentracker connections, %lu conns/s :: %lu success/s.",
ot_overall_tcp_connections+ot_overall_udp_connections,
- ot_overall_tcp_successfulannounces+ot_overall_udp_successfulannounces,
+ ot_overall_tcp_successfulannounces+ot_overall_udp_successfulannounces+ot_overall_udp_connects,
(int)t,
(int)(t / 3600),
events_per_time( ot_overall_tcp_connections+ot_overall_udp_connections, t ),
- events_per_time( ot_overall_tcp_successfulannounces+ot_overall_udp_successfulannounces, t )
+ events_per_time( ot_overall_tcp_successfulannounces+ot_overall_udp_successfulannounces+ot_overall_udp_connects, t )
);
}
return sprintf( reply,
"%llu\n%llu\n%i seconds (%i hours)\nopentracker udp4 stats, %lu conns/s :: %lu success/s.",
ot_overall_udp_connections,
- ot_overall_udp_successfulannounces,
+ ot_overall_udp_successfulannounces+ot_overall_udp_connects,
(int)t,
(int)(t / 3600),
events_per_time( ot_overall_udp_connections, t ),
- events_per_time( ot_overall_udp_successfulannounces, t )
+ events_per_time( ot_overall_udp_successfulannounces+ot_overall_udp_connects, t )
);
}
);
}
+static size_t stats_scrape_mrtg( char * reply ) {
+ time_t t = time( NULL ) - ot_start_time;
+ return sprintf( reply,
+ "%llu\n%llu\n%i seconds (%i hours)\nopentracker scrape stats, %lu scrape/s (tcp and udp)",
+ ot_overall_tcp_successfulscrapes,
+ ot_overall_udp_successfulscrapes,
+ (int)t,
+ (int)(t / 3600),
+ events_per_time( (ot_overall_tcp_successfulscrapes+ot_overall_udp_successfulscrapes), t )
+ );
+}
static size_t stats_fullscrapes_mrtg( char * reply ) {
ot_time t = time( NULL ) - ot_start_time;
switch( mode ) {
case TASK_STATS_CONNS:
return stats_connections_mrtg( reply );
+ case TASK_STATS_SCRAPE:
+ return stats_scrape_mrtg( reply );
case TASK_STATS_UDP:
return stats_udpconnections_mrtg( reply );
case TASK_STATS_TCP:
break;
case EVENT_SCRAPE:
if( is_tcp ) ot_overall_tcp_successfulscrapes++; else ot_overall_udp_successfulscrapes++;
+ case EVENT_CONNECT:
+ if( is_tcp ) ot_overall_tcp_connects++; else ot_overall_udp_connects++;
case EVENT_FULLSCRAPE:
ot_full_scrape_count++;
ot_full_scrape_size += event_data;