-
Notifications
You must be signed in to change notification settings - Fork 36
Filtering, Zooming, Detailed Analysis #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thisduck
wants to merge
52
commits into
SamSaffron:master
Choose a base branch
from
thisduck:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
ac7e596
starting with tab to spaces. =/
thisduck 1b6abc8
removing text nodes.
thisduck 9eba01f
draw the rects straight up.
thisduck ffaa7b7
pre process the data before rendering.
thisduck 9fb9562
for speed, let's not draw rects that are less than width 1.
thisduck 71e53c8
refactoring code so that rects can be redrawn.
thisduck 22baefa
ability to switch between gem and methods.
thisduck c5e99a6
better zooming and filtering.
thisduck fa127ca
filter by field.
thisduck 6115bbc
major rewrite to allow more detailed data analysis.
thisduck 65a2a60
modifying backtrace display.
thisduck 72da00e
prevent context menu on graph. hide info box on mouse out.
thisduck f485265
split gem by type of ruby module.
thisduck 0c249b6
show full backtrace, even when in zoom.
thisduck 317a77a
adding ability to zoom into to a frame from backtrace.
thisduck 361effb
adding ability to see breakdown of frames from gems or methods.
thisduck c74c10f
some speed improvements.
thisduck 34b4b61
update semantic css to exclude external call to font, and include bae…
thisduck 963c252
adding keyboard functionality.
thisduck 58d6129
committed hardcoded filter by mistake.
thisduck a95c025
fixing parsing for gems. and let's not have a border if Y is large.
thisduck 2c523ad
calculate samplesLength outside loop for speed.
thisduck 191910d
making things super fast. use end points instead of width to fix bugg…
thisduck daa39c0
determine parents and children while setting relations, more speed. r…
thisduck e984b4e
changed spacing.
thisduck 642cafb
copy file path to clipboard. animate selected gem/method.
thisduck 1dc1d5b
add a shortcut for copying file path to clipboard. fixed bug for back…
thisduck e5ab619
some clean up to makes things nice.
thisduck 4276fe0
covert rects to divs in order to get text with good speeds.
thisduck 3628dfd
adding help button to show shortcut modal.
thisduck f7d7e8a
text color needs to be white on highlight.
thisduck 0447eb7
lower border threshold since borders are thicker now.
thisduck f8f38e3
making borders nicer.
thisduck 5e8d4e8
had accidentally reversed the x axis
thisduck ec1c9ab
tinycolor does a much better job of telling dark/light. fixed gem/met…
thisduck acbca38
forgot to add tinycolor to the embed list.
thisduck 73fc932
fixing test for nodes.
thisduck 769a88d
fixing the code for frames with two parents.
thisduck 53d55f4
fixing additional case where the grandparents are different
thisduck 6a5e6af
Merge branch 'fix_node_with_different_parents' of github.com:thisduck…
thisduck 9ad7537
no longer need to correct data via javascript.
thisduck 8d4a6ee
saving space by creating a frames array for reference.
thisduck 058ece4
more performance improvements and a few bug fixes.
thisduck 263db78
fix colouring for same method name across gems.
thisduck febf799
sql display and sort.
thisduck 527bd65
Reset line-height so the method names don't hide.
thisduck 88d6310
Renaming SQLRecorder to Runner
thisduck cea7b98
refactor sql recorder.
thisduck 783f398
adding the tablesort js files to source.
thisduck 93b104f
profile object instead of wall time, (avoids profiling GC, etc)
thisduck f42d300
only load sql tracer if ActiveRecord has already been loaded and exists.
thisduck 9456274
explicitly requre newrelic.
thisduck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -17,3 +17,5 @@ test/version_tmp | |
| tmp | ||
| *.swp | ||
| demo/graph.html | ||
|
|
||
| tags | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,96 @@ | ||
| require 'active_record/connection_adapters/abstract/database_statements' | ||
| require 'newrelic_rpm' | ||
|
|
||
| module Flamegraph | ||
| class SQLRunner # :nodoc: | ||
| attr_reader :sql | ||
| def initialize(sql) | ||
| @sql = sql | ||
| end | ||
|
|
||
| def self.run(sql, function) | ||
| instance = new(sql) | ||
| instance.run(function) | ||
| end | ||
|
|
||
| def run(function) | ||
| if Thread.current[:sql_flame] | ||
| recorder.send method_name, function | ||
| else | ||
| function.call | ||
| end | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def method_name | ||
| @method_name ||= | ||
| begin | ||
| sql_statement = sql.respond_to?(:to_sql) ? sql.to_sql : sql | ||
| obfuscated_sql = NewRelic::Agent::Database.obfuscate_sql(sql_statement) | ||
| ascii_sql = obfuscated_sql.gsub(/[^A-Za-z0-9]/) { |s| '_a' + s.ord.to_s } | ||
| "sql_flame_#{ascii_sql}" | ||
| end | ||
| end | ||
|
|
||
| def recorder | ||
| Flamegraph::SQLRecorder.instance method_name | ||
| end | ||
| end | ||
|
|
||
| class SQLRecorder # :nodoc: | ||
| def self.instance(method_name) | ||
| # filename is on its own so that it is not filtered as part of the flamegraph gem. | ||
| class_eval <<-CODE, 'sql_recorder.rb', __LINE__ + 1 | ||
| def #{method_name}(function) | ||
| function.call | ||
| end | ||
| CODE | ||
|
|
||
| new | ||
| end | ||
| end | ||
| end | ||
|
|
||
| module ActiveRecord | ||
| module ConnectionAdapters # :nodoc: | ||
| module DatabaseStatements # :nodoc: | ||
|
|
||
| def insert_with_flame(arel, name = nil, pk = nil, id_value = nil, sequence_name = nil, binds = []) | ||
| function = lambda do | ||
| insert_without_flame(arel, name, pk, id_value, sequence_name, binds) | ||
| end | ||
|
|
||
| Flamegraph::SQLRunner.run(arel, function) | ||
| end | ||
| alias_method_chain :insert, :flame | ||
|
|
||
| def update_with_flame(arel, name = nil, binds = []) | ||
| function = lambda do | ||
| update_without_flame(arel, name, binds) | ||
| end | ||
|
|
||
| Flamegraph::SQLRunner.run(arel, function) | ||
| end | ||
| alias_method_chain :update, :flame | ||
|
|
||
| def delete_with_flame(arel, name = nil, binds = []) | ||
| function = lambda do | ||
| delete_without_flame(arel, name, binds) | ||
| end | ||
|
|
||
| Flamegraph::SQLRunner.run(arel, function) | ||
| end | ||
| alias_method_chain :delete, :flame | ||
|
|
||
| def select_with_flame(sql, name = nil, binds = []) | ||
| function = lambda do | ||
| select_without_flame(sql, name, binds) | ||
| end | ||
|
|
||
| Flamegraph::SQLRunner.run(sql, function) | ||
| end | ||
| alias_method_chain :select, :flame | ||
| end | ||
| end | ||
| end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing
optshere because I added javascript based filters. So that the page can have default filters as it loads up.