Merge branch 'debug-job-progress' into calamares

This makes things fairly chatty, especially again during
rsync, so will be dialed back before release.
This commit is contained in:
Adriaan de Groot 2020-10-03 12:27:10 +02:00
commit ddf3b2d399

View File

@ -67,6 +67,15 @@ public:
{ {
m_overallQueueWeight = 1.0; m_overallQueueWeight = 1.0;
} }
cDebug() << "There are" << m_runningJobs->count() << "jobs, total weight" << m_overallQueueWeight;
int c = 0;
for ( const auto& j : *m_runningJobs )
{
cDebug() << Logger::SubEntry << "Job" << ( c + 1 ) << j.job->prettyName() << "+wt" << j.weight << "tot.wt"
<< ( j.cumulative + j.weight );
c++;
}
} }
void enqueue( int moduleWeight, const JobList& jobs ) void enqueue( int moduleWeight, const JobList& jobs )
@ -109,9 +118,9 @@ public:
} }
else else
{ {
emitProgress( 0.0 ); // 0% for *this job*
cDebug() << "Starting" << ( failureEncountered ? "EMERGENCY JOB" : "job" ) << jobitem.job->prettyName() cDebug() << "Starting" << ( failureEncountered ? "EMERGENCY JOB" : "job" ) << jobitem.job->prettyName()
<< '(' << ( m_jobIndex + 1 ) << '/' << m_runningJobs->count() << ')'; << '(' << ( m_jobIndex + 1 ) << '/' << m_runningJobs->count() << ')';
emitProgress( 0.0 ); // 0% for *this job*
connect( jobitem.job.data(), &Job::progress, this, &JobThread::emitProgress ); connect( jobitem.job.data(), &Job::progress, this, &JobThread::emitProgress );
auto result = jobitem.job->exec(); auto result = jobitem.job->exec();
if ( !failureEncountered && !result ) if ( !failureEncountered && !result )
@ -166,8 +175,14 @@ private:
if ( m_jobIndex < m_runningJobs->count() ) if ( m_jobIndex < m_runningJobs->count() )
{ {
const auto& jobitem = m_runningJobs->at( m_jobIndex ); const auto& jobitem = m_runningJobs->at( m_jobIndex );
cDebug() << "Job" << ( m_jobIndex + 1 ) << jobitem.job->prettyName() << "+wt" << jobitem.weight << "start.wt"
<< jobitem.cumulative;
progress = ( jobitem.cumulative + jobitem.weight * percentage ) / m_overallQueueWeight; progress = ( jobitem.cumulative + jobitem.weight * percentage ) / m_overallQueueWeight;
message = jobitem.job->prettyStatusMessage(); message = jobitem.job->prettyStatusMessage();
cDebug() << Logger::SubEntry << ( double( int( percentage * 1000 ) ) / 10.0 ) << "% +wt"
<< ( jobitem.weight * percentage ) << " completed.wt"
<< ( jobitem.cumulative + jobitem.weight * percentage ) << "tot %"
<< ( double( int( progress * 1000 ) ) / 10.0 );
} }
else else
{ {