-
Notifications
You must be signed in to change notification settings - Fork 7
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
Static functions not displaied #6
Comments
That is how the profiler operates, even in vanilla JS. it only loops through the prototype. any static functions need to be registered individually: |
Thank for clarification. Where would I put that line, I believe in the init function of the Profiler? And registerFn does not exists in this context, did you meant something else by any chance? |
I meant this... https://github.com/screepers/screeps-profiler/blob/master/screeps-profiler.js#L171-L180. if that is unavailable, then i suppose yall are using a different version. I would recommend including the original if youre having trouble with it. the readme's examples section has an example of it in the very bottom. and you would call it before you |
I did not install the screeps-profiler module. I only installed and followed the instructions from screeps-typescript-profiler, didn't expect would need the js variant as well. I thought this would be an alternative to the js variant. |
It seems like it's possible to get the static members from a class, so it seems they could also be picked up dynamically if the decorator is used on the class. https://stackoverflow.com/questions/33069692/getting-a-list-of-statics-on-an-es6-class Is it intentional to exclude them? If there isn't a desire not include them by default, it could be made conditional. @profile({includeStatic:true})
class MyClass {
public static doStuff: void {
// this would be profiled
}
} @profile
class MyClass {
public static doStuff: void {
// current behavior, not profiled
}
} |
@pyrodogg How hard would that be to add? Pretty much all of my code is static methods which makes this not so useful and I'd really love to be able to use it. |
I'll look at a PR early this week so it can be tested. |
Hello,
First of all, thank you for this profiler. It all works fine with the exception of static functions. I had a class with static functions but only after I converted them to non-static functions, they started to appear in the log.
The text was updated successfully, but these errors were encountered: