Skip to main content

A Beaker extension to show the active sessions

Project description

BeakerShowSessions is a Beaker extension that shows the active sessions according to the given WSGI configuration file. Currently the plugin only works with ext:database session storage backend.

You can find the Mercurial repository at bitbucket.org

Installation

easy_install:

$ <env>/bin/easy_install BeakerCleanup

pip:

$ <env>/bin/pip install BeakerCleanup

Upgrading from a previous version

Note that in 0.1.3 the location of the session functions changed from beaker.scripts:get/show_sessions to beaker.scripts.sessions:get/show_sessions due to namespace issues.

Usage

You can call get_sessions in order to get a list of active sessions (dicts):

>>> from beaker.scripts.sessions import get_sessions
>>> get_sessions('cfg/production.ini')

BeakerShowSessions expects to find these keys in the [app:main] section of your configuration file

  • beaker.session.type = ext:database - the only supported backend (yet)

  • beaker.session.url - an SQLAlchemy engine URL

  • beaker.session.timeout - session timeout in seconds

  • beaker.session.table_name - (optional) session storage table. Defaults to beaker_cache.

If your beaker configuration directive prefix is not beaker.session (or you have multiple beaker instances) you can provide the correct prefix as a second option:

>>> get_sessions('cfg/prod.ini', 'bkr.sess')

If you are going to use BeakerShowSessions separately you could choose to call show_sessions instead. It takes the same parameters but returns a pretty ASCII table with results, like this:

>>> print show_sessions('cfg/prod.ini')
--------------------------------------------------------
     _accessed_time |      _creation_time |    user_name
--------------------------------------------------------
2001-02-03 10:11:12 | 2001-02-03 10:11:12 | john@doe.com

PasteCall provides a convenient method to call show_sessions from the console:

$ paster call beaker.scripts.sessions:show_sessions 'cfg/prod.ini' 'bkr.ses'
--------------------------------------------------------
     _accessed_time |      _creation_time |    user_name
--------------------------------------------------------
2001-02-03 10:11:12 | 2001-02-03 10:11:12 | john@doe.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

BeakerShowSessions-0.1.3.zip (8.2 kB view details)

Uploaded Source

BeakerShowSessions-0.1.3.tar.gz (3.5 kB view details)

Uploaded Source

Built Distributions

BeakerShowSessions-0.1.3-py2.6.egg (6.4 kB view details)

Uploaded Source

BeakerShowSessions-0.1.3-py2.5.egg (6.4 kB view details)

Uploaded Source

File details

Details for the file BeakerShowSessions-0.1.3.zip.

File metadata

File hashes

Hashes for BeakerShowSessions-0.1.3.zip
Algorithm Hash digest
SHA256 99f00c536221fcb3c40a58b936e661783001662642a2e2abe9af5c3666849ec9
MD5 0eaa7f51bc3d5cadea7fcc543f74a01c
BLAKE2b-256 8ec97755144fb93037c78543df2ccf7da33a39c57317c93fd7069b5ef55cc1b3

See more details on using hashes here.

File details

Details for the file BeakerShowSessions-0.1.3.tar.gz.

File metadata

File hashes

Hashes for BeakerShowSessions-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1c2bcb16a8c29f65d064390105141d98d6ec7856f80f12cf84609fdd45bf435d
MD5 3b68b614c11d73a55590a7a1c0b63a59
BLAKE2b-256 af3d1e7ab72207050032556a3fdb9ef53f3473827485b024af286d579a4d9a60

See more details on using hashes here.

File details

Details for the file BeakerShowSessions-0.1.3-py2.6.egg.

File metadata

File hashes

Hashes for BeakerShowSessions-0.1.3-py2.6.egg
Algorithm Hash digest
SHA256 d05b2de7c1d3db4ac7e4cd1a0931a16fdc3b8eacb86b73a6a36a46328fd1d242
MD5 5dea06642310c57bbd9c5531fcb59eea
BLAKE2b-256 8000d20ebedb345db3f79d3ff9e40d6b78c2573b5d48bbd1e606799db3a07716

See more details on using hashes here.

File details

Details for the file BeakerShowSessions-0.1.3-py2.5.egg.

File metadata

File hashes

Hashes for BeakerShowSessions-0.1.3-py2.5.egg
Algorithm Hash digest
SHA256 dbe67eacf99009102e515d5e31ad2b97153e0a3dc6ac68833084dd3600374394
MD5 89555588d9ad47b36881d2e24fb67a63
BLAKE2b-256 3bc3cd2a7e216e28ebc87c7e183436c22a2279f10b2d9bf8b4af29d2249c149b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page