-
Notifications
You must be signed in to change notification settings - Fork 12
Improve handling of ffmpeg output #87
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
base: develop
Are you sure you want to change the base?
Conversation
Hi there @gingerbreadassassin . Now regarding the topic about the In general the script heavily relies on ffmpeg reporting the I look forward to your thoughts on these suggestions. |
💯 it is
Agree the proper way to handle this would be a
This is the understanding of the benchmarking tool that I lacked, and why I opened the PR with what I had "working" for discussion. I wasn't sure how much this would affect the outcome of the benchmark. If I have time between work tomorrow, I'll give the more appropriate approach a shot. |
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 understand the need for a fix, however its not an option to just "ignore" that REQUIRED VALUES are sometimes straight up missing.
Additionaly this implementation is not ideal, as it introduces redundant value checking.
Also if the speed value is missing entirely, the issue will just continue to show up!
@@ -356,8 +356,8 @@ def benchmark(ffmpeg_cmd: str, debug_flag: bool, prog_bar, limit=0) -> tuple: | |||
result = { | |||
"max_streams": max_pass, | |||
"failure_reasons": failure_reason, | |||
"single_worker_speed": max_pass_run_data["speed"], | |||
"single_worker_rss_kb": max_pass_run_data["rss_kb"], | |||
"single_worker_speed": max_pass_run_data.get("speed", 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.
Sets speed to zero - The Client may try to downscale the ammount of workers, or not mark this run instantly as failed.
Additionaly, why is this access protected in core.py
? Shouldn't it be ALWAYS written to in worker.py
in the first place?
In fact, this PR already introduces the handling of this value in worker.py
- this is just duplicated code.
This should not be done this way.
Specifically the lack of this value indicates a greater issue.
The run should be marked as failed.
"single_worker_speed": max_pass_run_data["speed"], | ||
"single_worker_rss_kb": max_pass_run_data["rss_kb"], | ||
"single_worker_speed": max_pass_run_data.get("speed", 0), | ||
"single_worker_rss_kb": max_pass_run_data.get("rss_kb", 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.
Sets lasts run rss_kb to zero if not available - This has no effect on the runtime, but on the results.
Its just FALSE that the single worker_rss was zero.
Additionaly, why is this access protected in core.py
? Shouldn't it be ALWAYS written to in worker.py
in the first place?
Even though this does not introduce greater issues, the lack of this value indicates there are other issues to be solved.
@@ -122,6 +122,8 @@ def workMan(worker_count: int, ffmpeg_cmd: str, passed_logger: Logger) -> tuple: | |||
workrss = float( | |||
rssline[1].split("=")[-1].replace("kB", "").replace("KiB", "") | |||
) # maxrss | |||
else: | |||
workrss = 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.
Sets lasts run rss_kb to zero if not available - This has no effect on the runtime, but on the results.
Its just FALSE that the single worker_rss was zero - sure, WE know it, but the server does not when it tries to interpret the data.
Even though this does not introduce greater issues, the lack of this value indicates there are other issues to be solved.
speed = new_line[6].split("=")[-1].replace("x", "") | ||
if speed == "N/A": | ||
speed = 0 | ||
speeds.append(float(speed)) |
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.
What if the speed value doesnt exist at all instead of being written to with "N/A"?
Then converting to a float would not be possible.
Thats specifically the issue here.
Also its not clear what causes ffmpeg to not report this value.
Imo it points to other issues!
Anyways_
The results of ANY run that wasnt abled to gather valid result data from ffmpeg should NEVER be marked as healthy!
Having valid result data would indicate this!
Instead the run should be marked as unhealthy, by returning the failure.
My sincerest apologies if my last commit re-submitted a request for review; I should've marked this PR as a draft after our previous discussion |
Fixes:
If "speed" should be anything but 0, let's discuss.