geonode.monitoring.aggregation

Attributes

log

Functions

get_metric_names()

Returns list of tuples: (service type, list of metrics)

get_labels_for_metric(metric_name[, resource])

get_resources_for_metric(metric_name)

extract_resources(requests)

extract_event_type(requests)

extract_event_types(requests)

extract_special_event_types(requests)

Return list of pairs (event_type, requests)

calculate_rate(metric_name, metric_label, ...)

Find previous network metric value and caclulate rate between them

calculate_percent(metric_name, metric_label, ...)

Find previous network metric value and caclulate percent

adjust_now_to_noon(now)

aggregate_past_periods([metric_data_q, periods, ...])

Aggregate past metric data into longer periods.

aggregate_period(period_start, period_end, metric_data_q)

Module Contents

geonode.monitoring.aggregation.log[source]
geonode.monitoring.aggregation.get_metric_names()[source]

Returns list of tuples: (service type, list of metrics)

geonode.monitoring.aggregation.get_labels_for_metric(metric_name, resource=None)[source]
geonode.monitoring.aggregation.get_resources_for_metric(metric_name)[source]
geonode.monitoring.aggregation.extract_resources(requests)[source]
geonode.monitoring.aggregation.extract_event_type(requests)[source]
geonode.monitoring.aggregation.extract_event_types(requests)[source]
geonode.monitoring.aggregation.extract_special_event_types(requests)[source]

Return list of pairs (event_type, requests) that should be registered as one of aggregating event types: ows:all, other,

geonode.monitoring.aggregation.calculate_rate(metric_name, metric_label, current_value, valid_to)[source]

Find previous network metric value and caclulate rate between them

geonode.monitoring.aggregation.calculate_percent(metric_name, metric_label, current_value, valid_to)[source]

Find previous network metric value and caclulate percent

geonode.monitoring.aggregation.adjust_now_to_noon(now)[source]
geonode.monitoring.aggregation.aggregate_past_periods(metric_data_q=None, periods=None, cleanup=True, now=None, max_since=None)[source]

Aggregate past metric data into longer periods.

@param metric_data_q: Query for metric data to use as input

(default: all MetricValues)

@param periods: List of tuples (cutoff, aggregation) to be used

(default: settings.MONITORING_DATA_AGGREGATION)

@param cleanup: Flag if input data should be removed after aggregation

(default: True)

@param now: Arbitrary now moment to start calculation of cutoff

(default: current now)

@param max_since: Look for data no older than max_since

(default: 1 year)

geonode.monitoring.aggregation.aggregate_period(period_start, period_end, metric_data_q, cleanup=True)[source]