Skip to content
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

Provide a way to filter operations and get duration #97

Open
Monabr opened this issue Dec 6, 2023 · 8 comments
Open

Provide a way to filter operations and get duration #97

Monabr opened this issue Dec 6, 2023 · 8 comments

Comments

@Monabr
Copy link

Monabr commented Dec 6, 2023

Hello.

I want to use a profiler to measure how long each of the methods in my application takes. I measured it and made a trace, but there are a lot of system calls in it. How can I make it show only my methods and the time for them? I need a list of my methods from different threads because there are a lot of coroutines running.

@Grigory-Rylov
Copy link
Owner

Hello! Do I understand correctly that you want to generate a flat list in a text file containing the names of the methods corresponding to some filter and the duration of the methods? Did you want it for selected thread or all threads? If so, I've made something similar before and will try to make that kind report.

@Monabr
Copy link
Author

Monabr commented Dec 8, 2023

@Grigory-Rylov I have a business logic with 200+ methods. I want to optimize the calculations, but to do this I either need to manually put all the logs or use a profiler. The problem is, there are 20+ different threads running. In the android studio profiler, I collect them into one selection and go to the "BottomUp" tab. There is a search there, but when I enter the name of my package, it gives me a lot of library methods, such as run, park, runWorker, etc., which clutters the list and does not allow me to properly analyze which longest method I should start with, so I'm searching tools to solve the problem.

Having stumbled upon your library, I did not find such functionality and would really like to get it.

@Grigory-Rylov
Copy link
Owner

Grigory-Rylov commented Dec 8, 2023

@Monabr for now you can use custom color highlighting for your methods in Call chart and Flame char (View -> Show highlighting settings, add color relation for your package filter).

And then you can open Flame chart and look for your methods (read more about flame chart in https://developer.android.com/studio/profile/inspect-traces)

@Monabr
Copy link
Author

Monabr commented Dec 8, 2023

@Grigory-Rylov I think you didn't fully understand me. I think I don’t need a diagram, plus it shows the diagram for each thread separately, but I need it for all of them together. I don't have problems with rendering, I have a need to measure the duration of the methods. The diagram is also inconvenient for this purpose in my opinion.

@Grigory-Rylov
Copy link
Owner

@Monabr what you expect to receive in report, when, for example, you have next code:
'''
class Foo{

fun main() {
a()
}

fun a() {
b()
}

fun b() {
c()
}

fun c() {}

}
'''
?

@Monabr
Copy link
Author

Monabr commented Dec 8, 2023

name                           | duration
--------------------------------------------
- main()                       | 100s
-- a()                         | 100s
--- b()                        | 100s  
---- c()                       | 100s

@Grigory-Rylov This is what I would like to get based on your example.

@blue4sky
Copy link

Hi - are there any updates on this? I also have the same needs as @Monabr (measuring how long each of the methods in my application takes)

@Grigory-Rylov
Copy link
Owner

Hi - are there any updates on this? I also have the same needs as @Monabr (measuring how long each of the methods in my application takes)

Hello! Sorry, I was busy as a bee) I' ll try to make that ability due to several days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants