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

investigate benefits of inotifywait for video recording waiters #370

Closed
vdelendik opened this issue Mar 19, 2024 · 2 comments
Closed

investigate benefits of inotifywait for video recording waiters #370

vdelendik opened this issue Mar 19, 2024 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@vdelendik
Copy link
Contributor

https://unix.stackexchange.com/questions/185283/how-do-i-wait-for-a-file-in-the-shell-script
until we migrate to the independent recorder container we could inject files creation on session startup inside appium log. Using inotifywait we could detect session startup effectively without sleeps and log file grep which use CPU...

the same about video recording finish, just wait until recording stop file appear and generate it by appium on finally when session destroyed, deleted, timed out etc.

@vdelendik vdelendik added the enhancement New feature or request label Mar 19, 2024
@vdelendik vdelendik added this to the 2.1 milestone Mar 19, 2024
@vdelendik
Copy link
Contributor Author

notifywait vs while + sleep performance:

while :; do
  [ -f /opt/.stopped-ffmpeg-1234 ]
  sleep 0.1
done
\/\/\/
alpine:3.19.1 / while + sleep 0.1 / 100 threads

CONTAINER ID   NAME      **CPU %**     MEM USAGE / LIMIT     MEM %     NET I/O     BLOCK I/O    PIDS
2b6e9b37d557   testc     **160.06%**   47.55MiB / 31.07GiB   0.15%     876B / 0B   0B / 4.1kB   202
---
inotifywait -e create,moved_to,attrib --include '/opt/.stopped-ffmpeg-1234' -qq /tmp 
\/\/\/
alpine:3.19.1 / inotifywait / 100 threads

CONTAINER ID   NAME      **CPU %**     MEM USAGE / LIMIT     MEM %     NET I/O       BLOCK I/O     PIDS
60a92a2767ca   testc     **0.00%**     50.07MiB / 31.07GiB   0.16%     1.09kB / 0B   0B / 8.19kB   202
---
while :; do
  [ -f /opt/.stopped-ffmpeg-1234 ]
done
\/\/\/
alpine:3.19.1 / while / 100 threads


CONTAINER ID   NAME      **CPU %**     MEM USAGE / LIMIT     MEM %     NET I/O     BLOCK I/O    PIDS
1b19a34350b1   testc     **843.22%**   32.93MiB / 31.07GiB   0.10%     946B / 0B   0B / 4.1kB   102

confirmed inotifywait is much more efficient

@vdelendik
Copy link
Contributor Author

closing as actual implementation tracked by #377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

1 participant