Current File : //usr/share/lib/pkg/web/en/stats.shtml
## -*- coding: utf-8 -*-
##
##
## Copyright 2009, 2011 Oracle and/or its affiliates. All rights reserved.
##
<%inherit file="layout.shtml"/>\
<%page args="g_vars"/>\
<%
        catalog = g_vars["catalog"]
        config = g_vars["config"]
        request = g_vars["request"]
%>\
<%def name="page_title(g_vars)"><%
        return "Depot Statistics"
%></%def>\
<div id="yui-main" class="yui-b">
        <div class="yui-gb">
% if not config.mirror and request.publisher:
                <div class="yui-u first">
                <table class="stats" summary="A summary of high-level statistics
 about the package repository's catalog.">
                        <tr class="first">
                                <th scope="row" class="last" colspan="2">Catalog</th>
                        </tr>
                        <tr>
                                <td scope="row" class="label">Packages</td>
                                <td class="value">${catalog.package_count}</td>
                        </tr>
                        <tr>
                                <td scope="row" class="label">Last Modified</td>
<%
        # Note: last_modified() is in local time relative to the timezone where
        # catalog was last modified.
        lm = catalog.last_modified
        if lm:
                lm = lm.replace(microsecond=0)
        else:
                lm = "Never"
%>
                                <td class="value">${lm}</td>
                        </tr>
                </table>
                </div>
% endif
                <div class="yui-u">
                <table class="stats" summary="A summary of high-level statistics
 about this depot server.">
                        <tr class="first">
                                <th scope="row" class="last" colspan="2">Depot</th>
                        </tr>
                        <tr>
                                <td scope="row" class="label">Files served by filelist</td>
                                <td class="value">${config.filelist_file_requests}</td>
                        </tr>
% if not config.mirror:
                        <tr>
                                <td scope="row" class="label">In-flight Transactions</td>
                                <td class="value">${config.in_flight_transactions}</td>
                        </tr>
% endif
                </table>
                </div>
                <div class="yui-u">
                <table class="stats" summary="A list of the number of requests
 made to the depot server by operation.">
                        <tr class="first">
                                <th scope="row" class="last" colspan="2">Operations</th>
                        </tr>
% if not config.mirror:
                        <tr>
                                <td scope="row" class="label">catalog</td>
                                <td class="value">${config.catalog_requests}</td>
                        </tr>
% endif
                        <tr>
                                <td scope="row" class="label">file</td>
                                <td class="value">${config.file_requests}</td>
                        </tr>
                        <tr>
                                <td scope="row" class="label">filelist</td>
                                <td class="value">${config.filelist_requests}</td>
                        </tr>
% if not config.mirror:
                        <tr>
                                <td scope="row" class="label">manifest</td>
                                <td class="value">${config.manifest_requests}</td>
                        </tr>
% endif
                </table>
                </div>
        </div>
</div>