mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
perf-test: add ruby test
Simply list the message-id of all the messages in a loop 100 times. Suggested-by: David Bremner <david@tethera.net> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
parent
d8a5fba4fe
commit
02cf4a50bb
1 changed files with 24 additions and 0 deletions
24
performance-test/T05-ruby.sh
Executable file
24
performance-test/T05-ruby.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
test_description='ruby bindings'
|
||||
|
||||
. $(dirname "$0")/perf-test-lib.sh || exit 1
|
||||
|
||||
if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then
|
||||
echo "missing prerequisites: ruby development files"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
time_start
|
||||
|
||||
time_run 'print all messages' "$NOTMUCH_RUBY -I '$NOTMUCH_BUILDDIR/bindings/ruby' <<'EOF'
|
||||
require 'notmuch'
|
||||
db = Notmuch::Database.new('$MAIL_DIR')
|
||||
100.times.each do
|
||||
db.query('').search_messages.each do |msg|
|
||||
puts msg.message_id
|
||||
end
|
||||
end
|
||||
EOF"
|
||||
|
||||
time_done
|
Loading…
Reference in a new issue