Commit Graph

41 Commits

Author SHA1 Message Date
Yonas Habteab 834709543a ApplyRule: Make `m_HasMatches` atomic
This prevents the `m_HasMatches` property from being altered simultaneously.
This might seem harmless (since this property can only be set to true by any calling thread),
however, from a technical (C++) point of view, this constitutes a data race.
2022-11-28 14:13:58 +01:00
Julian Brost a958a735d7
Merge pull request #9555 from Icinga/ApplyRule-GetDebugInfo
ApplyRule#GetDebugInfo(): return by const ref to avoid malloc()
2022-11-16 13:35:04 +01:00
Alexander A. Klimov e97a5d59e0 ApplyRule#GetFVVar(): return by const ref
to avoid malloc().
2022-11-08 12:48:13 +01:00
Alexander A. Klimov 738662338f ApplyRule#GetFKVar(): return by const ref
to avoid malloc().
2022-11-08 12:45:21 +01:00
Yonas Habteab 2610fb1285 Avoid evaluating the same filter twice for the same target 2022-11-04 10:15:22 +01:00
Alexander A. Klimov 27a559c5fe ApplyRule#GetDebugInfo(): return by const ref to avoid malloc() 2022-10-28 15:33:44 +02:00
Alexander A. Klimov a698b9c3da ApplyRule::RuleMap: reduce complexity, save unnecessary lookups 2022-10-28 14:27:53 +02:00
Alexander A. Klimov 038a5e8ef6 Unify storages of regular/targeted apply rules: std::vector<ApplyRule::Ptr> 2022-10-28 14:27:53 +02:00
Alexander A. Klimov a56ad38ad3 Separately handle apply rules targetting only specific parent objects
not to unnecessarily run e.g. the filter assign where host.name=="example.com"
for all hosts being not example.com.
2022-10-28 14:27:53 +02:00
Alexander A. Klimov 449a3c14cf Allow intrusive pointers to ApplyRule 2022-10-21 10:28:41 +02:00
Alexander A. Klimov c7d656716f Remove unused ApplyRule#m_TargetType 2022-10-19 13:43:51 +02:00
Alexander A. Klimov d468d7993c Lookup apply rules faster by Type*, not String and by map instead of ==/!=
1. The lookup of apply rules per source type now implies
   no String(const char*) (no malloc()) and just pointer (uint64) comparisions
2. Apply rules are now also grouped by target type via a nested map, that obsoletes
   checking the target type while iterating over all rules per source type
2022-10-19 13:43:51 +02:00
Alexander A. Klimov 90fe4e5bea ApplyRule::GetTargetTypes(): return by const ref not to malloc() 2022-10-19 13:43:51 +02:00
Alexander A. Klimov aa4cad7482 Replace std::shared_ptr<Expression> with Expression::Ptr
refs #7361
2019-10-21 17:10:51 +02:00
Michael Friedrich d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich 85e161ea1e Silence config compiler logging for runtime created objects
This is especially problematic with many single creation requests,
e.g. many downtimes created via Icinga Web 2 & the REST API.

In addition to the config compiler messages, apply rule matches are
also in there which are removed by this patch.
2018-10-09 16:41:17 +02:00
Gunnar Beutner 621eed3f13 Apply clang-tidy fix 'modernize-pass-by-value' 2018-01-04 12:24:57 +01:00
Gunnar Beutner ac155d1dda Apply clang-tidy fix 'modernize-redundant-void-arg' 2018-01-04 12:24:57 +01:00
Gunnar Beutner 90496b5456 Build libraries as static libraries 2018-01-02 23:29:48 +01:00
Michael Insel 158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Jean Flach 2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00
Gunnar Beutner 6d09efc907 Use std::shared_ptr instead of boost::shared_ptr 2017-11-30 17:41:00 +01:00
Gunnar Beutner 858873b940 Replace boost::bind/boost::function with std::bind/std::function 2017-11-27 15:15:11 +01:00
Michael Friedrich b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Gunnar Beutner ce7b6e4f87 Remove unused method: ApplyRule::DiscardRules
fixes #12544
2016-08-25 10:21:14 +02:00
Gunnar Beutner 599929b0f6 Update copyright headers for 2016 2016-01-12 08:29:59 +01:00
Gunnar Beutner 8136cda367 Implement the ignore_on_error keyword
fixes #9960
2015-10-05 12:44:11 +02:00
Michael Friedrich da83bae660 Rename config/modules to config/packages
fixes #9953
2015-09-01 20:09:04 +02:00
Michael Friedrich 0f5287c2b1 Add module attribute for ConfigObject and set its origin
fixes #9852
2015-08-17 16:08:57 +02:00
Michael Friedrich 78bfd0204c Update copyright year 2015-01-22 12:00:23 +01:00
Gunnar Beutner cfd775c948 Move the VMFrame class to libbase
refs #8065
2014-12-12 15:33:56 +01:00
Gunnar Beutner f5766f9118 Refactor the stack frame handling for scripts
fixes #7748
2014-11-22 19:24:03 +01:00
Gunnar Beutner 0078e00c13 Refactor apply/object rules
fixes #7700
2014-11-20 21:29:50 +01:00
Gunnar Beutner ec109b04dd Refactor the AST
refs #7622
2014-11-10 12:06:25 +01:00
Gunnar Beutner e1c95d4fa0 Improve config compiler's memory usage 2014-11-08 13:21:51 +01:00
Gunnar Beutner a1c905bf62 Implement dictionary support for apply+for
fixes #7561
2014-11-04 11:02:10 +01:00
Gunnar Beutner 4677014b6d Implement support for arrays in custom variables
fixes #6544
2014-11-02 07:27:50 +01:00
Gunnar Beutner feeb550654 Rename AExpression to Expression 2014-10-16 17:44:06 +02:00
Gunnar Beutner 308ba45102 Improve error message for duplicate objects
refs #6070
2014-09-09 14:49:21 +02:00
Gunnar Beutner 632026cd9f Rename C++ header files.
Fixes #6291
2014-05-25 16:27:14 +02:00