FACT++  1.0
void FactGui::handleLoggerStats ( const DimData d)
inlineprivate

Definition at line 495 of file FactGui.h.

References DimData::ptr(), and DimData::size().

Referenced by infoHandler().

496  {
497  const bool connected = d.size()!=0;
498 
499  fLoggerET->setEnabled(connected);
500  fLoggerRate->setEnabled(connected);
501  fLoggerWritten->setEnabled(connected);
502  fLoggerFreeSpace->setEnabled(connected);
503  fLoggerSpaceLeft->setEnabled(connected);
504 
505  fFreeSpaceLogger = UINT64_MAX;
507 
508  if (!connected)
509  return;
510 
511  const uint64_t *vals = d.ptr<uint64_t>();
512 
513  const size_t space = vals[0];
514  const size_t written = vals[1];
515  const size_t rate = float(vals[2])/vals[3];
516 
517  fFreeSpaceLogger = space;
519 
520  fLoggerFreeSpace->setSuffix(" MB");
521  fLoggerFreeSpace->setDecimals(0);
522  fLoggerFreeSpace->setValue(space*1e-6);
523 
524  if (space> 1000000) // > 1GB
525  {
526  fLoggerFreeSpace->setSuffix(" GB");
527  fLoggerFreeSpace->setDecimals(2);
528  fLoggerFreeSpace->setValue(space*1e-9);
529  }
530  if (space>= 3000000) // >= 3GB
531  {
532  fLoggerFreeSpace->setSuffix(" GB");
533  fLoggerFreeSpace->setDecimals(1);
534  fLoggerFreeSpace->setValue(space*1e-9);
535  }
536  if (space>=100000000) // >= 100GB
537  {
538  fLoggerFreeSpace->setSuffix(" GB");
539  fLoggerFreeSpace->setDecimals(0);
540  fLoggerFreeSpace->setValue(space*1e-9);
541  }
542 
543  fLoggerET->setTime(QTime().addSecs(rate>0?space/rate:0));
544  fLoggerRate->setValue(rate*1e-3); // kB/s
545  fLoggerWritten->setValue(written*1e-6);
546 
547  fLoggerRate->setSuffix(" kB/s");
548  fLoggerRate->setDecimals(2);
549  fLoggerRate->setValue(rate);
550  if (rate> 2) // > 2kB/s
551  {
552  fLoggerRate->setSuffix(" kB/s");
553  fLoggerRate->setDecimals(1);
554  fLoggerRate->setValue(rate);
555  }
556  if (rate>=100) // >100kB/s
557  {
558  fLoggerRate->setSuffix(" kB/s");
559  fLoggerRate->setDecimals(0);
560  fLoggerRate->setValue(rate);
561  }
562  if (rate>=1000) // >100kB/s
563  {
564  fLoggerRate->setSuffix(" MB/s");
565  fLoggerRate->setDecimals(2);
566  fLoggerRate->setValue(rate*1e-3);
567  }
568  if (rate>=10000) // >1MB/s
569  {
570  fLoggerRate->setSuffix(" MB/s");
571  fLoggerRate->setDecimals(1);
572  fLoggerRate->setValue(rate*1e-3);
573  }
574  if (rate>=100000) // >10MB/s
575  {
576  fLoggerRate->setSuffix(" MB/s");
577  fLoggerRate->setDecimals(0);
578  fLoggerRate->setValue(rate*1e-3);
579  }
580 
581  if (space/1000000>static_cast<size_t>(fLoggerSpaceLeft->maximum()))
582  fLoggerSpaceLeft->setValue(fLoggerSpaceLeft->maximum()); // GB
583  else
584  fLoggerSpaceLeft->setValue(space/1000000); // MB
585  }
size_t size() const
Definition: DimData.h:39
void UpdateGlobalStatus()
Definition: FactGui.h:445
uint64_t fFreeSpaceLogger
Definition: FactGui.h:493
const T * ptr(uint32_t offset=0) const
Definition: DimData.h:32

+ Here is the call graph for this function:

+ Here is the caller graph for this function: