Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[servicemapper] reset stats when starting the mapper
  • Loading branch information
Jalle19 authored and perexg committed Aug 6, 2014
1 parent 2be4265 commit d638f25
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/service_mapper.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
3 changes: 3 additions & 0 deletions src/service_mapper.h
Expand Up @@ -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__ */

0 comments on commit d638f25

Please sign in to comment.