I haven’t gone through the specific source code. What I encountered before was that as long as a specific time is specified, it seems to scan all the slow log files (including those that have been archived). The default page also does this.
We have set the automatic analyze to run from 10 PM after closing to 8 AM before opening, and it does not run during business hours. Although we are also online, nighttime is not a peak business period, so we perform the automatic analyze at night. Of course, this should be configured according to the characteristics of your own business.