CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-eclipse-jetty--jetty-util

Comprehensive Java utility library providing infrastructure and helper classes for the Eclipse Jetty web server

Pending
Overview
Eval results
Files

statistics.mddocs/

Statistics

Built-in statistics collection and monitoring capabilities for performance tracking and system diagnostics in server applications.

Capabilities

CounterStatistic

Counter-based statistics for tracking numeric values over time.

/**
 * Counter-based statistic tracking
 */
public class CounterStatistic {
    /** Create counter statistic */
    public CounterStatistic();
    
    /** Increment counter by 1 */
    public void increment();
    
    /** Decrement counter by 1 */
    public void decrement();
    
    /** Add value to counter */
    public void add(long value);
    
    /** Get current value */
    public long getCurrent();
    
    /** Get maximum value reached */
    public long getMax();
    
    /** Reset counter to zero */
    public void reset();
    
    /** Reset and get previous max */
    public long resetMax();
}

RateStatistic

Rate-based statistics with time windows for monitoring throughput.

/**
 * Rate-based statistics with time windows
 */
public class RateStatistic {
    /** Create rate statistic with time window */
    public RateStatistic(long timeWindow, TimeUnit unit);
    
    /** Record an event */
    public void record();
    
    /** Get current rate per second */
    public double getRate();
    
    /** Get rate for oldest time window */
    public double getOldestRate();
    
    /** Get total event count */
    public long getTotal();
}

SampleStatistic

Sampling-based statistics for analyzing value distributions.

/**
 * Sampling-based statistics
 */
public class SampleStatistic {
    /** Create sample statistic */
    public SampleStatistic();
    
    /** Set current value */
    public void set(long value);
    
    /** Get maximum value */
    public long getMax();
    
    /** Get minimum value */
    public long getMin();
    
    /** Get mean value */
    public double getMean();
    
    /** Get standard deviation */
    public double getStdDev();
    
    /** Get sample count */
    public long getCount();
    
    /** Reset all statistics */
    public void reset();
}

Usage Examples:

import org.eclipse.jetty.util.statistic.*;
import java.util.concurrent.TimeUnit;

// Request counter
CounterStatistic requestCounter = new CounterStatistic();
requestCounter.increment(); // Track each request
System.out.println("Requests: " + requestCounter.getCurrent());
System.out.println("Peak: " + requestCounter.getMax());

// Request rate monitoring
RateStatistic requestRate = new RateStatistic(60, TimeUnit.SECONDS);
requestRate.record(); // Record each request
double rps = requestRate.getRate(); // Requests per second

// Response time statistics
SampleStatistic responseTime = new SampleStatistic();
responseTime.set(150); // Record response time in ms
System.out.println("Avg response: " + responseTime.getMean() + "ms");
System.out.println("Max response: " + responseTime.getMax() + "ms");

Monitoring Patterns

Statistics are commonly used for:

  • Request counting: Track total requests and concurrent requests
  • Rate monitoring: Monitor requests per second, errors per minute
  • Performance metrics: Response times, queue lengths, resource usage
  • Capacity planning: Peak usage, growth trends, bottleneck identification
  • Health monitoring: Error rates, timeout rates, success ratios

Install with Tessl CLI

npx tessl i tessl/maven-org-eclipse-jetty--jetty-util

docs

async-operations.md

component-lifecycle.md

core-utilities.md

data-structures.md

index.md

resource-management.md

security.md

statistics.md

threading.md

tile.json