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

Incorrect calculation of "Last agent run time" check #703

NeilWinder opened this issue Aug 27, 2019 · 0 comments


Copy link

commented Aug 27, 2019

#698 Bug Report
In the last check of Agent.Tests.ps1 the average run_duration is being correctly converted from the run_duration format of HHMMSS, but then the average is compared to the raw run_duration.

General Troubleshooting steps

Example: My average run_duration is 1071 seconds. The run_duration for the last job shows 1703 (17:03) so the check fails. Converting 1703 to seconds ((17*60) + 3) yields 1023 which would pass.

Changing this line:
jh.run_duration AS Duration

to this:
DATEDIFF(SECOND, 0, STUFF(STUFF(RIGHT('000000' + CONVERT(VARCHAR(6),jh.run_duration),6),5,0,':'),3,0,':')) AS Duration

resolves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.