c7n.output module

class c7n.output.BlobOutputRegistry(plugin_type)[source]

Bases: c7n.output.OutputRegistry

default_protocol = 'file'
class c7n.output.DeltaStats(ctx, config=None)[source]

Bases: object

Capture stats (dictionary of string->integer) as a stack.

Popping the stack automatically creates a delta of the last stack element to the current stats.

delta(before, after)[source]
get_snapshot()[source]
pop_snapshot()[source]
push_snapshot()[source]
class c7n.output.DirectoryOutput(ctx, config)[source]

Bases: object

compress()[source]
get_output_path(output_url)[source]
get_output_vars()[source]
get_resource_set()[source]
permissions = ()
type = 'file'
class c7n.output.LogFile(ctx, config=None)[source]

Bases: c7n.output.LogOutput

get_handler()[source]
log_path
type = 'default'
class c7n.output.LogMetrics(ctx, config=None)[source]

Bases: c7n.output.Metrics

Default metrics collection.

logs metrics, default handler should send to stderr

_format_metric(key, value, unit, dimensions)[source]
_put_metrics(ns, metrics)[source]
get_metadata()[source]
render_metric(m)[source]
type = 'default'
class c7n.output.LogOutput(ctx, config=None)[source]

Bases: object

get_handler()[source]
join_log()[source]
leave_log()[source]
log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
class c7n.output.LogOutputRegistry(plugin_type)[source]

Bases: c7n.output.OutputRegistry

default_protocol = 'aws'
class c7n.output.Metrics(ctx, config=None)[source]

Bases: object

BUFFER_SIZE = 20
_format_metric(key, value, unit, dimensions)[source]
_put_metrics(ns, metrics)[source]
flush()[source]
get_metadata()[source]
namespace = 'CloudMaid'
permissions = ()
put_metric(key, value, unit, buffer=True, **dimensions)[source]
class c7n.output.MetricsRegistry(plugin_type)[source]

Bases: c7n.output.OutputRegistry

select(selector, ctx)[source]
class c7n.output.NullStats(ctx, config=None)[source]

Bases: object

Execution statistics/metrics collection.

Encompasses concrete implementations over system stats (memory, cpu, cache size) and api calls.

The api supports stack nested snapshots, with delta consumption to support tracing metadata annotation across nested subsegments.

get_metadata()[source]

Return default of current to last snapshot, without popping.

pop_snapshot()[source]

Remove a snapshot from the snack and return a delta of the current stats to it.

push_snapshot()[source]

Take a snapshot of the system stats and append to the stack.

type = 'default'
class c7n.output.NullTracer(ctx, config=None)[source]

Bases: object

Tracing provides for detailed analytics of a policy execution.

Uses native cloud provider integration (xray, stack driver trace).

subsegment(name)[source]

Create a named subsegment as a context manager

type = 'default'
class c7n.output.OutputRegistry(plugin_type)[source]

Bases: c7n.registry.PluginRegistry

default_protocol = None
select(selector, ctx)[source]
class c7n.output.SystemStats(ctx, config=None)[source]

Bases: c7n.output.DeltaStats

Collect process statistics via psutil as deltas over policy execution.

get_metadata()[source]
get_snapshot()[source]