Skip to content

Commit

Permalink
bot-info mem usage
Browse files Browse the repository at this point in the history
Added mem usage for all shards to bot-info command. Also removed
bigdecimal from gemfile as I was a bit hasty here and it threw errors on
the server
  • Loading branch information
Humblemonk committed Jul 3, 2024
1 parent 23caf74 commit 46190c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
source 'https://rubygems.org'

gem 'base64'
gem 'bigdecimal', '~> 1.2', '>= 1.2.7'
gem 'dicebag', git: 'https://github.com/Humblemonk/Dice-Bag.git', branch: 'pre-3.3'
gem 'discordrb', github: 'shardlab/discordrb', branch: 'main'
gem 'dotenv', '~> 2.5'
Expand Down
3 changes: 2 additions & 1 deletion src/dice_maiden_logic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@ def check_bot_info(event)
servers = $db.execute 'select sum(server_count) from shard_stats;'
shards = $db.execute 'select sum(shard_id) from shard_stats;'
total_shards = shards.join.to_i + 1
event.respond(content: "| Dice Maiden | - #{servers.join.to_i} active servers across #{total_shards} shards")
total_mem = $db.execute 'select sum(mem) from shard_stats;'
event.respond(content: "| Dice Maiden | - #{servers.join.to_i} active servers across #{total_shards} shards using #{total_mem.join.to_i.round / 1024}GB of ram")
true
end
end
Expand Down

0 comments on commit 46190c4

Please sign in to comment.