/[sudobot]/trunk/src/commands/settings/SystemCommand.ts
ViewVC logotype

Diff of /trunk/src/commands/settings/SystemCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 364 by rakin, Mon Jul 29 17:29:48 2024 UTC revision 366 by rakin, Mon Jul 29 17:29:48 2024 UTC
# Line 6  import InteractionOptions from '../../ty Line 6  import InteractionOptions from '../../ty
6  import MessageEmbed from '../../client/MessageEmbed';  import MessageEmbed from '../../client/MessageEmbed';
7  import { fetchEmoji } from '../../utils/Emoji';  import { fetchEmoji } from '../../utils/Emoji';
8  import { formatDuration, intervalToDuration } from 'date-fns';  import { formatDuration, intervalToDuration } from 'date-fns';
9    import os from 'os';
10    
11  export default class SystemCommand extends BaseCommand {  export default class SystemCommand extends BaseCommand {
12      constructor() {      constructor() {
# Line 54  export default class SystemCommand exten Line 55  export default class SystemCommand exten
55              apiLatencyIcon = '🟡';              apiLatencyIcon = '🟡';
56          }          }
57    
58          const memoryTotal = Math.round(process.memoryUsage().heapTotal / 1024 / 1024);          const memoryTotal = Math.round(os.totalmem() / 1024 / 1024);
59          const memoryUsed = Math.round(process.memoryUsage().heapUsed / 1024 / 1024);          const memoryUsed = Math.round((os.totalmem() - os.freemem()) / 1024 / 1024);
60            const memoryUsedByBot = Math.round(process.memoryUsage().heapUsed / 1024 / 1024);
61    
62          const msgoptions: any = {          const msgoptions: any = {
63              embeds: [              embeds: [
# Line 87  export default class SystemCommand exten Line 89  export default class SystemCommand exten
89                      },                      },
90                      {                      {
91                          name: 'Memory Usage',                          name: 'Memory Usage',
92                          value: `${memoryUsed} MB / ${memoryTotal} MB`                          value: `${memoryUsed}MB / ${memoryTotal}MB (${memoryUsedByBot}MB used by the bot)`
93                      },                      },
94                      {                      {
95                          name: 'System Platform',                          name: 'System Platform',

Legend:
Removed from v.364  
changed lines
  Added in v.366

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26