all: sync with master
This commit is contained in:
@@ -68,13 +68,13 @@ func TestStats_races(t *testing.T) {
|
||||
startWG, finWG := &sync.WaitGroup{}, &sync.WaitGroup{}
|
||||
waitCh := make(chan unit)
|
||||
|
||||
for i := 0; i < writersNum; i++ {
|
||||
for i := range writersNum {
|
||||
startWG.Add(1)
|
||||
finWG.Add(1)
|
||||
go writeFunc(startWG, finWG, waitCh, i)
|
||||
}
|
||||
|
||||
for i := 0; i < readersNum; i++ {
|
||||
for range readersNum {
|
||||
startWG.Add(1)
|
||||
finWG.Add(1)
|
||||
go readFunc(startWG, finWG, waitCh)
|
||||
@@ -111,7 +111,7 @@ func TestStatsCtx_FillCollectedStats_daily(t *testing.T) {
|
||||
|
||||
dailyData := []*unitDB{}
|
||||
|
||||
for i := 0; i < daysCount*24; i++ {
|
||||
for i := range daysCount * 24 {
|
||||
n := uint64(i)
|
||||
nResult := make([]uint64, resultLast)
|
||||
nResult[RFiltered] = n
|
||||
|
||||
@@ -195,7 +195,7 @@ func TestLargeNumbers(t *testing.T) {
|
||||
for h := 0; h < hoursNum; h++ {
|
||||
atomic.AddUint32(&curHour, 1)
|
||||
|
||||
for i := 0; i < cliNumPerHour; i++ {
|
||||
for i := range cliNumPerHour {
|
||||
ip := net.IP{127, 0, byte((i & 0xff00) >> 8), byte(i & 0xff)}
|
||||
e := &stats.Entry{
|
||||
Domain: fmt.Sprintf("domain%d.hour%d", i, h),
|
||||
|
||||
@@ -525,9 +525,8 @@ func (s *StatsCtx) fillCollectedStatsDaily(
|
||||
hours := countHours(curHour, days)
|
||||
units = units[len(units)-hours:]
|
||||
|
||||
for i := 0; i < len(units); i++ {
|
||||
for i, u := range units {
|
||||
day := i / 24
|
||||
u := units[i]
|
||||
|
||||
data.DNSQueries[day] += u.NTotal
|
||||
data.BlockedFiltering[day] += u.NResult[RFiltered]
|
||||
|
||||
Reference in New Issue
Block a user