Don't return statistic if engine is closed

pull/7024/head
Jason Wilder 2016-07-15 14:53:06 -06:00
parent 27650da7b9
commit cc4a668be5
1 changed files with 4 additions and 0 deletions

View File

@ -172,6 +172,10 @@ type ShardStatistics struct {
// Statistics returns statistics for periodic monitoring.
func (s *Shard) Statistics(tags map[string]string) []models.Statistic {
if err := s.ready(); err != nil {
return nil
}
tags = s.statTags.Merge(tags)
statistics := []models.Statistic{{
Name: "shard",