GithubHelp home page GithubHelp logo

salesforce / tsdb-hbase-region-finder Goto Github PK

View Code? Open in Web Editor NEW
4.0 16.0 5.0 26 KB

Tool that tells you what HBase RegionServer/Region that a TSDB metric is on

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

tsdb-hbase-region-finder's Introduction

regionfinder

[June 2019] A Python 2/3 CLI tool that takes in a metric name or expression and returns the HBase RegionServer and Region where it is located. Has a dependency on the HMaster Info Web UI.

Also available as a minimal webserver.

Setup (Python 2 - Mac - Recommended)

Prerequisites: python version 2, pip, and virtualenv

# If you don't already have pip
brew install python@2

pip install virtualenv

python --version
## This should output Python 2.X.X , if not, you may need to move /usr/local/bin 
## to the front of your path and restart terminal

Clone the repository, create a Python virtualenv, and install local dependencies

git clone https://github.com/salesforce/tsdb-hbase-region-finder.git
cd tsdb-hbase-region-finder

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
# Install the local regionfinder module
pip install -e .

CLI usage

$ bin/cli -h
usage: cli.py [-h] [-t TIME] [-c CONFIG] expression

Outputs CSV-formatted region servers and names of all matching timeseries
(delimited by the | character )

positional arguments:
  expression            The TSDB metric name

optional arguments:
  -h, --help            show this help message and exit
  -t TIME, --time TIME  TSDB relative time-string or absolute epoch time to
                        use in rowkey. See http://opentsdb.net/docs/build/html
                        /user_guide/query/dates.html
  -c CONFIG, --config CONFIG
                        Path to config yaml

CLI Examples

$ bin/cli envoy.server.uptime
RegionServer|RegionName
http://host1.hbase.com:60030/|tsdb,1510122330068.05714303d5f455bfac661199d2cbb343
http://host1.hbase.com:60030/|tsdb,1510122330068.05714303d5f455bfac661199d2cbb343

Webserver usage

$ bin/server -h
usage: server.py [-h] [-c CONFIG] [-p PORT]

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        path to config yaml
  -p PORT, --port PORT  path to config yaml

Logging

The logger, by default, appends INFO level logs to rf.log. The desired log file location can be set with the env variable REGION_FINDER_LOG.

The CLI's stream logger level is ERROR

The web server's stream logger level is INFO

Development

Install additional dev dependencies

pip install -r requirements-dev.txt

Run tests for Python versions - this can be done in a Python 2 or 3 virtualenv

tox 

tsdb-hbase-region-finder's People

Contributors

colbyguan avatar dilipdevaraj-sfdc avatar nkunal avatar svc-scm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tsdb-hbase-region-finder's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.