cyyyu / sredis

🎧 A redis monitoring tool. Demo purpose only.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sredis

NPM

Sredis is another redis monitoring tool written in javascript.

It does nothing but just shows up everthing in a page by the internal info command provided by redis-client.

Screenshots

screenshot

Installation

Global installation.

npm install -g sredis

Install as a node module.

npm install --save sredis

Usage

Command line usage.

> sredis -h 127.0.0.1 -p 6379 -a passwd -o ./logs.csv

# show helps
> sredis --help
  Usage: sredis [options]

  Options:

    -h, --help                output usage information
    -V, --version             output the version number
    -v --version              get version
    -h --host <host>          Server hostname (default: 127.0.0.1).
    -p --port <port>          Server port (default: 6379).
    -a --auth <password>      Password for redis server.
    -o --output <filepath>    Output to csv file.
    -i --interval <interval>  Refresh interval, mileseconds (default: 3000).

Module usage.

const Sredis = require('sredis')

let mywatcher = new Sredis({
  host: '', // redis server host(optional), default: 127.0.0.1
  port: '', // redis server port(optional), default: 6379
  password: '', // redis server password(optional)
  output: '', // csv filepath(optional)
  interval: '', // refresh interval, mileseconds(optional), default: 3000
})

Events

  • event#watching

  • event#statusUpdated

    mywatcher.on('statusUpdated', function(latestStatus){
      /*
      	  got latest status.
      	  {
            Server: {},
            Client: {}
            ...
      	  }
      */
    })
    
  • event#historyUpdated

    mywatcher.on('historyUpdated', function(history){
      /*
      	  here got seven history status.
      	  [
            {
              Server: {},
              Client: {}
              ...
            }
            ...
      	  ]
      */
    })
    
  • event#error

    Handle error events yourself, or they will just be thrown out.


License: MIT

Author: cyyyu

About

🎧 A redis monitoring tool. Demo purpose only.

License:MIT License


Languages

Language:JavaScript 63.4%Language:HTML 36.6%