Skip to content

Enable rDSN.Monitor for your App

Chang Lou edited this page Dec 17, 2015 · 8 revisions

What is rDSN.Monitor?

rDSN.Monitor is more than a dashboard. It's cross-layer profiling and diagnosis tool for developers to grasp the current state of system and improve distributed system performance.

rDSN.Monitor is written in Python.

The code is here.

Sample screenshots:

Main Screen Realtime Screen Vim Screen

Install

First of all, you need to install rDSN and Python2.7.

Then simply download and build rDSN.Python

what is rDSN.Python?

rDSN.Python provides the interactions between rDSN and Python scripts. With it, you could call Python functions in rDSN and vise versa.

for Linux Users

git clone https://github.com/rDSN-Projects/rDSN.Python
cd ./rDSN.Python
build.sh

for Windows Users

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
git clone https://github.com/rDSN-Projects/rDSN.Python
cd .\rDSN.Python
build.cmd

Chances are that nmake reports “cannot find python27_d.lib”, make a replica of “python27.lib” and change name to “python27_d.lib” to work around it.

what did build.cmd/build.sh do?

  • cmake and make to generate dynamic library dsn.dev.python_helper
  • use virtualenv to create a virtual and isolated python environment
  • in virtualenv install Python codes of python_helper
  • in virtualenv install Python packages used in rDSN.Monitor

The advantage of virtualenv is that it packs Python dependencies into one folder so you needn't to install again on the remote machine, and it won't pollute global environment.

Configure on single node

Add the following lines in the config.ini of your app:

[apps.monitor]
type = monitor
arguments = 8080
pools = THREAD_POOL_DEFAULT
count = 1
dmodule = dsn.dev.python_helper
dmodule_bridge_arguments = rDSN.monitor\rDSN.Monitor.py

arguments is the port number http server will use.

dmodule_bridge_arguments is the path of rDSN.Monitor.py.

And don't forget to add profiler to toollets:

toollets = tracer, profiler

Configure on a cluster

  • Modify your config file

Same as above.

  • Publish apps using run.sh/run.cmd in rDSN

  • Copy the following extra files to each app folder:

    • rDSN.monitor from rDSN.Python/src/apps/
    • venvfrom rDSN.Python/
  • Modify start.sh/start.cmd:

for Linux Users Added:

. venv/bin/activate
Export PATH=${PREFIX}/venv/bin:$PATH    

${PREFIX} might be updated to another name later, anyway it’s the main folder's path

Change

.\dsn.replication.simple_kv.exe config.ini -app_list meta@1

to

.\dsn.replication.simple_kv.exe config.ini -app_list meta@1;monitor

for Windows Users (to be continued)

  • Deploy and run