feat: push notification statistics (#30269)

Co-authored-by: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com>
pull/30473/head^2
Heitor Tanoue 2 years ago committed by GitHub
parent 83c7708832
commit c0ef13a0bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      .changeset/nice-chairs-add.md
  2. 9
      apps/meteor/app/statistics/server/lib/statistics.ts
  3. 1
      apps/meteor/client/views/admin/info/DeploymentCard.stories.tsx
  4. 1
      apps/meteor/client/views/admin/info/InformationPage.stories.tsx
  5. 1
      apps/meteor/client/views/admin/info/UsageCard.stories.tsx
  6. 1
      packages/core-typings/src/IStats.ts

@ -0,0 +1,13 @@
---
"@rocket.chat/meteor": minor
"@rocket.chat/core-typings": minor
---
Added `push` statistic, containing three bits. Each bit represents a boolean:
```
1 1 1
| | |
| | +- push enabled = 0b1 = 1
| +--- push gateway enabled = 0b10 = 2
+----- push gateway changed = 0b100 = 4
```

@ -517,6 +517,15 @@ export const statistics = {
statistics.totalWebRTCCalls = settings.get('WebRTC_Calls_Count');
statistics.uncaughtExceptionsCount = settings.get('Uncaught_Exceptions_Count');
const defaultGateway = (await Settings.findOneById('Push_gateway', { projection: { packageValue: 1 } }))?.packageValue;
// one bit for each of the following:
const pushEnabled = settings.get('Push_enable') ? 1 : 0;
const pushGatewayEnabled = settings.get('Push_enable_gateway') ? 2 : 0;
const pushGatewayChanged = settings.get('Push_gateway') !== defaultGateway ? 4 : 0;
statistics.push = pushEnabled | pushGatewayEnabled | pushGatewayChanged;
const defaultHomeTitle = (await Settings.findOneById('Layout_Home_Title'))?.packageValue;
statistics.homeTitleChanged = settings.get('Layout_Home_Title') !== defaultHomeTitle;

@ -265,6 +265,7 @@ export default {
totalCustomRoles: 0,
totalWebRTCCalls: 0,
uncaughtExceptionsCount: 0,
push: 0,
matrixFederation: {
enabled: false,
},

@ -295,6 +295,7 @@ export default {
totalCustomRoles: 0,
totalWebRTCCalls: 0,
uncaughtExceptionsCount: 0,
push: 0,
matrixFederation: {
enabled: false,
},

@ -243,6 +243,7 @@ export default {
totalCustomRoles: 0,
totalWebRTCCalls: 0,
uncaughtExceptionsCount: 0,
push: 0,
matrixFederation: {
enabled: false,
},

@ -211,6 +211,7 @@ export interface IStats {
totalCustomRoles: number;
totalWebRTCCalls: number;
uncaughtExceptionsCount: number;
push: number;
matrixFederation: {
enabled: boolean;
};

Loading…
Cancel
Save