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 print_idcount command to print how many ids are currently used #111

Merged
merged 1 commit into from
Aug 1, 2019

Conversation

duralakun
Copy link
Collaborator

@duralakun duralakun commented Feb 21, 2019

This allows you type "print_idcount" into rcon console and the server prints how many entity ids are currently used.
We need this to better debug issues related to entity ids, like #109

The output will look like this:

IDCount: 53 - InPercent: 0%

Percent shows how many percent of all ids are currently used, if it reaches 100% it might crash

Copy link
Collaborator

@bretonium bretonium left a comment

Choose a reason for hiding this comment

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

As server administrator, i don't need this command. There is no way i can act as an administrator when i see something wrong with the output. I want this data only as a developer. Commands are there to help server administrators, not developers.

Could we please have this not as a command, but as a debug printout? Something like:

#ifdef DEBUG
Console()->print(get_number_of_ids());
#endif

This can happen every 10, 100 or 1000 tick.

@duralakun
Copy link
Collaborator Author

duralakun commented Feb 21, 2019

As server administrator, i don't need this command. There is no way i can act as an administrator when i see something wrong with the output.

As server administrator if you see the entity count is very high, you can restart the server and prevent a crash

@duralakun
Copy link
Collaborator Author

duralakun commented Feb 21, 2019

Could we please have this not as a command, but as a debug printout? Something like:

#ifdef DEBUG
Console()->print(get_number_of_ids());
#endif

This can happen every 10, 100 or 1000 tick.

Most of the time you dont want to see this, when debugging its also important that the console doesnt get spammed with unimportant information.

Could we please have this not as a command

This command does no harm, why dont you want to have more commands?

@duralakun
Copy link
Collaborator Author

duralakun commented Feb 21, 2019

With this command you can also check for id leaks better, for example:
you write "print_idcount"
then you place 2 scientist mines
write "print_idcount" again
then you die and write "print_idcount"
now you can compare the first number with the last, they should be the same

@bretonium
Copy link
Collaborator

bretonium commented Feb 21, 2019

As server administrator if you see the entity count is very high, you can restart the server and prevent a crash

As server administrator, i

  1. Do not monitor server state using administrative commands
  2. Will not restart the server even if i see high values

Most of the time you dont want to see this, when debugging its also important that the console doesnt get spammed with unimportant information.

Debug logs are always very verbose. It is ok and accepted in all projects. For example, because of debug, logs for the project i work on are 100+ mb daily. grep and search in less handle it just fine.

This command does no harm, why dont you want to have more commands?

Because this command has no value to an administrator. This is code-specific, developer-focused information. Information like this belongs to debug logs. We can add hundreds of "harmless" commands, none of which will be of any value to administrator.

With this command you also check for id leaks better, for example:
...
now you can compare the first number with the last, they should be the same

This is debugging of the game. Server administrators do not debug programs. Developers do. All the same information can be obtained from debugging logs.

@teoman002
Copy link
Collaborator

teoman002 commented Feb 21, 2019

Duralakun, I suggest to you to leave this feature as is, contrary to Breton I think it is very important to have a tool that show ID-Leaks.

However, please provide a debug output in the logfiles. I really look forward to see that. Make sure, the command is called after each round.

  • After each round ends, we will see if IdCount gets bigger
  • Also please add a tag to the debug output "Round end - "

@duralakun
Copy link
Collaborator Author

I thought about making it so that it outputs the id count in the terminal as soon as a wrong id crashes the server. But i dont want to do it anymore, you can use this pr or close it, idc anymore.

@teoman002 teoman002 added enhancement New feature or request incl. in dev This feature is already used in master_dev labels Feb 25, 2019
@teoman002 teoman002 merged commit 2067048 into master Aug 1, 2019
@teoman002 teoman002 deleted the print_idcount branch August 1, 2019 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request incl. in dev This feature is already used in master_dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants