mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 03:18:55 +00:00
Add benchmark for Node.fillExtra
This commit is contained in:
parent
d753a5ffa3
commit
d8e1482abe
27
node_test.go
Normal file
27
node_test.go
Normal file
@ -0,0 +1,27 @@
|
||||
package restic
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkNodeFillUser(t *testing.B) {
|
||||
tempfile, err := ioutil.TempFile("", "restic-test-temp-")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
fi, err := tempfile.Stat()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
node := &Node{}
|
||||
path := tempfile.Name()
|
||||
|
||||
t.ResetTimer()
|
||||
|
||||
for i := 0; i < t.N; i++ {
|
||||
node.fillExtra(path, fi)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user