38 Commits

Author SHA1 Message Date
PascalWithopf
29c9fb1f9a codestyle: reduce line length to 120
lines are still checked for a length of 125 because
these are just some of the lines
2017-12-21 17:09:32 +01:00
PascalWithopf
79de51e4fc codestyle: reduce max line length to 125 2017-12-20 16:16:57 +01:00
Rainer Gerhards
dd9b98986d core bugfix: inconsitent atomic fetch function interface
macro used unsigned, inline function int. This could lead to an unsigned
overflow if macro version was used. That could potentially lead to malfunction
on some platforms (not seen nor expected in practice, though).

Detected by clang UBSAN.
2017-12-15 09:28:05 +01:00
PascalWithopf
e485c5c5bc codestyle: shorten lines to max 130 chars 2017-11-15 09:04:42 +01:00
Rainer Gerhards
2a6ec450aa remove currently unnecessary code
Detected by Coverity scan, CID 185397
2017-11-09 19:11:51 +01:00
Rainer Gerhards
44c05ab8bc fix too long lines 2017-11-09 19:08:59 +01:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
Rainer Gerhards
448f16495c remove "inline" attribute from excessivly long functions 2016-10-26 11:50:15 +02:00
Rainer Gerhards
5e3b075d53 fix compiler warnings 2016-06-02 12:08:55 +02:00
Rainer Gerhards
236249b0f5 fix cosmetic leak: global dynstats stats counter not destructed on rsyslog shutdown 2016-04-25 17:42:52 +02:00
Janmejay Singh
f09a77cbe9 fixed an unused param issue identified by static-analyzer 2016-04-14 23:37:08 +05:30
Janmejay Singh
00b4d8152d minor cleanup, deleted some dead code 2016-04-14 22:57:12 +05:30
Janmejay Singh
583be11ccf fixed a few problems found by static-analyzer 2016-04-14 21:43:36 +05:30
Janmejay Singh
5f071af97f Fixed dyn-stats unused-metric-ttl bug which was was expected to garbage-collect accumulators that were unused for time-period >= ttl, but used to wipe all accumulators. This worked from memory-footprint and metric-life point-of-view, but used to reset accumulators even when they were configured to not be reset. Now it maintains survivor(shadow) table which keeps the accumulator value around from ttl up-to (2 * ttl) and reclaims it only if no dyn_inc call resurrects it by the end of this period. This allows us to resurrect surviving counters if they are used within ttl duration. This keeps a counter alive up-to (2 * ttl) in the worst case(late eviction) and ttl(timely eviction) in the best case. 2016-04-14 21:03:35 +05:30
Janmejay Singh
5d47513cf0 this makes dyn-stats resettable property independent of impstats resetCounters (which means when dyn-stats bucket is resettable, it will reset regardless of impstats being configured to resetCounters or not) 2016-03-31 16:16:03 +05:30
Janmejay Singh
95bde8dfa0 fixed a bunch of uchar vs. char incompatible-type-style problems found by travis static-analyzer 2016-03-31 01:33:25 +05:30
Janmejay Singh
90019a681a dyn-stats values are now reported (in json, json-es and cee formats) under a key "values" 2016-03-31 00:16:17 +05:30
Janmejay Singh
c66402598e Re-sync with dynstats recycle interval(as opposed to stats flush interval, which happens multiple-times per recycle). This was a bug in the way test was written. Introduced a new counter in dyn-stats subsystem which is incremented every time metrics in dyn-stats bucket are recycled. 2016-02-21 00:51:48 +05:30
Rainer Gerhards
a1f19889d7 add missing ASL 2.0 license header
author permission given in PR:
   https://github.com/rsyslog/rsyslog/pull/614
2016-02-01 08:31:26 +01:00
Janmejay Singh
54e6ac14fc rwlock attr does not try to setkind when environment does not have that function + fixed 2 minor problems identified by static-checking 2016-01-29 19:00:09 +05:30
Janmejay Singh
b5f65e5eb3 removed dependency on sys/queue.h, which does not exist on solaris 2016-01-29 00:45:35 +05:30
Janmejay Singh
b18aef99d0 switched to runtime/hashtable.h (because solaris does not have hsearch_r and other re-entrant friends) 2016-01-29 00:18:16 +05:30
Janmejay Singh
cc7450b389 silence false static-analysis alert 2016-01-28 20:00:11 +05:30
Janmejay Singh
45dd002f2a fixed warnings identified by static-error-checking 2016-01-28 19:55:30 +05:30
Rainer Gerhards
fe83332381 fix compiler warnings 2016-01-28 10:27:11 +01:00
Janmejay Singh
906b28850f use stats delimiter consistent with other parts of code (eg imudp, omkafka etc use ".", so switched from ":" to ".") 2016-01-18 19:29:44 +05:30
Janmejay Singh
06cb910621 fix corner-case that allows bucket-meta-metric with max-length to access 1 illegal byte 2015-11-23 15:54:35 +05:30
Janmejay Singh
905f36553b record dyn-metrics only if metrics are being gathered 2015-11-23 14:12:36 +05:30
Janmejay Singh
bcd259884f allow timely reset of metrics + use read-lock for reset-timeout calculation 2015-11-20 20:42:33 +05:30
Janmejay Singh
650f043d2c Fast-path for preventing thundering-herd with a fresh(empty) dyn-metric table, it ignores operations and reports it as a separate metric. 2015-11-18 15:49:22 +05:30
Janmejay Singh
d94abbf49f created a control to bump stats counter for batch-operations in one shot + some asthetic space->tab conversion 2015-11-17 16:16:24 +05:30
Janmejay Singh
0daa59c2fd check behavior of dyn-stats provided meta-counters 2015-11-17 15:09:33 +05:30
Janmejay Singh
d4d74a8188 provision 1.25x size for dynstats metrics hash-table 2015-11-16 16:55:05 +05:30
Janmejay Singh
33cb11db57 dynstats reset-of-accumulated-dyn-metric-names and more-metrics-than-expected flows fixed and tested 2015-11-16 16:43:51 +05:30
Janmejay Singh
e24c175cae - fixed vg-tests to actually check exit code
- fixed and excercised reset dyn-metrics-table flow (where dynamic-metric names are discarded. this excercises unusedMetricLife timer expiry.)
2015-11-13 20:59:07 +05:30
Janmejay Singh
6da7aeb975 - dynstats basic-test first-cut
- vg-test caught a minor issue in impstats (fixed)
- placeholder created for other dynstats tests
- a new assertion in diag.sh which allows extracting a particular column and expecting sum-up to match given value
- imdiag supports injecting litteral messages now (test can send a fully formed syslog message through imdiag, its a backward compatible change in protocol, allows for richer things to be build while being fully backward compatible)
2015-11-13 17:45:07 +05:30
Janmejay Singh
d05710971f some work towards clean-exit in failure senarios in dynstats 2015-11-10 12:54:38 +05:30
Janmejay Singh
59b46975bd dyn-stats (dynamic metric-name support) high-level impl sketch 2015-11-09 22:31:01 +05:30