MiniProfiler / rack-mini-profiler

Profiler for your development and production Ruby rack apps.
MIT License
3.68k stars 400 forks source link

`alias_method': undefined method #610

Closed Justman100 closed 2 months ago

Justman100 commented 4 months ago

Hi, have this:

gems/rack-mini-profiler-3.3.1/lib/mini_profiler/profiling_methods.rb:87:in alias_method': undefined methodcall' for class `Redis::Client'

Justman100 commented 4 months ago

@nateberkopec @kbrock @SamSaffron

kbrock commented 4 months ago

this is a little confusing. profile_method uses alias_method I don't remember profiling redis methods. Also, thought alias_method was from core ruby's Module, so I'm not sure how this isn't found

@Justman100 could you include a little more of the stack trace? Did you call profile_method directly or was it called by another rack-mini-profiler method?

thanks

Justman100 commented 4 months ago

~this is a little confusing. profile_method uses alias_method~ I don't remember profiling redis methods. Also, thought alias_method was from core ruby's Module, so I'm not sure how this isn't found

@Justman100 could you include a little more of the stack trace? Did you call profile_method directly or was it called by another rack-mini-profiler method?

thanks

rack-mini-profiler calles the methode

grafik

One of the files, wich called the methode: .../vendor/bundle/ruby/3.2.0/gems/rack-mini-profiler-3.3.1/lib/mini_profiler/profiling_methods.rb

Justman100 commented 4 months ago

@kbrock

kbrock commented 4 months ago

@Justman100 Thought that was the case. Still unsure where in your code that is called from.

Are you calling counter_method directly or via your own meta-programming? Are you calling this inside the class, possible that the corresponding method has not been defined yet?

Justman100 commented 4 months ago

Maybe in this file: config/initializers/006-mini_profiler.rb:98? Discourse used this...

kbrock commented 4 months ago

The error is the call method is not defined. Which is correct as it was dropped in 5.0 of the redis client. This is an issue with discourse.

I put in more info and a fix over there:

https://github.com/discourse/discourse/pull/26104

kbrock commented 3 months ago

@Justman100 Can you provide the steps necessary to reproduce this error. Just providing a single line in a foreign project is not enough for others to debug the issue.

The nightly build of discourse is working fine. I tried making my proposed change but for some reason, that is failing.

I feel the discourse team would be better debugging their own application. Please close this issue and move the discussion over there.