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
7.0.x backport: Fix stats missing for non workers #10742
Conversation
Commit b8b8aa6 used tm_name of the first StatsRecord of a thread block as key for the "threads" object. However, depending on the type of thread, tm_name can be NULL and would result in no entry being included for that thread at all. This caused non-worker metrics to vanish from the "threads" object in the dump-counters output. This patch fixes this by remembering the first occurrence of a valid tm_name within the per-thread block and adds another unittest to cover this scenario. (cherry picked from commit f172041)
New suricata-verify test listens on loopback interface, resulting in the capture and in_iface fields in the stats and event objects. (cherry picked from commit f9cf87a)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main-7.0.x #10742 +/- ##
==============================================
+ Coverage 82.51% 82.95% +0.43%
==============================================
Files 976 976
Lines 275061 275110 +49
==============================================
+ Hits 226979 228212 +1233
+ Misses 48082 46898 -1184
Flags with carried forward coverage won't be shown. Click here to find out more. |
Information: ERROR: QA failed on SURI_TLPW2_autofp_suri_time.
Pipeline 19894 |
Oops, this did not run expected an underscore instead of a space cf https://github.com/OISF/suricata/actions/runs/8498850137/job/23279007982?pr=10742
|
Re-run it to use the right sv PR. |
@@ -23,7 +23,7 @@ | |||
|
|||
static int OutputJsonStatsTest01(void) | |||
{ | |||
StatsRecord global_records[] = { { 0 }, { 0 } }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing for convention with the terms/names used in OutputJsonStatsTest02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest a rebase to get green CI and use of the right SV PR from the start
Continued in #10848 |
Continuation of #10717
7.0.x backport of #10583
Follow up for: https://redmine.openinfosecfoundation.org/issues/6907
Describe changes:
Commit b8b8aa6 used tm_name of the first StatsRecord of a thread block as key for the "threads" object. However, depending on the type of thread, tm_name can be NULL and would result in no entry being included for that thread at all. This caused non-worker metrics to vanish from the "threads" object in the dump-counters output.
This patch fixes this by remembering the first occurrence of a valid tm_name within the per-thread block and adds another unittest to cover this scenario.
Update:
Provide values to any of the below to override the defaults.
To use a pull request use a branch name like
pr/N
whereN
is thepull request number.
Alternatively,
SV_BRANCH
may also be a link to anOISF/suricata-verify pull-request.
SV_BRANCH=pr/1686