setup-your-mac / Setup-Your-Mac

Setup Your Mac aims to simplify initial device configuration by leveraging swiftDialog and Jamf Pro Policy Custom Events to allow end-users to self-complete Mac setup post-enrollment.
https://snelson.us/sym
MIT License
249 stars 55 forks source link

Feature Request: Adding in install buffer to estimation times #77

Closed Eltord closed 1 year ago

Eltord commented 1 year ago

Problem:

Sometimes users look at the estimates for the download and go "well how come it says an estimated 2 minutes 20 seconds, but it took 15 minutes to complete?" Well, they aren't grasping that its download time and not install time being presented to them.

Solution:

Add in a buffer to the block of configuration variables that we can add in a set amount of seconds to apply to the estimates. Made it individual so to give full customizability if certain configurations take longer than others due to the packages being installed.

configurationInstallBuffer="480"     # Buffer time added to estimates to include installation time of packages, in seconds. Set to 0 to disable.

configurationOneInstallBuffer="480"     # Buffer time added to estimates to include installation time of packages, in seconds. Set to 0 to disable.

configurationTwoInstallBuffer="600"     # Buffer time added to estimates to include installation time of packages, in seconds. Set to 0 to disable. 

configurationThreeInstallBuffer="720"     # Buffer time added to estimates to include installation time of packages, in seconds. Set to 0 to disable.

configurationOneEstimatedSeconds=$( echo "scale=2; ((((( $configurationOneSize / $mbps ) * 60 ) * 60 ) * $correctionCoefficient ) + $configurationOneInstallBuffer)" | bc | sed 's/\.[0-9]*//' )

configurationTwoEstimatedSeconds=$( echo "scale=2; ((((( $configurationTwoSize / $mbps ) * 60 ) * 60 ) * $correctionCoefficient ) + $configurationTwoInstallBuffer)" | bc | sed 's/\.[0-9]*//' )

configurationThreeEstimatedSeconds=$( echo "scale=2; ((((( $configurationThreeSize / $mbps ) * 60 ) * 60 ) * $correctionCoefficient ) + $configurationThreeInstallBuffer)" | bc | sed 's/\.[0-9]*//' )

configurationCatchAllEstimatedSeconds=$( echo "scale=2; ((((() $configurationCatchAllSize / $mbps ) * 60 ) * 60 ) * $correctionCoefficient ) + configurationInstallBuffer)" | bc | sed 's/\.[0-9]*//' )

dan-snelson commented 1 year ago

Happy Thursday, @karatetrigger!

Thanks for the FR; please confirm that the already available correctionCoefficient does NOT meet your use-case.

Eltord commented 1 year ago

Howdy howdy @dan-snelson

It does not as the different configurations would at least require different "fudge factors" in my case, as the factor would need to increase with more packages requiring to be installed. Modifying the correctionCoefficient didn't seem to give me the results and times I was looking for across the board, so it felt easier to just after a few times running through it on a machine, get a good estimate of time it takes to run through the configuration, add that in seconds to the estimate, and gave a much better result.

Eltord commented 1 year ago

I did leave that in there in the math for the estimates in seconds, as even leaving it at 1.01 or slightly more, accounts for the smallest factors in kbps download speeds, but in total it did not answer the full problem it was trying to solve.

dan-snelson commented 1 year ago

Thanks for the additional information.

dan-snelson commented 1 year ago

Thanks again, @Eltord!

dan-snelson commented 1 year ago

Addressed in Setup Your Mac 1.12.0.