tests: import a bunch more random unchecked in pieces.

issue260
David Wilson 6 years ago
parent 0d70fc1324
commit 918f709420

@ -0,0 +1,25 @@
- hosts: all
any_errors_fatal: true
tasks:
- name: Create file tree
connection: local
shell: >
mkdir -p /tmp/filetree.in;
for i in `seq -f /tmp/filetree.in/%g 1 100`; do echo $RANDOM > $i; done;
- name: Delete remote file tree
file: path=/tmp/filetree.out state=absent
when: 0
- file:
state: directory
path: /tmp/filetree.out
- name: Trigger nasty process pileup
copy:
src: "{{item.src}}"
dest: "/tmp/filetree.out/{{item.path}}"
with_filetree: /tmp/filetree.in
when: item.state == 'file'

@ -0,0 +1,5 @@
# tests/bench/
Various manually executed scripts to aid benchmarking, or trigger old
performance problems.

@ -12,6 +12,6 @@ def do_nothing():
def main(router): def main(router):
f = router.fork() f = router.fork()
t0 = time.time() t0 = time.time()
for x in xrange(10000): for x in range(1000):
f.call(do_nothing) f.call(do_nothing)
print '++', int(1e6 * ((time.time() - t0) / (1.0+x))), 'usec' print '++', int(1e6 * ((time.time() - t0) / (1.0+x))), 'usec'

@ -0,0 +1,23 @@
"""
Measure latency of local service RPC.
"""
import time
import mitogen.service
import mitogen
class MyService(mitogen.service.Service):
@mitogen.service.expose(policy=mitogen.service.AllowParents())
def ping(self):
return 'pong'
@mitogen.main()
def main(router):
f = router.fork()
t0 = time.time()
for x in range(1000):
f.call_service(service_name=MyService, method_name='ping')
print('++', int(1e6 * ((time.time() - t0) / (1.0+x))), 'usec')

@ -1,5 +1,5 @@
# stubs/ # tests/data/stubs/
Dummy implementations of various third party tools that just spawn local Python Dummy implementations of various third party tools that just spawn local Python
interpreters. Used to roughly test the tools' associated Mitogen classes. interpreters. Used to roughly test the tools' associated Mitogen classes.

Loading…
Cancel
Save