Merge pull request #5279 from tsiegleauq/less-verbose-user-count

Remove counting of IndexedDB and LocalStore
This commit is contained in:
Emanuel Schütze 2020-03-25 13:10:00 +01:00 committed by GitHub
commit d50899c407
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 15 deletions

View File

@ -11,7 +11,6 @@ interface CountUserRequest {
export interface CountUserData {
userId: number;
usesIndexedDB: boolean;
}
interface CountUserResponse extends CountUserRequest {
@ -49,8 +48,7 @@ export class CountUsersService {
{
token: request.content.token,
data: {
userId: this.currentUserId,
usesIndexedDB: true
userId: this.currentUserId
}
},
request.senderChannelName

View File

@ -7,17 +7,16 @@
</button>
<div *ngIf="stats">
<p>
{{ userIds().length }} <span translate>active users</span>
({{ stats.usesIndexedDB }} <span translate>with indexedDB</span>,
{{ stats.activeUserHandles-stats.usesIndexedDB }} <span translate>with local storage</span>)
({{ stats.activeUserHandles }} <span translate>connections</span>)
{{ userIds().length }} <span translate>active users</span> ({{ stats.activeUserHandles }}
<span translate>connections</span>)
</p>
<h3 translate>Groups</h3>
<ul>
<li *ngFor="let groupId of groupIds()">
<strong>{{ stats.groups[groupId].name }}</strong>:
{{ userInGroupIds(groupId).length }} <span translate>active users</span>
({{ stats.groups[groupId].userHandleCount }} <span translate>connections</span>)
<strong>{{ stats.groups[groupId].name }}</strong>
<span> : {{ userInGroupIds(groupId).length }} </span>
<span translate>active users</span>
(<span>{{ stats.groups[groupId].userHandleCount }}</span> <span translate>connections</span>)
</li>
</ul>
</div>

View File

@ -10,7 +10,6 @@ import { CountUserData, CountUsersService } from 'app/core/ui-services/count-use
*/
export interface CountUserStatistics {
activeUserHandles: number;
usesIndexedDB: number;
activeUsers: {
[id: number]: number;
};
@ -52,7 +51,6 @@ export class CountUsersStatisticsService {
[token, userDataObservable] = this.countUserService.countUsers();
this.runningCounts[token] = new BehaviorSubject<CountUserStatistics>({
activeUserHandles: 0,
usesIndexedDB: 0,
activeUsers: {},
groups: {}
});
@ -66,9 +64,6 @@ export class CountUsersStatisticsService {
// Add to user stats
stats.activeUserHandles++;
if (data.usesIndexedDB) {
stats.usesIndexedDB++;
}
if (!stats.activeUsers[userId]) {
stats.activeUsers[userId] = 0;
}