Giter Site home page Giter Site logo

tom-s-powell / tritium Goto Github PK

View Code? Open in Web Editor NEW

This project forked from palantir/tritium

0.0 2.0 0.0 1.11 MB

Tritium is a library for instrumenting applications to provide better observability at runtime

License: Apache License 2.0

Shell 0.03% Java 99.97%

tritium's Introduction

Tritium is a library for instrumenting applications to provide better observability at runtime. Tritium allows for instrumentation of service interfaces through a Java proxy, providing call backs to extensible invocation event handlers. Two main invocation handlers currently provided are:

  • Metrics - records aggregate service time and call rates using Dropwizard metrics
  • Logging - logs individual service times

Why Tritium?

Tritium gives us aggregate metrics for the various services exposed and consumed by a server.

  • invocation response times (including min, average, max, percentile distribution, request count and 1, 5, and 15 rates)
  • cache effectiveness (eviction count, hit count, hit ratio, load average millis, load failure count, load success count, miss count, miss ratio, request count)

These metrics can be exposed at the Dropwizard MetricsServlet and can be exported via any of the Dropwizard provided reporters.

Basic Usage

Instrumenting a service interface of a dropwizard application with default metrics timers and optional trace logging.

import com.palantir.tritium.Tritium;

Service interestingService = ...
Service instrumentedService = Tritium.instrument(Service.class,
        interestingService, environment.metrics());

Creating a metric registry with reservoirs backed by HDR Histograms.

HDR histograms are more useful if the service is long running, so the stats represents the lifetime of the server rather than using default exponential decay which can lead to some mis-interpretations of timings (especially higher percentiles and things like max dropping over time) if the consumer isn't aware of these assumptions.

Note that the Histogram collects metrics throughout the lifetime of the service.

Dropwizard 0.9+ Integration

    @Override
    public void initialize(Bootstrap<ApplicationConfiguration> bootstrap) {
        super.initialize(bootstrap);
        bootstrap.setMetricRegistry(MetricRegistries.createWithHdrHistogramReservoirs());
        ...
    }

License

This project is made available under the Apache 2.0 License.

tritium's People

Contributors

ash211 avatar bavardage avatar carterkozak avatar ellisjoe avatar fsamuel-bs avatar hsaraogi avatar iamdanfox avatar j-baker avatar jboreiko avatar jkozlowski avatar justinuang avatar kasper0406 avatar mglazer avatar pkoenig10 avatar qinfchen avatar schlosna avatar svc-excavator-bot avatar

Watchers

 avatar  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.