Skip to content

Adapters

This page contains the API documentation for the gradual.reporting.adapters module.

gradual.reporting.adapters

Reporting adapters for the Gradual framework.

This module provides adapters for different output formats and destinations including logging, databases, and external monitoring systems.

Modules

base

Classes
Adapter(*args, **kwargs)
Source code in src/gradual/reporting/adapters/base.py
def __init__(self, *args, **kwargs):
    self.stats = kwargs.get("stats")
Attributes
stats = kwargs.get('stats') instance-attribute
Functions
process_stats(stat_data: dict)
Source code in src/gradual/reporting/adapters/base.py
def process_stats(self, stat_data: dict):
    raise NotImplementedError("process_stats method must be implemented")

logging

Classes
LoggingAdapter(logger: logging.Logger = size_based_logger('stress_test'), *args, **kwargs)

Bases: Adapter

Adapter that logs the stats to a file.

Parameters:

Name Type Description Default
logger Logger

The logger to use to log the stats.

size_based_logger('stress_test')
*args

Additional arguments to pass to the Adapter class.

()
**kwargs

Additional keyword arguments to pass to the Adapter class.

{}
Source code in src/gradual/reporting/adapters/logging.py
def __init__(
    self,
    logger: logging.Logger = size_based_logger("stress_test"),
    *args,
    **kwargs,
):
    self.Logger = logger
    super().__init__(*args, **kwargs)
Attributes
Logger = logger instance-attribute
Functions
process_stats(stat_data: dict)
Source code in src/gradual/reporting/adapters/logging.py
def process_stats(self, stat_data: dict):
    self.Logger.info(list(stat_data.items()))
Functions