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

View File

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

View File

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