OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
ruby
/
2.5.0
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
English.rb
6.31 KB
08/25/2017 03:47:04 PM
rw-r--r--
📄
abbrev.rb
3.49 KB
02/09/2017 04:12:00 PM
rw-r--r--
📄
base64.rb
3.3 KB
02/10/2017 12:58:47 AM
rw-r--r--
📄
benchmark.rb
17.89 KB
01/03/2017 02:00:01 AM
rw-r--r--
📁
bigdecimal
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📁
cgi
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
cgi.rb
9.8 KB
02/18/2017 05:52:16 AM
rw-r--r--
📄
cmath.rb
9.49 KB
12/12/2017 11:56:25 AM
rw-r--r--
📄
csv.rb
82.88 KB
09/12/2017 08:38:06 AM
rw-r--r--
📄
date.rb
1003 bytes
05/15/2023 11:41:43 AM
rw-r--r--
📄
debug.rb
29.97 KB
01/05/2017 01:00:01 AM
rw-r--r--
📄
delegate.rb
10.44 KB
12/12/2017 11:56:25 AM
rw-r--r--
📁
digest
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
digest.rb
2.83 KB
05/15/2023 11:41:43 AM
rw-r--r--
📁
drb
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
drb.rb
50 bytes
12/16/2015 05:07:31 AM
rw-r--r--
📄
e2mmap.rb
3.94 KB
03/01/2017 11:37:30 AM
rw-r--r--
📄
erb.rb
27.46 KB
01/03/2018 06:11:47 PM
rw-r--r--
📄
expect.rb
2.17 KB
05/15/2023 11:41:43 AM
rw-r--r--
📁
fiddle
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
fiddle.rb
1.68 KB
05/15/2023 11:41:43 AM
rw-r--r--
📄
fileutils.rb
44.15 KB
12/22/2017 08:00:10 AM
rw-r--r--
📄
find.rb
2.47 KB
09/15/2017 05:00:49 PM
rw-r--r--
📁
forwardable
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
forwardable.rb
8.49 KB
12/12/2017 11:56:25 AM
rw-r--r--
📄
getoptlong.rb
15.42 KB
09/02/2017 02:05:34 AM
rw-r--r--
📁
io
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
ipaddr.rb
19.51 KB
12/12/2017 11:56:25 AM
rw-r--r--
📁
irb
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
irb.rb
20.48 KB
02/21/2018 06:00:51 AM
rw-r--r--
📁
json
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
json.rb
1.77 KB
05/15/2023 11:41:43 AM
rw-r--r--
📄
kconv.rb
5.77 KB
05/15/2023 11:41:43 AM
rw-r--r--
📄
logger.rb
23.54 KB
12/21/2017 05:07:43 AM
rw-r--r--
📁
matrix
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
matrix.rb
53.2 KB
12/12/2017 11:56:25 AM
rw-r--r--
📄
mkmf.rb
84.38 KB
05/15/2023 11:41:43 AM
rw-r--r--
📄
monitor.rb
7.26 KB
10/08/2017 07:00:01 AM
rw-r--r--
📄
mutex_m.rb
2.02 KB
10/08/2017 07:00:01 AM
rw-r--r--
📁
net
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
observer.rb
5.83 KB
01/13/2017 12:08:29 PM
rw-r--r--
📄
open-uri.rb
25.11 KB
12/21/2017 02:15:04 PM
rw-r--r--
📄
open3.rb
20.94 KB
10/21/2017 07:00:58 AM
rw-r--r--
📁
openssl
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
openssl.rb
469 bytes
05/15/2023 11:41:43 AM
rw-r--r--
📄
optionparser.rb
59 bytes
12/16/2015 05:07:31 AM
rw-r--r--
📁
optparse
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
optparse.rb
57.25 KB
07/24/2017 01:56:04 AM
rw-r--r--
📄
ostruct.rb
10.16 KB
12/12/2017 11:56:25 AM
rw-r--r--
📄
pathname.rb
16.09 KB
05/15/2023 11:41:43 AM
rw-r--r--
📄
pp.rb
14.36 KB
12/18/2017 01:51:53 AM
rw-r--r--
📄
prettyprint.rb
15.89 KB
11/10/2015 11:48:14 AM
rw-r--r--
📄
prime.rb
12.48 KB
05/20/2017 10:21:44 AM
rw-r--r--
📄
profile.rb
235 bytes
01/15/2017 02:56:04 AM
rw-r--r--
📄
profiler.rb
4.54 KB
01/18/2017 12:35:10 PM
rw-r--r--
📄
pstore.rb
14.7 KB
01/17/2017 12:47:38 PM
rw-r--r--
📁
psych
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
psych.rb
16.54 KB
05/15/2023 11:41:43 AM
rw-r--r--
📁
racc
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📁
rdoc
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
rdoc.rb
5.03 KB
12/23/2017 11:33:09 PM
rw-r--r--
📄
resolv-replace.rb
1.76 KB
11/14/2015 08:25:30 AM
rw-r--r--
📄
resolv.rb
72.73 KB
12/20/2017 04:25:01 AM
rw-r--r--
📁
rexml
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📁
rinda
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📁
ripper
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
ripper.rb
2.44 KB
05/15/2023 11:41:43 AM
rw-r--r--
📁
rss
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
rss.rb
2.87 KB
12/16/2015 05:07:31 AM
rw-r--r--
📁
rubygems
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
rubygems.rb
36.57 KB
03/19/2018 08:27:04 AM
rw-r--r--
📄
scanf.rb
23.56 KB
10/21/2017 12:34:13 PM
rw-r--r--
📄
securerandom.rb
8.61 KB
10/25/2017 07:28:22 AM
rw-r--r--
📄
set.rb
24.01 KB
11/22/2017 09:13:51 PM
rw-r--r--
📁
shell
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
shell.rb
11.37 KB
11/05/2016 11:58:02 PM
rw-r--r--
📄
shellwords.rb
6.66 KB
11/05/2016 04:58:48 AM
rw-r--r--
📄
singleton.rb
4.04 KB
10/08/2017 07:00:01 AM
rw-r--r--
📄
socket.rb
43.51 KB
05/15/2023 11:41:43 AM
rw-r--r--
📄
sync.rb
7.29 KB
09/18/2016 10:24:48 AM
rw-r--r--
📁
syslog
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
tempfile.rb
11.14 KB
12/12/2017 11:56:25 AM
rw-r--r--
📄
thwait.rb
3.33 KB
10/08/2017 07:00:01 AM
rw-r--r--
📄
time.rb
22.38 KB
05/15/2023 11:41:43 AM
rw-r--r--
📄
timeout.rb
3.81 KB
12/12/2017 11:56:25 AM
rw-r--r--
📄
tmpdir.rb
4.12 KB
03/28/2018 12:54:26 PM
rw-r--r--
📄
tracer.rb
6.42 KB
10/08/2017 07:00:01 AM
rw-r--r--
📄
tsort.rb
14.3 KB
11/14/2015 08:46:11 AM
rw-r--r--
📄
un.rb
9.78 KB
07/05/2017 09:05:53 AM
rw-r--r--
📁
unicode_normalize
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📁
uri
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
uri.rb
3.1 KB
12/16/2015 05:07:31 AM
rw-r--r--
📄
weakref.rb
1.44 KB
10/24/2017 06:08:00 PM
rw-r--r--
📁
webrick
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
webrick.rb
6.72 KB
12/23/2015 03:43:23 AM
rw-r--r--
📁
yaml
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
yaml.rb
1.73 KB
12/12/2017 11:56:25 AM
rw-r--r--
Editing: profiler.rb
Close
# frozen_string_literal: true # Profile provides a way to Profile your Ruby application. # # Profiling your program is a way of determining which methods are called and # how long each method takes to complete. This way you can detect which # methods are possible bottlenecks. # # Profiling your program will slow down your execution time considerably, # so activate it only when you need it. Don't confuse benchmarking with # profiling. # # There are two ways to activate Profiling: # # == Command line # # Run your Ruby script with <code>-rprofile</code>: # # ruby -rprofile example.rb # # If you're profiling an executable in your <code>$PATH</code> you can use # <code>ruby -S</code>: # # ruby -rprofile -S some_executable # # == From code # # Just require 'profile': # # require 'profile' # # def slow_method # 5000.times do # 9999999999999999*999999999 # end # end # # def fast_method # 5000.times do # 9999999999999999+999999999 # end # end # # slow_method # fast_method # # The output in both cases is a report when the execution is over: # # ruby -rprofile example.rb # # % cumulative self self total # time seconds seconds calls ms/call ms/call name # 68.42 0.13 0.13 2 65.00 95.00 Integer#times # 15.79 0.16 0.03 5000 0.01 0.01 Fixnum#* # 15.79 0.19 0.03 5000 0.01 0.01 Fixnum#+ # 0.00 0.19 0.00 2 0.00 0.00 IO#set_encoding # 0.00 0.19 0.00 1 0.00 100.00 Object#slow_method # 0.00 0.19 0.00 2 0.00 0.00 Module#method_added # 0.00 0.19 0.00 1 0.00 90.00 Object#fast_method # 0.00 0.19 0.00 1 0.00 190.00 #toplevel module Profiler__ class Wrapper < Struct.new(:defined_class, :method_id, :hash) # :nodoc: private :defined_class=, :method_id=, :hash= def initialize(klass, mid) super(klass, mid, nil) self.hash = Struct.instance_method(:hash).bind(self).call end def to_s "#{defined_class.inspect}#".sub(/\A\#<Class:(.*)>#\z/, '\1.') << method_id.to_s end alias inspect to_s end # internal values @@start = nil # the start time that profiling began @@stacks = nil # the map of stacks keyed by thread @@maps = nil # the map of call data keyed by thread, class and id. Call data contains the call count, total time, PROFILE_CALL_PROC = TracePoint.new(*%i[call c_call b_call]) {|tp| # :nodoc: now = Process.times[0] stack = (@@stacks[Thread.current] ||= []) stack.push [now, 0.0] } PROFILE_RETURN_PROC = TracePoint.new(*%i[return c_return b_return]) {|tp| # :nodoc: now = Process.times[0] key = Wrapper.new(tp.defined_class, tp.method_id) stack = (@@stacks[Thread.current] ||= []) if tick = stack.pop threadmap = (@@maps[Thread.current] ||= {}) data = (threadmap[key] ||= [0, 0.0, 0.0, key]) data[0] += 1 cost = now - tick[0] data[1] += cost data[2] += cost - tick[1] stack[-1][1] += cost if stack[-1] end } module_function # Starts the profiler. # # See Profiler__ for more information. def start_profile @@start = Process.times[0] @@stacks = {} @@maps = {} PROFILE_CALL_PROC.enable PROFILE_RETURN_PROC.enable end # Stops the profiler. # # See Profiler__ for more information. def stop_profile PROFILE_CALL_PROC.disable PROFILE_RETURN_PROC.disable end # Outputs the results from the profiler. # # See Profiler__ for more information. def print_profile(f) stop_profile total = Process.times[0] - @@start if total == 0 then total = 0.01 end totals = {} @@maps.values.each do |threadmap| threadmap.each do |key, data| total_data = (totals[key] ||= [0, 0.0, 0.0, key]) total_data[0] += data[0] total_data[1] += data[1] total_data[2] += data[2] end end # Maybe we should show a per thread output and a totals view? data = totals.values data = data.sort_by{|x| -x[2]} sum = 0 f.printf " %% cumulative self self total\n" f.printf " time seconds seconds calls ms/call ms/call name\n" for d in data sum += d[2] f.printf "%6.2f %8.2f %8.2f %8d ", d[2]/total*100, sum, d[2], d[0] f.printf "%8.2f %8.2f %s\n", d[2]*1000/d[0], d[1]*1000/d[0], d[3] end f.printf "%6.2f %8.2f %8.2f %8d ", 0.0, total, 0.0, 1 # ??? f.printf "%8.2f %8.2f %s\n", 0.0, total*1000, "#toplevel" # ??? end end