diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-30 23:30:33 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-30 23:30:33 +0200 |
commit | c2cc32031ebb477f21ab4bd37201cda70dec23ea (patch) | |
tree | d7d8ee5ae023c9157a8392f2bbabe901bc3deef8 /source/cServer.cpp | |
parent | Added support for SetNextBlockTick() function callable from Lua (diff) | |
download | cuberite-c2cc32031ebb477f21ab4bd37201cda70dec23ea.tar cuberite-c2cc32031ebb477f21ab4bd37201cda70dec23ea.tar.gz cuberite-c2cc32031ebb477f21ab4bd37201cda70dec23ea.tar.bz2 cuberite-c2cc32031ebb477f21ab4bd37201cda70dec23ea.tar.lz cuberite-c2cc32031ebb477f21ab4bd37201cda70dec23ea.tar.xz cuberite-c2cc32031ebb477f21ab4bd37201cda70dec23ea.tar.zst cuberite-c2cc32031ebb477f21ab4bd37201cda70dec23ea.zip |
Diffstat (limited to 'source/cServer.cpp')
-rw-r--r-- | source/cServer.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source/cServer.cpp b/source/cServer.cpp index 36183f3bc..1a8421bbb 100644 --- a/source/cServer.cpp +++ b/source/cServer.cpp @@ -22,6 +22,7 @@ #include "cFurnaceRecipe.h"
#include "cTracer.h"
#include "cWebAdmin.h"
+#include "cChunk.h"
#include "MersenneTwister.h"
@@ -536,10 +537,27 @@ void cServer::ServerCommand( const char * a_Cmd ) int NumValid = 0;
int NumDirty = 0;
int NumInLighting = 0;
- cRoot::Get()->GetDefaultWorld()->GetChunkStats(NumValid, NumDirty, NumInLighting);
+ cWorld * World = cRoot::Get()->GetDefaultWorld();
+ int NumInGenerator = World->GetGeneratorQueueLength();
+ int NumInSaveQueue = World->GetStorageSaveQueueLength();
+ int NumInLoadQueue = World->GetStorageLoadQueueLength();
+ World->GetChunkStats(NumValid, NumDirty, NumInLighting);
LOG("Num loaded chunks: %d", NumValid);
LOG("Num dirty chunks: %d", NumDirty);
LOG("Num chunks in lighting queue: %d", NumInLighting);
+ LOG("Num chunks in generator queue: %d", NumInGenerator);
+ LOG("Num chunks in storage load queue: %d", NumInLoadQueue);
+ LOG("Num chunks in storage save queue: %d", NumInSaveQueue);
+ int Mem = NumValid * sizeof(cChunk);
+ LOG("Memory used by chunks: %d KiB (%d MiB)", (Mem + 1023) / 1024, (Mem + 1024 * 1024 - 1) / (1024 * 1024));
+ LOG("Per-chunk memory size breakdown:");
+ LOG(" block types: %6d bytes (%3d KiB)", sizeof(cChunkDef::BlockTypes), (sizeof(cChunkDef::BlockTypes) + 1023) / 1024);
+ LOG(" block metadata: %6d bytes (%3d KiB)", sizeof(cChunkDef::BlockNibbles), (sizeof(cChunkDef::BlockNibbles) + 1023) / 1024);
+ LOG(" block lighting: %6d bytes (%3d KiB)", 2 * sizeof(cChunkDef::BlockNibbles), (2 * sizeof(cChunkDef::BlockNibbles) + 1023) / 1024);
+ LOG(" heightmap: %6d bytes (%3d KiB)", sizeof(cChunkDef::HeightMap), (sizeof(cChunkDef::HeightMap) + 1023) / 1024);
+ LOG(" biomemap: %6d bytes (%3d KiB)", sizeof(cChunkDef::BiomeMap), (sizeof(cChunkDef::BiomeMap) + 1023) / 1024);
+ int Rest = sizeof(cChunk) - sizeof(cChunkDef::BlockTypes) - 3 * sizeof(cChunkDef::BlockNibbles) - sizeof(cChunkDef::HeightMap) - sizeof(cChunkDef::BiomeMap);
+ LOG(" other: %6d bytes (%3d KiB)", Rest, (Rest + 1023) / 1024);
return;
}
|