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

.

parent ccbe77fc
......@@ -32,14 +32,15 @@ import (
"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:
//
// func info(ctx, argv ...interface{}) {
// 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{} {
task := task.Current(ctx).String()
if task == "" {
......
......@@ -29,10 +29,10 @@ import (
"crypto/sha512"
"flag"
"fmt"
"io"
"hash"
"hash/crc32"
"hash/adler32"
"hash/crc32"
"io"
"os"
"sync/atomic"
"testing"
......@@ -54,17 +54,17 @@ import (
// hasher is hash.Hash which also knows its name
type hasher struct {
hash.Hash
name string
name string
}
// hasher that discards data
type nullHasher struct {}
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) Reset() {}
func (h nullHasher) Size() int { return 1 }
func (h nullHasher) BlockSize() int { return 1 }
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) Reset() {}
func (h nullHasher) Size() int { return 1 }
func (h nullHasher) BlockSize() int { return 1 }
// 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
err = xerr.First(err, err2)
}()
const nprefetch = 128 // XXX -> 512 ?
const nprefetch = 128 // XXX -> 512 ?
// prefetchBlk prefetches block of nprefetch objects starting from xid
//var tprevLoadBlkStart time.Time
......@@ -434,7 +434,7 @@ func zwrkPreconnect(ctx context.Context, url string, at zodb.Tid, nwrk int) (_ [
if err != nil {
for _, stor := range storv {
if stor != nil {
stor.Close() // XXX lclose
stor.Close() // XXX lclose
}
}
return nil, err
......@@ -506,10 +506,10 @@ var commands = prog.CommandRegistry{
func main() {
prog := prog.MainProg{
Name: "tzodb",
Summary: "tzodb is a tool to run ZODB-related benchmarks",
Commands: commands,
HelpTopics: nil,
Name: "tzodb",
Summary: "tzodb is a tool to run ZODB-related benchmarks",
Commands: commands,
HelpTopics: nil,
}
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