mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-27 02:02:10 +01:00
minimum diff 1
This commit is contained in:
parent
6b0520e73f
commit
e230e25e91
@ -63,7 +63,7 @@ export class ClientStatisticsService {
|
||||
WHERE
|
||||
entry.address = ? AND entry.time > datetime("now", "-1 day")
|
||||
GROUP BY
|
||||
strftime('%Y-%m-%d %H', time, 'localtime') || (strftime('%M', time, 'localtime') / 5)
|
||||
strftime('%Y-%m-%d %H', time, 'localtime') || (strftime('%M', time, 'localtime') / 10)
|
||||
ORDER BY
|
||||
time
|
||||
)
|
||||
@ -111,7 +111,7 @@ export class ClientStatisticsService {
|
||||
WHERE
|
||||
entry.address = ? AND entry.clientName = ? AND entry.time > datetime("now", "-1 day")
|
||||
GROUP BY
|
||||
strftime('%Y-%m-%d %H', time, 'localtime') || (strftime('%M', time, 'localtime') / 5)
|
||||
strftime('%Y-%m-%d %H', time, 'localtime') || (strftime('%M', time, 'localtime') / 10)
|
||||
ORDER BY
|
||||
time
|
||||
)
|
||||
@ -160,7 +160,7 @@ export class ClientStatisticsService {
|
||||
WHERE
|
||||
entry.address = ? AND entry.clientName = ? AND entry.sessionId = ? AND entry.time > datetime("now", "-1 day")
|
||||
GROUP BY
|
||||
strftime('%Y-%m-%d %H', time, 'localtime') || (strftime('%M', time, 'localtime') / 5)
|
||||
strftime('%Y-%m-%d %H', time, 'localtime') || (strftime('%M', time, 'localtime') / 10)
|
||||
ORDER BY
|
||||
time
|
||||
)
|
||||
|
@ -2,7 +2,7 @@ import { ClientStatisticsService } from '../ORM/client-statistics/client-statist
|
||||
import { ClientEntity } from '../ORM/client/client.entity';
|
||||
|
||||
const CACHE_SIZE = 30;
|
||||
const TARGET_SUBMISSION_PER_SECOND = 30;
|
||||
const TARGET_SUBMISSION_PER_SECOND = 10;
|
||||
export class StratumV1ClientStatistics {
|
||||
|
||||
private submissionCacheStart: Date;
|
||||
@ -70,7 +70,11 @@ export class StratumV1ClientStatistics {
|
||||
x = x | (x >> 8);
|
||||
x = x | (x >> 16);
|
||||
x = x | (x >> 32);
|
||||
return x - (x >> 1);
|
||||
const val = x - (x >> 1);
|
||||
if (val < 1) {
|
||||
return 1;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user