Comments (7)
You can measure an execution time line-by-line and create some perfomance analyzing tool.
It can be a very simple alternative to New Relic (and other such services) - a free version of New Relic does not show a full trace (Transaction Breakdown in their terms).
from lecter.
It is necessary to measure timing for each application code segment, collect this data and show it in the report. Ruby has Benchmark module in the standard library - https://ruby-doc.org/stdlib-2.7.1/libdoc/benchmark/rdoc/Benchmark.html, it can be a starting point.
There are also several open source libraries with benchmark functionality and it may be useful to study them (e. g. https://github.com/schneems/derailed_benchmarks - I don't use it, just for example).
from lecter.
I had a question about how deep down a rabbit hole this would go? I see from the example it highlights LOC that get hit on the controller, but will it also show LOC from imported code? If my project uses #method_missing or some other meta programming tricks, would this show that or are there plans for that?
I ask because one of the problems I encounter on ruby projects is thinking I can delete some "dead code" only to find out its being invoked via some unclear code path or required by convention.
from lecter.
Now gem is working with Rails only. But I want to make it Rack-oriented. It leads to the gem can be used with non-Rails applications.
from lecter.
@evgeniy-r Thank you for the proposal! I like it.
Do you have any ideas about how we can implement it? Which way will be better and faster?
from lecter.
Yep, it could grab all executed code from all gems you have. In that case, there will so many lines and a request is stopped by a timeout error. So one of the next purposes is to define paths
(file) which could be added to trace. The comparison is happened in lib/lecter/trace_point.rb
The gem shows only executed code. It depends on parameters are passed.
It doesn't show you code that is "dead" in other classes which were not called in the request.
from lecter.
Metaprogramming tricks also will be shown if the line is executed
from lecter.
Related Issues (16)
- -> breaks the code formatting HOT 2
- Remove mount namespace from routes HOT 4
- Design
- Replace rest-client with smth HOT 3
- Add configuring inspecting files HOT 1
- Parameters as form
- Set up routes of inspecting files in form
- Using Zeitwerk to autoload code? HOT 1
- Remove rails dependency HOT 2
- Update summary
- Options (will be extended)
- Improve frontend performance on diagnosis page HOT 5
- Redirect from /lecter to /lecter/diagnosis/new HOT 3
- Add a headers parameter to the form
- Update README
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lecter.