Giter Club home page Giter Club logo

couchbase-inspector's Introduction

Couchbase Inspector

Various tools to help you figure out whats going on between your app and Couchbase Server. Work in progress, it will eat your laundry.

Usage

The only thing that really works for now is sniffing N1QL queries from the Java SDK to a Couchbase Server running on localhost.

Installation

You need to have rust installed, use rustup if you haven't.

Also, make sure libpcap is available.

$ git clone https://github.com/daschl/couchbase-inspector.git
$ cd couchbase-inspector

Build the binary.

$ cargo build --release

Run the binary. Make sure it points to the right interface and also you might need to use sudo since you are sniffing on interfaces.

I got this java code running to fire some queries:

public static void main(String[] args) throws Exception {
    CouchbaseCluster cluster = CouchbaseCluster.create();
    Bucket bucket = cluster.openBucket("beer-sample");
    Random rand = new Random();
    while(true) {
        bucket.query(N1qlQuery.simple("SELECT * FROM `beer-sample` LIMIT " + rand.nextInt(1000)));
        Thread.sleep(500);
    }
}

And running it looks like this:

$ sudo target/release/couchbase-inspector -i lo0
Password:
{"statement":"SELECT * FROM `beer-sample` LIMIT 927","timeout":"75000ms"} took 11ms
{"statement":"SELECT * FROM `beer-sample` LIMIT 595","timeout":"75000ms"} took 11ms
{"statement":"SELECT * FROM `beer-sample` LIMIT 93","timeout":"75000ms"} took 9ms
{"statement":"SELECT * FROM `beer-sample` LIMIT 924","timeout":"75000ms"} took 9ms
{"statement":"SELECT * FROM `beer-sample` LIMIT 474","timeout":"75000ms"} took 10ms
{"statement":"SELECT * FROM `beer-sample` LIMIT 940","timeout":"75000ms"} took 10ms
{"statement":"SELECT * FROM `beer-sample` LIMIT 767","timeout":"75000ms"} took 9ms
{"statement":"SELECT * FROM `beer-sample` LIMIT 671","timeout":"75000ms"} took 10ms
{"statement":"SELECT * FROM `beer-sample` LIMIT 430","timeout":"75000ms"} took 11ms

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.