] > blog entries (Logilab.org)

blog entries

apycot 0.12.1 released

2008/06/24 by Arthur Lutz

After one month of internship at logilab, I'm pleased to announce the 0.12.1 release of apycot.

for more information read the apycot 0.12.1 release note

You can also check the new sample configuration.

Pierre-Yves David


Instrumentation of google appengine's datastore.

2008/06/23 by Sylvain Thenault

Here is a piece of code I've written which I thought may be useful to some other people...

You'll find here a simple python module to use with the Google AppEngine SDK to monkey patch the datastore API in order to get an idea of the calls performed by your application.

To instrument of the datastore, put at the top level of your handler file

import instrdatastore

Note that it's important to have this before any other import in your application or in the google package to avoid that some modules will use the unpatched version of datastore functions (and hence calls to those functions wouldn't be considered).

Then add at the end of your handler function

instrdatastore.print_info()

The handler file should look like this:

"""my handler file with datastore instrumenting activated"""
import instrdatastore

# ... other initialization code

# main function so this handler module is cached
def main():
  from wsgiref.handlers import CGIHandler
  from ginco.wsgi.handler import ErudiWSGIApplication
  application = ErudiWSGIApplication(config, vreg=vreg)
  CGIHandler().run(application)
  instrdatastore.print_info()

if __name__ == "__main__":
  main()

Now you should see in your logs the number of Get/Put/Delete/Query which has been done during request processing

2008-06-23 06:59:12 - (root) WARNING: datastore access information
2008-06-23 06:59:12 - (root) WARNING: nb Get: 2
2008-06-23 06:59:12 - (root) WARNING: arguments (args, kwargs):
((datastore_types.Key.from_path('EGroup', u'key_users', _app=u'winecellar'),), {})
((datastore_types.Key.from_path('EUser', u'key_test@example.com', _app=u'winecellar'),), {})
2008-06-23 06:59:12 - (root) WARNING: nb Query: 1
2008-06-23 06:59:12 - (root) WARNING: arguments (args, kwargs):
(({'for_user =': None}, 'EProperty'), {})
2008-06-23 06:59:58 - (root) WARNING: nb Put: 1
2008-06-23 06:59:58 - (root) WARNING: arguments (args, kwargs):
(({u'login': None, u'last_usage_time': 1214204398.2022741, u'data': ""},), {})

I'll probably extend this as the time goes. Also notice you may encounter some problems with the automatic reloading feature of the dev app server when instrumentation is activated, in which case you should simply restart the web server.


pylint bugs day #2 on april 16, 2010

2010/03/22 by Sylvain Thenault

Hey guys,

we'll hold the next pylint bugs day on april 16th 2010 (friday). If some of you want to come and work with us in our Paris office, you'll be much welcome.

Else you can still join us on jabber / irc:

See you then!