aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar √Čtienne Deparis 2020-12-30 08:44:02 +0100
committerGravatar √Čtienne Deparis 2020-12-30 08:44:02 +0100
commitfbb0b5dbfa39b0a1da5b207a863fa18f68efef35 (patch)
treee07b3a0cb7e2e1db6180832a7a3c9d7ff9c42040
parent5ca0816917d7d8f08f99b0a66926908151fe52ae (diff)
downloadruby-net-text-fbb0b5dbfa39b0a1da5b207a863fa18f68efef35.tar.gz
ruby-net-text-fbb0b5dbfa39b0a1da5b207a863fa18f68efef35.tar.xz
ruby-net-text-fbb0b5dbfa39b0a1da5b207a863fa18f68efef35.zip
feat: Add a little server load test file
-rwxr-xr-xbin/test_thread.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/test_thread.rb b/bin/test_thread.rb
new file mode 100755
index 0000000..423a6b3
--- /dev/null
+++ b/bin/test_thread.rb
@@ -0,0 +1,15 @@
+#!/usr/bin/env -S ruby -I lib -w
+# frozen_string_literal: true
+
+require 'net/gemini'
+
+all_threads = []
+
+100.times do
+ all_threads << Thread.new(ARGV[0]) do |arg|
+ response = Net::Gemini.get_response URI(arg)
+ puts "#{response.status} - #{response.meta}"
+ end
+end
+
+sleep 0.5 while Thread.list.length > 1