Exemplo n.º 1
0
def compute_graph_artwork_curves(graph_recipe, graph_data_range):
    # Fetch all raw RRD data
    rrd_data = rrd_fetch.fetch_rrd_data_for_graph(graph_recipe, graph_data_range)

    curves = timeseries.compute_graph_curves(graph_recipe["metrics"], rrd_data)

    if graph_recipe.get("omit_zero_metrics"):
        curves = [curve for curve in curves if any(curve["rrddata"])]

    return curves
Exemplo n.º 2
0
def compute_graph_artwork_curves(graph_recipe, graph_data_range):
    # Fetch all raw RRD data
    rrd_data = rrd_fetch.fetch_rrd_data_for_graph(graph_recipe, graph_data_range)

    curves = timeseries.compute_graph_curves(graph_recipe["metrics"], rrd_data)
    try:
        start_time, end_time, step = curves[0]['rrddata'].twindow
    except (AttributeError, IndexError):
        start_time, end_time, step = rrd_data['__range']

    if graph_recipe.get("omit_zero_metrics"):
        curves = [curve for curve in curves if any(curve["rrddata"])]

    return start_time, end_time, step, curves