mirror of
https://github.com/hashcat/hashcat.git
synced 2025-07-23 06:58:31 +00:00
Merge pull request #3942 from PenguinKeeper7/low-performance-warning
Performance warning adjustments
This commit is contained in:
commit
3c8cc1f65e
@ -56,9 +56,10 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
|
|||||||
bool restore_check = false;
|
bool restore_check = false;
|
||||||
bool hwmon_check = false;
|
bool hwmon_check = false;
|
||||||
bool performance_check = false;
|
bool performance_check = false;
|
||||||
|
bool performance_warned = false;
|
||||||
|
|
||||||
const int sleep_time = 1;
|
const int sleep_time = 1;
|
||||||
const double exec_low = 50.0; // in ms
|
const double exec_low = 25.0; // in ms
|
||||||
const double util_low = 90.0; // in percent
|
const double util_low = 90.0; // in percent
|
||||||
|
|
||||||
if (user_options->runtime)
|
if (user_options->runtime)
|
||||||
@ -249,7 +250,7 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (performance_check == true)
|
if (performance_check == true && status_ctx->devices_status == STATUS_RUNNING && performance_warned == false)
|
||||||
{
|
{
|
||||||
int exec_cnt = 0;
|
int exec_cnt = 0;
|
||||||
int util_cnt = 0;
|
int util_cnt = 0;
|
||||||
@ -289,18 +290,22 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
|
|||||||
if (exec_cnt > 0) exec_avg = exec_total / exec_cnt;
|
if (exec_cnt > 0) exec_avg = exec_total / exec_cnt;
|
||||||
if (util_cnt > 0) util_avg = util_total / util_cnt;
|
if (util_cnt > 0) util_avg = util_total / util_cnt;
|
||||||
|
|
||||||
if ((exec_avg > 0) && (exec_avg < exec_low))
|
if (((exec_avg > 0) && (exec_avg < exec_low)) || ((util_avg > 0) && (util_avg < util_low)))
|
||||||
{
|
{
|
||||||
performance_warnings++;
|
performance_warnings++;
|
||||||
|
}
|
||||||
if (performance_warnings == 10) EVENT_DATA (EVENT_MONITOR_PERFORMANCE_HINT, NULL, 0);
|
else
|
||||||
|
{
|
||||||
|
if (performance_warnings > 0)
|
||||||
|
{
|
||||||
|
performance_warnings--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((util_avg > 0) && (util_avg < util_low))
|
if (performance_warnings == 10)
|
||||||
{
|
{
|
||||||
performance_warnings++;
|
performance_warned = true;
|
||||||
|
EVENT_DATA (EVENT_MONITOR_PERFORMANCE_HINT, NULL, 0);
|
||||||
if (performance_warnings == 10) EVENT_DATA (EVENT_MONITOR_PERFORMANCE_HINT, NULL, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user