Commit 3fb88be4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ccbe77fc
...@@ -32,14 +32,15 @@ import ( ...@@ -32,14 +32,15 @@ import (
"lab.nexedi.com/kirr/neo/go/internal/xcontext/task" "lab.nexedi.com/kirr/neo/go/internal/xcontext/task"
) )
// withTask prepends string describing current operational task stack to argv and returns it // withTask prepends string describing current operational task stack to argv and returns it.
//
// handy to use this way: // handy to use this way:
// //
// func info(ctx, argv ...interface{}) { // func info(ctx, argv ...interface{}) {
// glog.Info(withTask(ctx, argv...)...) // glog.Info(withTask(ctx, argv...)...)
// } // }
// //
// see https://golang.org/issues/21388 // see https://golang.org/issues/21388.
func withTask(ctx context.Context, argv ...interface{}) []interface{} { func withTask(ctx context.Context, argv ...interface{}) []interface{} {
task := task.Current(ctx).String() task := task.Current(ctx).String()
if task == "" { if task == "" {
......
...@@ -29,10 +29,10 @@ import ( ...@@ -29,10 +29,10 @@ import (
"crypto/sha512" "crypto/sha512"
"flag" "flag"
"fmt" "fmt"
"io"
"hash" "hash"
"hash/crc32"
"hash/adler32" "hash/adler32"
"hash/crc32"
"io"
"os" "os"
"sync/atomic" "sync/atomic"
"testing" "testing"
...@@ -54,17 +54,17 @@ import ( ...@@ -54,17 +54,17 @@ import (
// hasher is hash.Hash which also knows its name // hasher is hash.Hash which also knows its name
type hasher struct { type hasher struct {
hash.Hash hash.Hash
name string name string
} }
// hasher that discards data // hasher that discards data
type nullHasher struct {} type nullHasher struct {}
func (h nullHasher) Write(b []byte) (int, error) { return len(b), nil } func (h nullHasher) Write(b []byte) (int, error) { return len(b), nil }
func (h nullHasher) Sum(b []byte) []byte { return []byte{0} } func (h nullHasher) Sum(b []byte) []byte { return []byte{0} }
func (h nullHasher) Reset() {} func (h nullHasher) Reset() {}
func (h nullHasher) Size() int { return 1 } func (h nullHasher) Size() int { return 1 }
func (h nullHasher) BlockSize() int { return 1 } func (h nullHasher) BlockSize() int { return 1 }
// hashFlags installs common hash flags and returns function to retrieve selected hasher. // hashFlags installs common hash flags and returns function to retrieve selected hasher.
...@@ -153,7 +153,7 @@ func zhash(ctx context.Context, url string, h hasher, useprefetch bool, bench, c ...@@ -153,7 +153,7 @@ func zhash(ctx context.Context, url string, h hasher, useprefetch bool, bench, c
err = xerr.First(err, err2) err = xerr.First(err, err2)
}() }()
const nprefetch = 128 // XXX -> 512 ? const nprefetch = 128 // XXX -> 512 ?
// prefetchBlk prefetches block of nprefetch objects starting from xid // prefetchBlk prefetches block of nprefetch objects starting from xid
//var tprevLoadBlkStart time.Time //var tprevLoadBlkStart time.Time
...@@ -434,7 +434,7 @@ func zwrkPreconnect(ctx context.Context, url string, at zodb.Tid, nwrk int) (_ [ ...@@ -434,7 +434,7 @@ func zwrkPreconnect(ctx context.Context, url string, at zodb.Tid, nwrk int) (_ [
if err != nil { if err != nil {
for _, stor := range storv { for _, stor := range storv {
if stor != nil { if stor != nil {
stor.Close() // XXX lclose stor.Close() // XXX lclose
} }
} }
return nil, err return nil, err
...@@ -506,10 +506,10 @@ var commands = prog.CommandRegistry{ ...@@ -506,10 +506,10 @@ var commands = prog.CommandRegistry{
func main() { func main() {
prog := prog.MainProg{ prog := prog.MainProg{
Name: "tzodb", Name: "tzodb",
Summary: "tzodb is a tool to run ZODB-related benchmarks", Summary: "tzodb is a tool to run ZODB-related benchmarks",
Commands: commands, Commands: commands,
HelpTopics: nil, HelpTopics: nil,
} }
defer log.Flush() defer log.Flush()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment