mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-22 03:37:43 +00:00
be less noisy again
This commit is contained in:
parent
80438dc1e2
commit
dc9f42de8b
1 changed files with 1 additions and 8 deletions
|
@ -7,7 +7,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/DataDog/datadog-go/statsd"
|
"github.com/DataDog/datadog-go/statsd"
|
||||||
|
@ -211,17 +210,11 @@ func (tc *trendingConsumer) Consume(delivery rmq.Delivery) {
|
||||||
return tps.Children[i].Score > tps.Children[j].Score
|
return tps.Children[i].Score > tps.Children[j].Score
|
||||||
})
|
})
|
||||||
|
|
||||||
posts := make([]string, tps.Count)
|
|
||||||
for i, post := range tps.Children {
|
|
||||||
posts[i] = fmt.Sprintf("%s: %d", post.Title, post.Score)
|
|
||||||
}
|
|
||||||
|
|
||||||
middlePost := tps.Count / 2
|
middlePost := tps.Count / 2
|
||||||
medianScore := tps.Children[middlePost].Score
|
medianScore := tps.Children[middlePost].Score
|
||||||
tc.logger.Info("calculated median score",
|
tc.logger.Debug("calculated median score",
|
||||||
zap.Int64("subreddit#id", id),
|
zap.Int64("subreddit#id", id),
|
||||||
zap.String("subreddit#name", subreddit.NormalizedName()),
|
zap.String("subreddit#name", subreddit.NormalizedName()),
|
||||||
zap.String("subreddit#posts", strings.Join(posts, "\n")),
|
|
||||||
zap.Int64("score", medianScore),
|
zap.Int64("score", medianScore),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue