This commit is contained in:
Priyanka Kulshreshtha 2016-08-11 17:59:06 -07:00
Родитель 20fe27710d
Коммит e85f12ed87
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -36,9 +36,9 @@ type heatmap struct {
type byTabletUID []*discovery.TabletStats type byTabletUID []*discovery.TabletStats
func (a byTabletUid) Len() int { return len(a) } func (a byTabletUID) Len() int { return len(a) }
func (a byTabletUid) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a byTabletUID) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a byTabletUid) Less(i, j int) bool { return a[i].Tablet.Alias.Uid < a[j].Tablet.Alias.Uid } func (a byTabletUID) Less(i, j int) bool { return a[i].Tablet.Alias.Uid < a[j].Tablet.Alias.Uid }
const tabletMissing = -1 const tabletMissing = -1
@ -123,7 +123,7 @@ func (c *tabletStatsCache) StatsUpdate(stats *discovery.TabletStats) {
} }
c.statuses[keyspace][shard][cell][tabletType] = append(c.statuses[keyspace][shard][cell][tabletType], stats) c.statuses[keyspace][shard][cell][tabletType] = append(c.statuses[keyspace][shard][cell][tabletType], stats)
sort.Sort(byTabletUid(c.statuses[keyspace][shard][cell][tabletType])) sort.Sort(byTabletUID(c.statuses[keyspace][shard][cell][tabletType]))
c.statusesByAlias[aliasKey] = stats c.statusesByAlias[aliasKey] = stats
c.tabletCountsByCell[cell]++ c.tabletCountsByCell[cell]++
return return