user agent report

This commit is contained in:
Ben Wilson
2024-02-16 23:49:47 -05:00
parent 39e537a00c
commit 87508bfb69
7 changed files with 140 additions and 44 deletions
+11 -11
View File
@@ -104,16 +104,16 @@ export class ClientService {
return await this.clientRepository.softDelete({})
}
public async getUserAgents() {
const result = await this.clientRepository.createQueryBuilder('client')
.select('client.userAgent as "userAgent"')
.addSelect('COUNT(client.userAgent)', 'count')
.addSelect('MAX(client.bestDifficulty)', 'bestDifficulty')
.addSelect('SUM(client.hashRate)', 'totalHashRate')
.groupBy('client.userAgent')
.orderBy('"totalHashRate"', 'DESC')
.getRawMany();
return result;
}
// public async getUserAgents() {
// const result = await this.clientRepository.createQueryBuilder('client')
// .select('client.userAgent as "userAgent"')
// .addSelect('COUNT(client.userAgent)', 'count')
// .addSelect('MAX(client.bestDifficulty)', 'bestDifficulty')
// .addSelect('SUM(client.hashRate)', 'totalHashRate')
// .groupBy('client.userAgent')
// .orderBy('"totalHashRate"', 'DESC')
// .getRawMany();
// return result;
// }
}