mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 13:55:41 +00:00
Merge pull request #118489 from testwill/logs
chore: os.SEEK_END os.SEEK_SET and use b.Logf(...) instead of b.Log(f…
This commit is contained in:
commit
da1f52034e
@ -18,7 +18,6 @@ package benchmark
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
@ -119,7 +118,7 @@ func BenchmarkEncoding(b *testing.B) {
|
|||||||
test(b, "json", prints)
|
test(b, "json", prints)
|
||||||
})
|
})
|
||||||
|
|
||||||
b.Log(fmt.Sprintf("%s: file sizes: %v\n", path, fileSizes))
|
b.Logf("%s: file sizes: %v\n", path, fileSizes)
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
@ -287,11 +286,11 @@ func generateOutput(b *testing.B, config loadGeneratorConfig, files ...*os.File)
|
|||||||
b.Logf("Wrote %d log entries in %s -> %.1f/s", total, duration, float64(total)/duration.Seconds())
|
b.Logf("Wrote %d log entries in %s -> %.1f/s", total, duration, float64(total)/duration.Seconds())
|
||||||
for i, file := range files {
|
for i, file := range files {
|
||||||
if file != nil {
|
if file != nil {
|
||||||
pos, err := file.Seek(0, os.SEEK_END)
|
pos, err := file.Seek(0, io.SeekEnd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
}
|
}
|
||||||
if _, err := file.Seek(0, os.SEEK_SET); err != nil {
|
if _, err := file.Seek(0, io.SeekStart); err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
}
|
}
|
||||||
max := 50
|
max := 50
|
||||||
|
Loading…
Reference in New Issue
Block a user