[views] Stop giving stats / debug information relying on _sessions
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 10 Mar 2017 12:07:29 +0100
changeset 12026 c21b399c9269
parent 12025 ba79f4a4f5d8
child 12027 c62c80f20a82
[views] Stop giving stats / debug information relying on _sessions This is already broken when using pyramid anyway.
cubicweb/sobjects/services.py
cubicweb/web/views/debug.py
--- a/cubicweb/sobjects/services.py	Fri Mar 10 16:41:10 2017 +0100
+++ b/cubicweb/sobjects/services.py	Fri Mar 10 12:07:29 2017 +0100
@@ -50,7 +50,6 @@
             results['%s_cache_hit_percent' % title] = (hits * 100) / (hits + misses)
         results['type_cache_size'] = len(repo._type_cache)
         results['sql_no_cache'] = repo.system_source.no_cache
-        results['nb_open_sessions'] = len(repo._sessions)
         results['nb_active_threads'] = threading.activeCount()
         results['available_cnxsets'] = repo.cnxsets.qsize()
         results['threads'] = [t.name for t in threading.enumerate()]
--- a/cubicweb/web/views/debug.py	Fri Mar 10 16:41:10 2017 +0100
+++ b/cubicweb/web/views/debug.py	Fri Mar 10 12:07:29 2017 +0100
@@ -103,22 +103,6 @@
         pyvalue = [(sname, format_stat(sname, sval))
                     for sname, sval in sorted(stats.items())]
         self.wview('pyvaltable', pyvalue=pyvalue, header_column_idx=0)
-        # open repo sessions
-        if req.user.is_in_group('managers'):
-            w(u'<h3>%s</h3>' % _('opened sessions'))
-            sessions = repo._sessions.values()
-            if sessions:
-                w(u'<ul>')
-                for session in sessions:
-                    w(u'<li>%s (%s: %s)<br/>' % (
-                        xml_escape(text_type(session)),
-                        _('last usage'),
-                        strftime(dtformat, localtime(session.timestamp))))
-                    dict_to_html(w, session.data)
-                    w(u'</li>')
-                w(u'</ul>')
-            else:
-                w(u'<p>%s</p>' % _('no repository sessions found'))
         # web server information
         w(u'<h2>%s</h2>' % _('Web server'))
         pyvalue = ((_('base url'), req.base_url()),