Skip to main content

call count extension for TimerMiddleware

Project description

To use the callcount script you will need to define your own runnable Python script. In that script will setup your callables.

Command Line Options

tm_callcount includes a default_args that you will need to use for your Python script. You can see the options by running –help.

Creating CountCases

This example assumes you have defined a custom TimerMiddleware for your application and that you have set a stats.sample_rate config value. See: http://pythonhosted.org/TimerMiddleware/quickstart.html

We do our extra setup outside of our count_ methods. This ensures that any setup we do is not included in the counts.

from myapp import db from myapp.tests import TestController

from twm_callcount import (

default_args, CountRunner, CountCase, )

class CountAppURL(CountCase):
def setUp(self):

self.test = TestController() self.create_test_data()

def tearDown(self):

self.test.tearDown()

def create_test_data(self):

db.add_page(‘Test Wiki’, ‘content’) db.add_ticket(‘Test Ticket’, ‘content’)

def count_wiki_page(self):

self.test.app.get(‘wiki’, extra_environ=self.environ)

def count_ticket_page(self):

self.test.app.get(‘ticket’, extra_environ=self.environ)

def main(args):

runner = CountRunner(args) runner([CountAppURL])

if __name__ == ‘__main__’:

main(default_args())

Project details


Download files

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

Source Distribution

tmw-callcount-0.1.3.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file tmw-callcount-0.1.3.tar.gz.

File metadata

  • Download URL: tmw-callcount-0.1.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tmw-callcount-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c8f7937944b7145741cac2f479b1392232e10b1cc24b06452df6f4293b1c8a65
MD5 ac9d754232771cc5bd3d49cdc350b120
BLAKE2b-256 d52751d60711403be01f87ff852b213ebdd3d67b2930869065ae8bebb1d6c386

See more details on using hashes here.

Supported by

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