handy_httpd.handlers.profiling_handler

This module defines a set of tools that can be used to profile the performance of your request handler, by wrapping it in a ProfilingHandler that emits data to a ProfilingDataHandler.

Members

Classes

CsvProfilingDataHandler
class CsvProfilingDataHandler

A data handler that saves all request info to a CSV file for later use. Note that the provided file will be overwritten if it already exists.

LoggingProfilingDataHandler
class LoggingProfilingDataHandler

A data handler that occasionally emits profiling data via log messages. You can configure the log level that profiling messages are emitted at, as well as how many requests to cache for aggregate data, and how often to emit a detailed message with aggregate statistics.

ProfilingHandler
class ProfilingHandler

A wrapper handler that can be applied over another, to record performance statistics at runtime. The profiling handler will collect basic information about each request that's handled by a given handler, and pass it on to a data handler. The data handler might write the data to a file, use it for aggregate statistics, or logging.

Functions

profiled
HttpRequestHandler profiled(HttpRequestHandler handler, ProfilingDataHandler dataHandler)

Wraps a handler in a ProfilingHandler and returns it.

profiled
HttpRequestHandler profiled(HttpRequestHandler handler)

Wraps a handler in a ProfilingHandler that's using a logging data handler.

Interfaces

ProfilingDataHandler
interface ProfilingDataHandler

A component that handles profiling data points generated by the ProfilingHandler.

Structs

RequestInfo
struct RequestInfo

A struct containing information about how a request was handled.