hugolib: Add slightly more realistic tag distribution to benchmark
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 30 May 2017 12:33:37 +0000 (15:33 +0300)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 30 May 2017 12:33:37 +0000 (15:33 +0300)
hugolib/site_benchmark_test.go

index 1bb1f9206bf098284673b75f27f91bb53c0cb009..a22f48654daaae207bd35d7c98a9b7a8a1cbf4f1 100644 (file)
@@ -131,8 +131,10 @@ category = "categories"
                tags                = make([]string, cfg.TagsPerPage)
        )
 
+       tagOffset := rand.Intn(10)
+
        for i := 0; i < len(tags); i++ {
-               tags[i] = fmt.Sprintf("Hugo %d", i)
+               tags[i] = fmt.Sprintf("Hugo %d", i+tagOffset)
        }
 
        tagsStr := "[]"