]> git.ipfire.org Git - ipfire.org.git/commitdiff
fireinfo: Drop old memory page
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Oct 2018 13:03:24 +0000 (13:03 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Oct 2018 13:03:24 +0000 (13:03 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/backend/fireinfo.py
src/templates/fireinfo/stats-memory.html [deleted file]
src/templates/fireinfo/stats.html
src/web/__init__.py
src/web/fireinfo.py

index a05d730c3fc10df6e8ce1aa2ea0f606cebe321f9..ade67f280693da0d4882128f187c8fc1e92cf77f 100644 (file)
@@ -146,7 +146,6 @@ templates_fireinfo_DATA = \
        src/templates/fireinfo/stats-cpus.html \
        src/templates/fireinfo/stats-geo.html \
        src/templates/fireinfo/stats.html \
-       src/templates/fireinfo/stats-memory.html \
        src/templates/fireinfo/stats-oses.html \
        src/templates/fireinfo/vendor.html \
        src/templates/fireinfo/vendors.html
index 80be0736147aabc8694a3ad265f2a67c2f7b1ad3..251c8845c680e24cb4725615a06425280e08b799 100644 (file)
@@ -1883,26 +1883,6 @@ class Fireinfo(Object):
 
                return sorted(ret, key=lambda x: x[1], reverse=True)
 
-       def get_common_memory_amounts(self, when=None):
-               amounts = (128, 256, 512, 1024, 2 * 1024, 4 * 1024, 8 * 1024, 16 * 1024, 32 * 1024, 64 * 1024)
-
-               ret = []
-               for amount in amounts:
-                       ret.append((amount, self.get_memory_amount(amount * 1024 * 0.95, when=when)))
-
-               return ret
-
-       def get_memory_amount(self, greather_than, when=None):
-               res = self.db.get("WITH profiles AS (SELECT fireinfo_profiles_with_data_at(%s) AS id) \
-                       SELECT COUNT(*)::float / (SELECT COUNT(*) FROM profiles \
-                       LEFT JOIN fireinfo_profiles_memory ON profiles.id = fireinfo_profiles_memory.profile_id \
-                       WHERE NOT fireinfo_profiles_memory.amount IS NULL) AS percentage FROM profiles \
-                       LEFT JOIN fireinfo_profiles_memory ON profiles.id = fireinfo_profiles_memory.profile_id \
-                       WHERE fireinfo_profiles_memory.amount >= %s", when, greather_than)
-
-               if res:
-                       return res.percentage
-
        def get_average_memory_amount(self, when=None):
                res = self.db.get("WITH profiles AS (SELECT fireinfo_profiles_with_data_at(%s) AS id) \
                        SELECT AVG(fireinfo_profiles_memory.amount) AS avg FROM profiles \
diff --git a/src/templates/fireinfo/stats-memory.html b/src/templates/fireinfo/stats-memory.html
deleted file mode 100644 (file)
index 7f42ee9..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-{% extends "../base.html" %}
-
-{% block title %}{{ _("Memory") }}{% end block %}
-
-{% block body %}
-       <div class="page-header">
-               <h1>{{ _("Memory") }}</h1>
-       </div>
-
-       <div class="row">
-               <div class="col-md-2 col-md-offset-2 ac">
-                       <small class="text-muted">({{ _("minimum") }})</small>
-                       <h3>{{ "%.0f" % (mem_min / 1024) }} {{ _("MB") }}</h3>
-               </div>
-               <div class="col-md-4 ac">
-                       <small class="text-muted">({{ _("average") }})</small>
-                       <h1 class="text-success">{{ "%.0f" % (mem_avg / 1024) }} {{ _("MB") }}</h1>
-               </div>
-               <div class="col-md-2 ac">
-                       <small class="text-muted">({{ _("maximum") }})</small>
-                       <h3>{{ "%.0f" % (mem_max / 1024) }} {{ _("MB") }}</h3>
-               </div>
-       </div>
-
-       <hr>
-
-       <dl class="dl-horizonal">
-               {% for amount, percentage in amounts %}
-                       {% if percentage >= 0.01 %}
-                               <dt>{{ _(">= %d MB") % amount }}</dt>
-                               <dd>
-                                       {% if amount <= 256 %}
-                                               {% module ProgressBar(percentage, "danger") %}
-                                       {% elif amount >= 1024 %}
-                                               {% module ProgressBar(percentage, "success") %}
-                                       {% else %}
-                                               {% module ProgressBar(percentage, "warning") %}
-                                       {% end %}
-                               </dd>
-                       {% end %}
-               {% end %}
-       </dl>
-{% end block %}
index b7f2c302ecc32ef5238186b02c44312067467eb9..a763caebf35152c507c866cf485bf16b1c5a719f 100644 (file)
                                <h4>
                                        <a href="/statistics/processors">{{ _("Processors") }}</a>
                                </h4>
-
-                               <h4>
-                                       <a href="/statistics/memory">{{ _("Memory") }}</a>
-                               </h4>
                        </div>
 
                        <div class="thumbnail ac">
index 4cca0adceb47f4c34b6f258f166afe847d30a88e..2e337d5eb87fa513ee551ec0840b7a693a4b2425 100644 (file)
@@ -203,7 +203,6 @@ class Application(tornado.web.Application):
                        (r"/statistics/processors", fireinfo.StatsProcessorsHandler),
                        (r"/statistics/processors/(arm|x86)", fireinfo.StatsProcessorDetailHandler),
                        (r"/statistics/geo-locations", fireinfo.StatsGeoHandler),
-                       (r"/statistics/memory", fireinfo.StatsMemoryHandler),
                        (r"/statistics/releases", fireinfo.StatsReleasesHandler),
                ])
 
index ca4446b5d7b6efc26ed8565485f41235d564299a..fdc790e2983a9b3aed602e32c1e18b3ea358b455 100644 (file)
@@ -235,22 +235,6 @@ class StatsProcessorDetailHandler(BaseHandler):
                        platform=platform, flags=flags)
 
 
-class StatsMemoryHandler(BaseHandler):
-       def get(self):
-               avg, stddev, min, max = self.fireinfo.get_memory_amounts(when=self.when)
-               amounts = self.fireinfo.get_common_memory_amounts(when=self.when)
-
-               data = {
-                       "mem_avg" : avg,
-                       "mem_stddev" : stddev,
-                       "mem_min" : min,
-                       "mem_max" : max,
-                       "amounts" : amounts,
-               }
-
-               return self.render("fireinfo/stats-memory.html", **data)
-
-
 class StatsReleasesHandler(BaseHandler):
        def get(self):
                data = {