Skip to content

Commit

Permalink
Health page displayes memcached status (#156)
Browse files Browse the repository at this point in the history
Signed-off-by: Janos SUTO <sj@acts.hu>
  • Loading branch information
jsuto authored Aug 15, 2024
1 parent 09a03b4 commit 4da3759
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webui/model/health/health.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public function collect_data() {
}
}

if(MEMCACHED_ENABLED) {
$this->data['memcached_version'] = $this->get_memcached_version();
}
}


Expand Down Expand Up @@ -366,4 +369,13 @@ public function get_index_size() {
return $size;
}

public function get_memcached_version() {
$m = Registry::get('memcache');
$stats = $m->getStats();
foreach($stats as $server => $info) {
return $info['version'];
}
return "ERROR";
}

}
25 changes: 25 additions & 0 deletions webui/templates/health/worker.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,31 @@
</div>
<?php } ?>

<?php if(MEMCACHED_ENABLED) { ?>
<div class="container text-start">
<div class="row">
<div class="col">
<h2><i class="bi bi-database"></i> Memcached</h2>
</div>
</div>
</div>
<div class="container text-start">
<div class="row">
<div class="col-2">Extension</div>
<div class="col"><?php if(extension_loaded('memcached')) { ?><i class="verified bi bi-check-circle-fill text-success"></i><?php } else { ?><i class="unverified bi bi-x-square-fill text-danger"></i><?php } ?></div>
</div>
</div>

<div class="container text-start">
<div class="row">
<div class="col-2">Version</div>
<div class="col"><?php print $health['memcached_version']; ?></div>
</div>
</div>

<?php } ?>

</div>

<div class="col-4"> <!-- right side -->
Expand Down

0 comments on commit 4da3759

Please sign in to comment.