Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Add more output data to Database Statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
iwind committed Jun 6, 2014
1 parent bb92543 commit 7d3606d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 16 additions & 1 deletion app/controllers/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ public function doIndex() {
if(isset($ret["objects"])) {
$this->stats["Objects"] = $ret["objects"];
}
if (isset($ret["avgObjSize"])) {
$this->stats["Avg Object Size"] = $ret["avgObjSize"];
}
if(isset($ret["dataSize"])) {
$this->stats["Data Size"] = $ret["dataSize"];
}
if(isset($ret["storageSize"])) {
$this->stats["Storage Size"] = $ret["storageSize"];
}
if(isset($ret["numEvents"])) {
if(isset($ret["numExtents"])) {
$this->stats["Extents"] = $ret["numExtents"];
}
if(isset($ret["indexes"])) {
Expand All @@ -68,6 +71,18 @@ public function doIndex() {
if(isset($ret["indexSize"])) {
$this->stats["Index Size"] = $ret["indexSize"];
}
if (isset($ret["fileSize"])) {
$this->stats["Total File Size"] = r_human_bytes($ret["fileSize"]);
}
if (isset($ret["nsSizeMB"])) {
$this->stats["Namespace Size"] = $ret["nsSizeMB"] . "m";
}
if (isset($ret["dataFileVersion"])) {
$this->stats["Data File Version"] = $this->_highlight($ret["dataFileVersion"], "json");
}
if (isset($ret["extentFreeList"])) {
$this->stats["Extent Free List"] = $this->_highlight($ret["extentFreeList"], "json");
}

$this->display();
}
Expand Down
5 changes: 4 additions & 1 deletion themes/default/views/db/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function setManualPosition(className, x, y) {
});
}
}

/** hide menus **/
function hideMenus() {
$(".menu").hide();
Expand All @@ -41,6 +41,9 @@ function hideMenus() {
</div>

<table bgcolor="#cccccc" cellpadding="2" cellspacing="1" width="600">
<tr>
<td colspan="2" style="text-align:center;font-weight:bold"><a href="http://docs.mongodb.org/manual/reference/command/dbStats/#dbcmd.dbStats" target="_blank">Database Statistics</a> ({dbStats:1})</td>
</tr>
<?php foreach ($stats as $param=>$value):?>
<tr bgcolor="#fffeee">
<td width="120" valign="top"><?php h($param);?></td>
Expand Down

0 comments on commit 7d3606d

Please sign in to comment.