Skip to content

Commit

Permalink
Merge pull request rlerdorf#16 from jeffery/add-restarts
Browse files Browse the repository at this point in the history
Adding Restarts to graph
  • Loading branch information
rlerdorf committed Mar 22, 2014
2 parents 4ec8a11 + 7aca02e commit a978692
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions opcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class OpCacheDataModel
{
private $configuration;
private $_configuration;
private $_status;
private $_d3Scripts = array();

Expand Down Expand Up @@ -169,6 +169,12 @@ public function getGraphDataSetJson()
0,
);

$dataset['restarts'] = array(
$this->_status['opcache_statistics']['oom_restarts'],
$this->_status['opcache_statistics']['manual_restarts'],
$this->_status['opcache_statistics']['hash_restarts'],
);

return json_encode($dataset);
}

Expand Down Expand Up @@ -365,7 +371,7 @@ private function _arrayPset(&$array, $key, $value)

#graph > form {
position: absolute;
right: 110px;
right: 60px;
top: -20px;
}

Expand Down Expand Up @@ -505,6 +511,7 @@ function toggleVisible(head, row) {
<label><input type="radio" name="dataset" value="memory" checked> Memory</label>
<label><input type="radio" name="dataset" value="keys"> Keys</label>
<label><input type="radio" name="dataset" value="hits"> Hits</label>
<label><input type="radio" name="dataset" value="restarts"> Restarts</label>
</form>

<div id="stats"></div>
Expand Down Expand Up @@ -564,6 +571,12 @@ function set_text(t) {
"<table><tr><th style='background:#B41F1F;'>Misses</th><td>"+dataset[t][0]+"</td></tr>"+
"<tr><th style='background:#1FB437;'>Cache Hits</th><td>"+dataset[t][1]+"</td></tr></table>"
);
} else if (t === "restarts") {
d3.select("#stats").html(
"<table><tr><th style='background:#B41F1F;'>Memory</th><td>"+dataset[t][0]+"</td></tr>"+
"<tr><th style='background:#1FB437;'>Manual</th><td>"+dataset[t][1]+"</td></tr>"+
"<tr><th style='background:#ff7f0e;'>Keys</th><td>"+dataset[t][2]+"</td></tr></table>"
);
}
}

Expand Down

0 comments on commit a978692

Please sign in to comment.