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

Fixes #9203: rudder_logger is too complex #464

Merged

Conversation

ncharles
Copy link
Member

@ncharles ncharles commented Oct 3, 2016

@ncharles
Copy link
Member Author

ncharles commented Oct 3, 2016

Do not merge, this is for feedback only

@ncharles
Copy link
Member Author

ncharles commented Oct 3, 2016

One interesting value, for 77 reports in ncf, there is a gain of nearly half a second in the output

@ncharles
Copy link
Member Author

ncharles commented Oct 3, 2016

ha, code is not working anymore :)

@ncharles
Copy link
Member Author

ncharles commented Oct 3, 2016

ok, the gain is naught ...

@ncharles ncharles force-pushed the bug_9203/rudder_logger_is_too_complex branch from 6a45810 to c306e01 Compare October 3, 2016 15:45
@ncharles
Copy link
Member Author

ncharles commented Oct 3, 2016

After trying to optimize the code further by not writing two files, i failed to obtain any gain compared to this implementation (which is more readable)

@ncharles
Copy link
Member Author

This is ready for review

classes => classes_generic("logger_rudder_temp_resfile");

# 3/ Write the final expected reports, expanded. First, empty it, then fill it
# (can't use edit_default empty, as we are iterating over a list)
!final_resfile_exists.logger_rudder_temp_resfile_repaired.!logger_rudder_final_resfile_repaired.keys_defined::
"${expected_reports_file}"
Copy link
Member

Choose a reason for hiding this comment

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

We need to remove the file in case there is already one from a previous run with the same PID.

Copy link
Member Author

Choose a reason for hiding this comment

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

by construction, the old file will be overwritten: if tmp file has been repaired, and expected_reports_file hasn't been repaired, then the expected_reports_file will be recreated
Ha, edit_defaults no_backup doesn't clean the file, i'm updating the PR

@ncharles ncharles force-pushed the bug_9203/rudder_logger_is_too_complex branch from f84e44a to aeb8ceb Compare October 25, 2016 10:18
@ncharles
Copy link
Member Author

Commit modified

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/ncf/pull/464
-- Your faithful QA

edit_line => delete_lines_matching(".*");
logger_rudder_temp_resfile_repaired.!logger_rudder_final_resfile_repaired.keys_defined::
"${logger_rudder.expected_reports_file}"
delete => "tidy";
Copy link
Member Author

Choose a reason for hiding this comment

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

this is tidy without quote

@ncharles ncharles force-pushed the bug_9203/rudder_logger_is_too_complex branch from aeb8ceb to b72810f Compare October 25, 2016 10:40
@ncharles
Copy link
Member Author

Commit modified

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/ncf/pull/464
-- Your faithful QA

@ncharles
Copy link
Member Author

OK, merging this PR

@ncharles ncharles merged commit b72810f into Normation:v0.x Oct 25, 2016
@ncharles
Copy link
Member Author

OK, merging this PR

2 similar comments
@ncharles
Copy link
Member Author

OK, merging this PR

@ncharles
Copy link
Member Author

OK, merging this PR

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