fix frozen and metric for checking iteration
This commit is contained in:
parent
a656d0a9f4
commit
bb69a59794
|
@ -14,7 +14,7 @@
|
||||||
#define WORSE_HOURS 19200 //mark drive if at this limit or beyond
|
#define WORSE_HOURS 19200 //mark drive if at this limit or beyond
|
||||||
#define WORSE_POWERUP 10000 //mark drive if at this limit or beyond
|
#define WORSE_POWERUP 10000 //mark drive if at this limit or beyond
|
||||||
#define SHRED_ITERATIONS 3U
|
#define SHRED_ITERATIONS 3U
|
||||||
#define FROZEN_TIMEOUT 10 //After this timeout (minutes) the drive will be marked as frozen
|
#define FROZEN_TIMEOUT 20 //After this timeout (minutes) the drive will be marked as frozen
|
||||||
#define METRIC_THRESHOLD 3L*1000L*1000L*1000L //calc shred speed with this minimum of time delta
|
#define METRIC_THRESHOLD 3L*1000L*1000L*1000L //calc shred speed with this minimum of time delta
|
||||||
|
|
||||||
// Logger Settings
|
// Logger Settings
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
//#define DEMO_DRIVE_SIZE 1024*1024*256L // 256MB
|
//#define DEMO_DRIVE_SIZE 1024*1024*256L // 256MB
|
||||||
//#define DEMO_DRIVE_SIZE 1024*1024*1024L // 1GB
|
//#define DEMO_DRIVE_SIZE 1024*1024*1024L // 1GB
|
||||||
|
//#define DEMO_DRIVE_SIZE 5*1024*1024*1024L // 5GB
|
||||||
//#define DEMO_DRIVE_SIZE 1024*1024*1024*10L // 10GB
|
//#define DEMO_DRIVE_SIZE 1024*1024*1024*10L // 10GB
|
||||||
|
|
||||||
typedef int fileDescriptor;
|
typedef int fileDescriptor;
|
||||||
|
|
|
@ -167,7 +167,7 @@ void Drive::checkFrozenDrive(void)
|
||||||
time_t u32localtime;
|
time_t u32localtime;
|
||||||
time(&u32localtime);
|
time(&u32localtime);
|
||||||
|
|
||||||
if((u32localtime - this->u32Timestamp) >= (FROZEN_TIMEOUT*60) && (this->u32Timestamp > 0))
|
if((u32localtime - this->u32Timestamp) >= (FROZEN_TIMEOUT*60) && (this->u32Timestamp > 0) && (this->getTaskPercentage() < 100.0))
|
||||||
{
|
{
|
||||||
Logger::logThis()->warning("Drive Frozen: " + this->getModelName() + " " + this->getSerial());
|
Logger::logThis()->warning("Drive Frozen: " + this->getModelName() + " " + this->getSerial());
|
||||||
this->bWasDeleteted = false;
|
this->bWasDeleteted = false;
|
||||||
|
|
|
@ -270,10 +270,11 @@ unsigned int Shred::uiCalcChecksum(fileDescriptor file,Drive* drive, int* ipSign
|
||||||
ulDriveByteCounter += iReadBytes;
|
ulDriveByteCounter += iReadBytes;
|
||||||
ulDriveByteOverallCount += iReadBytes;
|
ulDriveByteOverallCount += iReadBytes;
|
||||||
d32Percent = this->calcProgress();
|
d32Percent = this->calcProgress();
|
||||||
|
drive->sShredSpeed.ulSpeedMetricBytesWritten += iReadBytes;
|
||||||
#ifdef LOG_LEVEL_HIGH
|
#ifdef LOG_LEVEL_HIGH
|
||||||
Logger::logThis()->info("Shred-Task (Checksum): ByteCount: " + to_string(ulDriveByteCounter) + " - progress: " + to_string(d32Percent) + " - Drive: " + drive->getSerial());
|
Logger::logThis()->info("Shred-Task (Checksum): ByteCount: " + to_string(ulDriveByteCounter) + " - progress: " + to_string(d32Percent) + " - Drive: " + drive->getSerial());
|
||||||
#endif
|
#endif
|
||||||
if((d32Percent-d32TmpPercent) >= 0.9)
|
if((d32Percent-d32TmpPercent) >= 0.01)
|
||||||
{
|
{
|
||||||
drive->setTaskPercentage(d32TmpPercent);
|
drive->setTaskPercentage(d32TmpPercent);
|
||||||
d32TmpPercent = d32Percent;
|
d32TmpPercent = d32Percent;
|
||||||
|
|
Loading…
Reference in New Issue