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

Added new debug feature: Performance Monitor. #1019

Merged
merged 9 commits into from
Dec 6, 2021
Merged

Added new debug feature: Performance Monitor. #1019

merged 9 commits into from
Dec 6, 2021

Conversation

UnrealKaraulov
Copy link
Contributor

@UnrealKaraulov UnrealKaraulov commented Dec 1, 2021

Description:
This is new feature for plugins debugging.
Search big performance issues for any plugin that in debug mode. No server slow down!
Output is plugin and function name, and server execution lag in ms. Output target: current amxlog file.

Copy link
Member

@dvander dvander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea and I'd be happy to take this, with a few minor changes.

amxmodx/amx.cpp Outdated Show resolved Hide resolved
amxmodx/amx.cpp Outdated Show resolved Hide resolved
amxmodx/amx.cpp Outdated Show resolved Hide resolved
amxmodx/amx.cpp Outdated Show resolved Hide resolved
Search big performance issues for any plugin that in debug mode. No server slow down.
Output is plugin and function name, and server execution lag in ms. Output target: current amxlog file.
@UnrealKaraulov
Copy link
Contributor Author

  • Added cvar amx_perflog (0 for disable this feature)
  • Enabled for every plugin if amx_debug is 2. (Even if plugin without debug support)

5cb6fa0

@UnrealKaraulov
Copy link
Contributor Author

UnrealKaraulov commented Dec 2, 2021

@dvander, thanks for help
Maybe something is missing? ( any suggestions ? )

@ShootingKing-AM
Copy link
Contributor

On which platforms did you test this ?

amxmodx/amx.cpp Outdated Show resolved Hide resolved
amxmodx/amx.cpp Outdated Show resolved Hide resolved
amxmodx/amx.cpp Outdated
@@ -4173,3 +4173,43 @@ int AMXAPI amx_GetStringOld(char *dest,const cell *source,int use_wchar)
dest[len]='\0'; /* store terminator */
return AMX_ERR_NONE;
}


#include <chrono>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it allowed to use STL instead of AMTL in amxmodx?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WPMGPRoSToTeMa yes possible in future need add clocks to AMTL and then use it in AMXMODX. I did not attach importance to your message until I ran with this issue: #1026

amxmodx/amx.cpp Outdated Show resolved Hide resolved
amxmodx/meta_api.cpp Outdated Show resolved Hide resolved
amxmodx/modules.cpp Outdated Show resolved Hide resolved
@UnrealKaraulov
Copy link
Contributor Author

UnrealKaraulov commented Dec 3, 2021

On which platforms did you test this ?

On Windows but I think < chrono > is portabled and can be used at any other OS.

@UnrealKaraulov UnrealKaraulov changed the title Adding new feature: Performance Monitor. Added new debug feature: Performance Monitor. Dec 5, 2021
@ShootingKing-AM
Copy link
Contributor

On which platforms did you test this ?

On Windows but I think < chrono > is portabled and can be used at any other OS.

Authors are usually tasked with testing their code cross-platform. Maybe you can or someone can test the code on linux. Assuming it will work is not really a good practice, imo.

@dvander can allow the this workflow to run now so that we can check if there are some compile time errors cross-platform and cross-toolkit.

@dvander
Copy link
Member

dvander commented Dec 5, 2021

Stuff in std:: is by definition portable.

Copy link
Member

@dvander dvander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few more minor comments.

amxmodx/amx.cpp Outdated Show resolved Hide resolved
amxmodx/amx.cpp Outdated Show resolved Hide resolved
amxmodx/modules.cpp Outdated Show resolved Hide resolved
@dvander dvander merged commit 8ee3da2 into alliedmodders:master Dec 6, 2021
@dvander
Copy link
Member

dvander commented Dec 6, 2021

Thanks, merged.

@UnrealKaraulov
Copy link
Contributor Author

@dvander, thanks

@justgo97
Copy link
Contributor

justgo97 commented Jul 2, 2022

How to disable performance monitor logs?

@UnrealKaraulov
Copy link
Contributor Author

How to disable performance monitor logs?

impossible without this pull request : #1028

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

Successfully merging this pull request may close these issues.

5 participants