Rediska

Follow me on twitter…

Rediska config and monitor on github!

August 11, 2010

Yesterday I pushed implementation of CONFIG and MONITOR Redis commands to github.

Config

<?php

$rediska = new Rediska();
$config = $rediska->config();

// Iterate all redis parameters
foreach($config as $name => $value) {
    print "$name => $value\n";
}

// Get parameter
print $config->maxmemory;

// or as array
print $config['maxmemory'];

// Get parameters by pattern
foreach($config['max*'] as $name => $value) {
    print "$name => $value\n";
}

// Set parameter
$config->maxmemory = 10000;

// or as array
$config['maxmemory'] = 10000;

?>

Monitor

<?php

// Get monitor
$monitor = new Rediska_Monitor();

// or from Rediska
$rediska = new Rediska();
$monitor = $rediska->monitor();

// Get commands
foreach($monitor as $timestamp => $command) {
    print "$timestamp => $command";
}

?>

Comments

Fork me on GitHub