Example #1
0
def gae_stats_memcache():
    selected_metric = flask.request.args.get('metric', 'hit_ratio')
    # The tuples are (database_field_name, friendly_label).
    metrics = (('hit_ratio', 'hit ratio'), ('hit_count', 'hit count'),
               ('miss_count', 'miss count'), ('item_count', 'item count'),
               ('total_cache_size_bytes', 'total cache size (bytes)'),
               ('oldest_item_age_seconds', 'oldest item age (seconds)'))
    records = data.gae_dashboard_reports(db, 'memcache')
    date_record_pairs = time_series(records, 'utc_datetime')
    return flask.render_template('gae-stats/metrics-in-time-series.html',
                                 title='Memcache Statistics',
                                 date_record_pairs=date_record_pairs,
                                 metrics=metrics,
                                 selected_metric=selected_metric)
Example #2
0
def gae_stats_instances():
    selected_metric = flask.request.args.get('metric', 'num_instances')
    # The tuples are (database_field_name, friendly_label).
    metrics = (('num_instances', 'number of instances'),
               ('average_qps', 'average qps'),
               ('average_latency_ms', 'average latency (ms)'),
               ('average_memory_mb', 'average memory (MB)'))
    records = data.gae_dashboard_reports(db, 'instance')
    date_record_pairs = time_series(records, 'utc_datetime')
    return flask.render_template('gae-stats/metrics-in-time-series.html',
                                 title='Instance Usage',
                                 date_record_pairs=date_record_pairs,
                                 metrics=metrics,
                                 selected_metric=selected_metric)
Example #3
0
def gae_stats_instances():
    selected_metric = flask.request.args.get('metric', 'num_instances')
    # The tuples are (database_field_name, friendly_label).
    metrics = (('num_instances', 'number of instances'),
               ('average_qps', 'average qps'), ('average_latency_ms',
                                                'average latency (ms)'),
               ('average_memory_mb', 'average memory (MB)'))
    records = data.gae_dashboard_reports(db, 'instance')
    date_record_pairs = time_series(records, 'utc_datetime')
    return flask.render_template('gae-stats/metrics-in-time-series.html',
                                 title='Instance Usage',
                                 date_record_pairs=date_record_pairs,
                                 metrics=metrics,
                                 selected_metric=selected_metric)
Example #4
0
def gae_stats_memcache():
    selected_metric = flask.request.args.get('metric', 'hit_ratio')
    # The tuples are (database_field_name, friendly_label).
    metrics = (('hit_ratio', 'hit ratio'),
               ('hit_count', 'hit count'),
               ('miss_count', 'miss count'),
               ('item_count', 'item count'),
               ('total_cache_size_bytes', 'total cache size (bytes)'),
               ('oldest_item_age_seconds', 'oldest item age (seconds)'))
    records = data.gae_dashboard_reports(db, 'memcache')
    date_record_pairs = time_series(records, 'utc_datetime')
    return flask.render_template('gae-stats/metrics-in-time-series.html',
                                 title='Memcache Statistics',
                                 date_record_pairs=date_record_pairs,
                                 metrics=metrics,
                                 selected_metric=selected_metric)
Example #5
0
def gae_stats_instances():
    selected_metric = flask.request.args.get("metric", "num_instances")
    # The tuples are (database_field_name, friendly_label).
    metrics = (
        ("num_instances", "number of instances"),
        ("average_qps", "average qps"),
        ("average_latency_ms", "average latency (ms)"),
        ("average_memory_mb", "average memory (MB)"),
    )
    records = data.gae_dashboard_reports(db, "instance")
    date_record_pairs = time_series(records, "utc_datetime")
    return flask.render_template(
        "gae-stats/metrics-in-time-series.html",
        title="Instance Usage",
        date_record_pairs=date_record_pairs,
        metrics=metrics,
        selected_metric=selected_metric,
    )
Example #6
0
def gae_stats_dashboard_charts():
    chart_name = flask.request.args.get('chart', 'Requests/Second')
    if chart_name not in _dashboard_chart_fields:
        return flask.current_app.response_class(
            'Unrecognized chart name: "%s"' % chart_name, status=400)

    if isinstance(_dashboard_chart_fields[chart_name], basestring):
        chart_fields = [_dashboard_chart_fields[chart_name]]
    else:
        chart_fields = _dashboard_chart_fields[chart_name].values()
    records = data.gae_dashboard_reports(db, 'chart')
    date_record_pairs = time_series(records, 'utc_datetime')
    # TODO(chris): add support for grouping metrics to
    # gae-stats/metrics-in-time-series.html and then use that.
    return flask.render_template('gae-stats/dashboard-charts.html',
                                 title='Dashboard Charts',
                                 date_record_pairs=date_record_pairs,
                                 record_fields=chart_fields,
                                 chart_names=_dashboard_chart_fields.keys(),
                                 selected_chart=chart_name)
Example #7
0
def gae_stats_dashboard_charts():
    chart_name = flask.request.args.get('chart', 'Requests/Second')
    if chart_name not in _dashboard_chart_fields:
        return flask.current_app.response_class(
            'Unrecognized chart name: "%s"' % chart_name, status=400)

    if isinstance(_dashboard_chart_fields[chart_name], basestring):
        chart_fields = [_dashboard_chart_fields[chart_name]]
    else:
        chart_fields = _dashboard_chart_fields[chart_name].values()
    records = data.gae_dashboard_reports(db, 'chart')
    date_record_pairs = time_series(records, 'utc_datetime')
    # TODO(chris): add support for grouping metrics to
    # gae-stats/metrics-in-time-series.html and then use that.
    return flask.render_template('gae-stats/dashboard-charts.html',
                                 title='Dashboard Charts',
                                 date_record_pairs=date_record_pairs,
                                 record_fields=chart_fields,
                                 chart_names=_dashboard_chart_fields.keys(),
                                 selected_chart=chart_name)
Example #8
0
def gae_stats_memcache():
    selected_metric = flask.request.args.get("metric", "hit_ratio")
    # The tuples are (database_field_name, friendly_label).
    metrics = (
        ("hit_ratio", "hit ratio"),
        ("hit_count", "hit count"),
        ("miss_count", "miss count"),
        ("item_count", "item count"),
        ("total_cache_size_bytes", "total cache size (bytes)"),
        ("oldest_item_age_seconds", "oldest item age (seconds)"),
    )
    records = data.gae_dashboard_reports(db, "memcache")
    date_record_pairs = time_series(records, "utc_datetime")
    return flask.render_template(
        "gae-stats/metrics-in-time-series.html",
        title="Memcache Statistics",
        date_record_pairs=date_record_pairs,
        metrics=metrics,
        selected_metric=selected_metric,
    )