Commit 80eaa05e authored by Kirill Smelkov's avatar Kirill Smelkov

X zgenprod1 tool

neotest part pending.
parent eb0e516f
......@@ -106,6 +106,7 @@ EOF
go get -v lab.nexedi.com/kirr/neo/go/...
go get -v github.com/pkg/profile # used by zhash.go
go get -v golang.org/x/perf/cmd/benchstat # to summarize/diff benchmark results
#go get -v github.com/aclements/perflock/cmd/perflock
git clone -o kirr -b x/hist https://lab.nexedi.com/kirr/ioping.git
pushd ioping
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Nexedi SA and Contributors.
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
# option) any later version, as published by the Free Software Foundation.
#
# You can also Link and Combine this program with other software covered by
# the terms of any of the Free Software licenses or any of the Open Source
# Initiative approved licenses and Convey the resulting work. Corresponding
# source of such a combination shall include the source code for all other
# software used.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options.
"""zgenprod1 - generate synthetic test database according to NEO PROD1 statistics"""
from __future__ import print_function
from neo.tests.stat_zodb import PROD1
from random import Random
import zodbtools.util
import sys
def usage(w):
print(\
"""Usage: zgenprod1 url n""", file=w)
def main():
argv = sys.argv[1:]
if len(argv) != 2:
print(__doc__)
usage(sys.stderr)
sys.exit(1)
url = argv[0]
n = int(argv[1])
zin = PROD1(Random(0)).as_storage(n)
zout = zodbtools.util.storageFromURL(url)
zout.copyTransactionsFrom(zin)
zout.close()
if __name__ == '__main__':
main()
......@@ -234,7 +234,7 @@ loop:
}
if check != "" && hresult != check {
return fmt.Errof("%s: hash mismatch: expected %s ; got %s\t# x=%s", url, check, hresult, x)
return fmt.Errorf("%s: hash mismatch: expected %s ; got %s\t# x=%s", url, check, hresult, x)
}
return nil
......
......@@ -163,7 +163,7 @@ def main():
(hresult, oid-1, nread, dt, dt * 1E6 / oid, x))
else:
topic = bench % x
print('Benchmark%s 1 %.1f µs/object\t# %s:%s oid=0..%d nread=%d t=%.3fs' % \
print('Benchmark%s 1 %.1f µs/object\t# %s oid=0..%d nread=%d t=%.3fs' % \
(topic, dt * 1E6 / oid, hresult, oid-1, nread, dt))
if check != None and hresult != check:
......
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