forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- hacky script to analyze the DEBUG=require csv output grouped by
rubygem/logstash/etc
- Loading branch information
1 parent
dc634a1
commit 012dd9c
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require "csv" | ||
|
||
#0.003,psych/nodes/mapping,/Users/jls/.rvm/rubies/jruby-1.7.8/lib/ruby/shared/psych/nodes.rb:6:in `(root)' | ||
|
||
durations = {} | ||
durations.default = 0 | ||
|
||
CSV.foreach(ARGV[0]) do |duration, path, source| | ||
source, line, where = source.split(":") | ||
#{"0.002"=>"/Users/jls/projects/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.3/lib/clamp.rb"} | ||
if source.include?("jruby/1.9/gems") | ||
# Get the gem name | ||
source = source.gsub(/.*\/jruby\/1.9\/gems/, "")[/[^\/]+/] | ||
elsif source.include?("/lib/logstash/") | ||
source = source.gsub(/^.*(\/lib\/logstash\/)/, "/lib/logstash/") | ||
end | ||
durations[source] += duration.to_f | ||
end | ||
|
||
durations.sort_by { |k,v| v }.each do |k,v| | ||
puts "#{v} #{k}" | ||
end |