Skip to content

Commit

Permalink
feat(status): Track more events
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Crespi committed Dec 16, 2019
1 parent a9c360e commit d1ffd5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ export class IMClient extends Client {
public gatewayConnected: boolean;
public activityInterval: NodeJS.Timer;
public voiceConnections: LavaPlayerManager;
public eventsReceived: number;
public eventsRaised: number;
public warningsRaised: number;
public errorsRaised: number;

private counts: {
cachedAt: Moment;
Expand Down Expand Up @@ -133,7 +135,7 @@ export class IMClient extends Client {
});

this.startedAt = moment();
this.eventsReceived = 0;
this.eventsRaised = 0;
this.counts = {
cachedAt: moment.unix(0),
guilds: 0,
Expand Down Expand Up @@ -602,13 +604,15 @@ export class IMClient extends Client {

private async onWarn(warn: string) {
console.error('DISCORD WARNING:', warn);
this.warningsRaised++;
}

private async onError(error: Error) {
console.error('DISCORD ERROR:', error);
this.errorsRaised++;
}

private async onRawWS() {
this.eventsReceived++;
this.eventsRaised++;
}
}
4 changes: 3 additions & 1 deletion src/framework/services/RabbitMq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ export class RabbitMqService {
},
cache: this.getCacheSizes(),
events: {
received: this.client.eventsReceived
total: this.client.eventsRaised,
warnings: this.client.warningsRaised,
errors: this.client.errorsRaised
},
requests: {
queued
Expand Down

0 comments on commit d1ffd5d

Please sign in to comment.