Coder Social home page Coder Social logo

couchbase-phosphor's Introduction

Phosphor

License

Phosphor is a high-performance event tracing framework for C++11 applications designed for use in Couchbase Server - specifically KV Engine and ForestDB.

Event tracing is implemented in an application by instrumenting it as described in phosphor.h. You can then enable and manage tracing using the management API described in trace_log.h.

Example

The following is an example of hypothetical instrumentation in memcached:

void performSet(ENGINE_HANDLE* engine, const char* key, const char* value) {
    TRACE_EVENT_START1("Memcached:Operation", "performSet", "key", key);
    // Perform a set operation
    TRACE_EVENT_END0("Memcached:Operation", "performSet");
}

The following is an example of enabling tracing with a fixed-style 5MB buffer:

phosphor::TraceConfig config(phosphor::BufferMode::fixed, 5 * 1024 * 1024);
phosphor::TraceLog::getInstance().start(config);

Once the trace buffer becomes full you can retrieve it and iterate over it:

auto trace_buffer = phosphor::TraceLog::getInstance().getBuffer();
for(auto& event : *trace_buffer) {
    std::cout << event << '\n';
}

Build

Phosphor is written in C++17 and requires a mostly conforming compiler.

Phosphor is built as part of the full server build. See Build Couchbase server for more information.

Documentation

Documentation for Phosphor can be found on couchbase.github.io/phosphor. The documentation is generated by Doxygen and can be done using make docs with the top level Makefile.

couchbase-phosphor's People

Contributors

chippiewill avatar daverigby avatar trondn avatar cb-robot avatar owend74 avatar aartamonau avatar udkyo avatar csubmerged avatar paolococchi avatar avsej avatar abhinavdangeti avatar

Watchers

 avatar

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.