Giter Club home page Giter Club logo

Comments (7)

evgeniy-r avatar evgeniy-r commented on August 25, 2024 2

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.

evgeniy-r avatar evgeniy-r commented on August 25, 2024 1

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.

dcaponi avatar dcaponi commented on August 25, 2024 1

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.

Neodelf avatar Neodelf commented on August 25, 2024

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.

Neodelf avatar Neodelf commented on August 25, 2024

@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.

Neodelf avatar Neodelf commented on August 25, 2024

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.

Neodelf avatar Neodelf commented on August 25, 2024

Metaprogramming tricks also will be shown if the line is executed

from lecter.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.