naver / scavenger

A runtime dead code analysis tool
Apache License 2.0
393 stars 40 forks source link

Add a simple http server for agent #106

Open MrDevitt opened 8 months ago

MrDevitt commented 8 months ago

I find it quiet difficult to deploy all these components. The realtime comparison between the code base and the invocation on a single host is enough for me to delete code. So I wrote a simple http server (com.sun.net.httpserver.HttpServer) to expose the results. In this way I only need to deploy the agent and get the dead methods by http. Would you like this feature? I'm happy to raise a PR.

taeyeon-Kim commented 8 months ago

This feature makes me quite careful about analyzing dead code. Basically, I think dead code becomes more reliable under the following conditions

  1. collecting data for a long time.
  2. for the various profiles in which the method is invoked.
  3. for every client the method is invoked on.

Therefore, I think your suggestions will be confusing for users.

Also, scavenger provides h2 profile to ease the inconvenience of I find it quiet difficult to deploy all these components..

What do you think, @sohyun-ku and @kojandy ?

MrDevitt commented 8 months ago

Indeed it is less reliable to detect dead code using only realtime data of a single host. But I consider the result to be the hint of dead code , eventually removing these code needs double check by the developers. Also the difficulty dose not only come from database. It's extremely troublesome (need a lot permissions) to start a new service in my department. I hope it can be a feature that turned off by default, and can be turned on by config file.

taeyeon-Kim commented 8 months ago

As you say, I agree that real-time data is a hint, but I also think that judgment of dead code by real-time data can be a point of failure.

Also the difficulty dose not only come from database. It's extremely troublesome (need a lot permissions) to start a new service in my department. I hope it can be a feature that turned off by default, and can be turned on by config file.

I think it would be very helpful if you could tell us things about permissions and configurations to add features. ( )