def synchronize_statsd_tags_gauges(full=False): with benchmark('synchronize statsd gauges for Tag.*'): statsd.gauge('tags.counts.total', Tag._get_collection().count()) if full: duplicates = Tag.objects(duplicate_of__ne=None).no_cache() statsd.gauge('tags.counts.duplicates', duplicates.count())