add monitor.php

This commit is contained in:
Guobao Jiang 2014-03-19 16:49:00 +08:00
parent 80f1f02cd6
commit d014eaae6a
1 changed files with 18 additions and 0 deletions

18
redis/dredis/monitor.php Normal file
View File

@ -0,0 +1,18 @@
<?php
require_once '/vagrant_data/data/rediska/library/Rediska.php';
// Initialize Rediska
$rediska = new Rediska();
// Get monitor with 2 minutes timeout
$monitor = $rediska->monitor(60 * 2);
// Get monitor on specified server
// $monitor = $rediska->on('server1')->monitor();
// Get commands
foreach($monitor as $timestamp => $command) {
print "$timestamp => $command";
}
?>