Sha256: 9ca7bd2381c423481b9b4aab88d96b563d4c7995f9c26afa290a49fb231ef373

Contents?: true

Size: 784 Bytes

Versions: 10

Compression:

Stored size: 784 Bytes

Contents

#!/usr/local/bin/ruby

require 'ldap'

CHILDREN = 10
CONNECTS = 1	# per child
SEARCHES = 100	# per connection

pids = []
CHILDREN.times do
  pids << fork do
    CONNECTS.times do
      conn = LDAP::Conn.new("localhost",1389)
      conn.set_option(LDAP::LDAP_OPT_PROTOCOL_VERSION, 3)
      conn.bind
      SEARCHES.times do
        res = conn.search("cn=Fred Flintstone,dc=example,dc=com", LDAP::LDAP_SCOPE_BASE,
                          "(objectclass=*)") do |e|
          #puts "#{$$} #{e.dn.inspect}"
        end
      end
      conn.unbind
    end
  end
end
okcount = 0
badcount = 0
pids.each do |p|
  Process.wait(p)
  if $?.exitstatus == 0
    okcount += 1
  else
    badcount += 1
  end
end
puts "Children finished: #{okcount} ok, #{badcount} failed"
exit badcount > 0 ? 1 : 0

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
ruby-ldapserver-0.7.0 examples/speedtest.rb
ruby-ldapserver-0.5.3 examples/speedtest.rb
ruby-ldapserver-0.5.2 examples/speedtest.rb
ruby-ldapserver-0.5.1 examples/speedtest.rb
deveo-ruby-ldapserver-0.5.2 examples/speedtest.rb
ruby-ldapserver-0.5.0 examples/speedtest.rb
ruby-ldapserver-0.4.0 examples/speedtest.rb
fakeldap-0.0.1 vendor/ruby-ldapserver/examples/speedtest.rb
fakeldap-0.0.0 vendor/ruby-ldapserver/examples/speedtest.rb
ruby-ldapserver-0.3.1 examples/speedtest.rb