[servicemapper] reset stats when starting the mapper

This commit is contained in:
Sam Stenvall 2014-08-05 18:44:05 +03:00 committed by Jaroslav Kysela
parent 2be4265a29
commit d638f25225
2 changed files with 16 additions and 0 deletions

View file

@ -78,6 +78,9 @@ service_mapper_start ( const service_mapper_conf_t *conf, htsmsg_t *uuids )
int e, tr, qd = 0;
service_t *s;
/* Reset stat counters */
service_mapper_reset_stats();
/* Store config */
service_mapper_conf = *conf;
@ -432,3 +435,13 @@ service_mapper_thread ( void *aux )
pthread_mutex_unlock(&global_lock);
return NULL;
}
void
service_mapper_reset_stats (void)
{
service_mapper_stat.total = 0;
service_mapper_stat.ok = 0;
service_mapper_stat.ignore = 0;
service_mapper_stat.fail = 0;
service_mapper_stat.active = NULL;
}

View file

@ -72,4 +72,7 @@ void service_mapper_unlink ( struct service *s, struct channel *c, void *origin
*/
int service_mapper_clean ( struct service *s, struct channel *ch, void *origin );
// Resets the stat counters
void service_mapper_reset_stats ( void );
#endif /* __TVH_SERVICE_MAPPER_H__ */