mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
minimum diff 1
This commit is contained in:
@@ -63,7 +63,7 @@ export class ClientStatisticsService {
|
|||||||
WHERE
|
WHERE
|
||||||
entry.address = ? AND entry.time > datetime("now", "-1 day")
|
entry.address = ? AND entry.time > datetime("now", "-1 day")
|
||||||
GROUP BY
|
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
|
ORDER BY
|
||||||
time
|
time
|
||||||
)
|
)
|
||||||
@@ -111,7 +111,7 @@ export class ClientStatisticsService {
|
|||||||
WHERE
|
WHERE
|
||||||
entry.address = ? AND entry.clientName = ? AND entry.time > datetime("now", "-1 day")
|
entry.address = ? AND entry.clientName = ? AND entry.time > datetime("now", "-1 day")
|
||||||
GROUP BY
|
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
|
ORDER BY
|
||||||
time
|
time
|
||||||
)
|
)
|
||||||
@@ -160,7 +160,7 @@ export class ClientStatisticsService {
|
|||||||
WHERE
|
WHERE
|
||||||
entry.address = ? AND entry.clientName = ? AND entry.sessionId = ? AND entry.time > datetime("now", "-1 day")
|
entry.address = ? AND entry.clientName = ? AND entry.sessionId = ? AND entry.time > datetime("now", "-1 day")
|
||||||
GROUP BY
|
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
|
ORDER BY
|
||||||
time
|
time
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ClientStatisticsService } from '../ORM/client-statistics/client-statist
|
|||||||
import { ClientEntity } from '../ORM/client/client.entity';
|
import { ClientEntity } from '../ORM/client/client.entity';
|
||||||
|
|
||||||
const CACHE_SIZE = 30;
|
const CACHE_SIZE = 30;
|
||||||
const TARGET_SUBMISSION_PER_SECOND = 30;
|
const TARGET_SUBMISSION_PER_SECOND = 10;
|
||||||
export class StratumV1ClientStatistics {
|
export class StratumV1ClientStatistics {
|
||||||
|
|
||||||
private submissionCacheStart: Date;
|
private submissionCacheStart: Date;
|
||||||
@@ -70,7 +70,11 @@ export class StratumV1ClientStatistics {
|
|||||||
x = x | (x >> 8);
|
x = x | (x >> 8);
|
||||||
x = x | (x >> 16);
|
x = x | (x >> 16);
|
||||||
x = x | (x >> 32);
|
x = x | (x >> 32);
|
||||||
return x - (x >> 1);
|
const val = x - (x >> 1);
|
||||||
|
if (val < 1) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user