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

Add backlog_wait_time_actual status field #93

Merged

Conversation

maxenglander
Copy link
Contributor

The status field backlog_wait_time_actual is available since
Linux 5.9. It reports the amount of time the kernel has spent
waiting for the backlog to drain with schedule_timeout.

@cla-checker-service
Copy link

cla-checker-service bot commented Oct 29, 2021

💚 CLA has been signed

@maxenglander maxenglander force-pushed the add-backlog-wait-time-actual-field branch from 13fe9c9 to 925b819 Compare October 29, 2021 13:34
@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 29, 2021

❕ Build Aborted

The PR is not allowed to run in the CI yet

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Reason: The PR is not allowed to run in the CI yet

  • Start Time: 2021-10-29T13:34:51.668+0000

  • Duration: 2 min 9 sec

  • Commit: 925b819

@andrewkroh andrewkroh requested a review from efd6 October 29, 2021 17:03
@andrewkroh
Copy link
Member

andrewkroh commented Oct 29, 2021

That will be a nice metric to have. Thanks @maxenglander

We need to ensure this continues to work with older kernels as well. @efd6 , can you look this over please.

@maxenglander
Copy link
Contributor Author

@andrewkroh happy to help out with testing. Let me know what kinds of tests you'd like to see. So far I've tested it on the Vagrant image provided in this repo:

vagrant@ubuntu-bionic:~$ uname -r
4.15.0-166-generic
vagrant@ubuntu-bionic:~$ mkdir ~/go/src/github.com/elastic/go-libaudittest
vagrant@ubuntu-bionic:~$ cd ~/go/src/github.com/elastic/go-libaudittest
vagrant@ubuntu-bionic:~/go/src/github.com/elastic/go-libaudittest$ cat <<EOF > main.go
package main

import (
        "fmt"

        libaudit "github.com/elastic/go-libaudit"
)

func main() {
        auditClient, err := libaudit.NewMulticastAuditClient(nil)
        if err != nil {
                fmt.Println("failed to create multicast audit client:", err.Error())
        }

        s, err := auditClient.GetStatus()
        if err != nil {
                fmt.Println("failed to get audit status:", err.Error())
        }

        fmt.Println("Audit status backlog:", s.Backlog)
        fmt.Println("Audit status backlog limit:", s.BacklogLimit)
        fmt.Println("Audit wait time actual:", s.BacklogWaitTimeActual)
}
EOF
vagrant@ubuntu-bionic:~/go/src/github.com/elastic/go-libaudittest$ go get
vagrant@ubuntu-bionic:~/go/src/github.com/elastic/go-libaudittest$ go build .
vagrant@ubuntu-bionic:~/go/src/github.com/elastic/go-libaudittest$ sudo ./go-libaudittest
Audit status backlog: 0
Audit status backlog limit: 64
Audit wait time actual: 0

@andrewkroh
Copy link
Member

After looking more closely at the implementation it should be safe to add the new field. Even the godoc on the GetStatus explains this.

@andrewkroh
Copy link
Member

/test

@andrewkroh
Copy link
Member

@maxenglander Will you please add an entry to the changlelog file in the root of the repo.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 11, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-01-11T08:20:29.338+0000

  • Duration: 3 min 43 sec

  • Commit: cfcd379

Test stats 🧪

Test Results
Failed 0
Passed 365
Skipped 40
Total 405

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

Apologies for the delay, there is probably a very confused @dan out there.

audit.go Outdated Show resolved Hide resolved
@andrewkroh
Copy link
Member

/test

@efd6
Copy link
Contributor

efd6 commented Jan 11, 2022

Failure appears to be due to renaming master => main (jenkins: stderr: fatal: Couldn't find remote ref refs/heads/master).

@andrewkroh
Copy link
Member

@Mergifyio rebase

@andrewkroh
Copy link
Member

It might not be watching this repo. In any case can you try rebasing this on main to see if that resolves the issue.

@maxenglander maxenglander force-pushed the add-backlog-wait-time-actual-field branch from 925b819 to fb767c5 Compare January 11, 2022 07:13
The status field backlog_wait_time_actual is available since
Linux 5.9. It reports the amount of time the kernel has spent
waiting for the backlog to drain with schedule_timeout.
@maxenglander maxenglander force-pushed the add-backlog-wait-time-actual-field branch from fb767c5 to cfcd379 Compare January 11, 2022 07:20
@maxenglander
Copy link
Contributor Author

@andrewkroh I re-committed on top of latest main, and added a comment in the CHANGELOG.

@efd6
Copy link
Contributor

efd6 commented Jan 11, 2022

/test

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

Thanks

@andrewkroh andrewkroh merged commit 8189891 into elastic:main Jan 11, 2022
renini pushed a commit to renini/go-libaudit that referenced this pull request Jun 26, 2024
The status field backlog_wait_time_actual is available since
Linux 5.9. It reports the amount of time the kernel has spent
waiting for the backlog to drain with schedule_timeout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants