This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Simple python API Against Pingdom, that feature RUM extraction.

Coments

Please feel free to levae a coment (if instalation fail, or something is not working) on gitter at https://gitter.im/Epi10/pyngdom or send me a email at aleivag@gmail.com

Install

As usual

python setup.py install

Or as less ussual

pip install pyngdom

Or as less less usual

pip install git+https://github.com/Epi10/pyngdom

Getting Rum

If you are here is for the RUM (and that’s not a bad pirate’s pun).

We provide with 2 interfaces to pingdom rum, the first one its using a python-only aproach, and that will give you only today’s RUM information, that’s good if you don’t want to install extra dependencies or dont like/want selenium. for the second approach you’ll need selenium and a webbrowser, for testing, Firefox is fine, but if you really wnat to take advantage of the script you should really use PhantomJS (the default).

Examples will be placed in the example folder, and you can use the at will. i really recomend check the git repository to get the latest examples.

Python-Only method

Disclaimer, the RUM search is not part of the pingdom API, and its not supported by pingdom, so it can stop working at any time, use under your own risk. Also this method is harder to maintain than the selenium approach, so will take longer to fix if pingdom change anything.

So how it is use:

from pyngdom import PyngdomRum

pingdom = Pyngdom(
    username='user@epi10.cl',
    password='super-secret-password',
    apikey='6dz4mqdms0qaxrjstntf6myt6wz5vseg',
    account='owner@epi10.cl'
)
pingdom.login()

Now you need to know the rum test ID, that’s easy all you need to do is login into pingdom and then look for the RUM link in the reports page, the format of the rum link is https://my.pingdom.com/rum/XXXXXXXXXXX

here is a example

after you got the link all you need to do is

>>> rum = pingdom.today_rum('XXXXXXXXXXX')
>>> print rum
{
   u'allow_subdomains': False,
   u'total': {u'average': 2557,
        u'count': 40305,
        u'median': 1971.4791994493,
        u'p90': 4623.1101804124,
        u'p95': 5853.3586753731,
        u'p99': 10089.605}
   ....
   ....
   'url': 'http://epi10.cl'
}


#Get Total RUM
>> print rum['total']
{
    u'average': 2557,
    u'count': 40305,
    u'median': 1971.4791994493,
    u'p90': 4623.1101804124,
    u'p95': 5853.3586753731,
    u'p99': 10089.605
}



#Get RUM per geolocation that exist
>> print rum['geo'].get('us', {})
{
   u'average': 6657,
   u'count': 27,
   u'median': 5875.0625,
   u'p90': 9700.0416666667,
   u'p95': 10175.125,
   u'p99': 13435.125
}

# Get geographic zone (remember not all geographic zone exists)
>> print rum['geo'].get('jp', {})
{}

Also there is lots and lots of available information.

If you have selenium (and you should), use it.

If you have selenium (and even better PhantomJS [http://phantomjs.org/]) you should use it. This will open a new door to get RealTime RUM and its easy to implement and expand the PyndomDriver than the normal rum, from the user point of view, both methods should be interchangeable, but this will actually give you realtime RUM.

How do i use it?

First install selenium

pip install selenium

Now you are ready to use it

from pyngdom import PyngdomDriver

# If you want to use your native firefox (no extra install other than having your own firefox)

pingdom = PyngdomDriver(
    username='user@epi10.cl',
    password='super-secret-password',
    base_driver='Firefox'
)

#if you have phantomjs installed

pingdom = PyngdomDriver(
    username='user@epi10.cl',
    password='super-secret-password'
)

#then login
pingdom.login()

then its simple, you just get the checkid of your rum (see previous section) and then call it the same

>>> rum = pingdom.today_rum('XXXXXXXXXXX')
{
   u'allow_subdomains': False,
   u'total': {u'average': 2557,
        u'count': 40305,
        u'median': 1971.4791994493,
        u'p90': 4623.1101804124,
        u'p95': 5853.3586753731,
        u'p99': 10089.605}
   ....
   ....
   'url': 'http://epi10.cl'
}

And now the fun part, to get the realtime rum you just pick a sample interval (i.e. 30 seconds) and then you just

>>> rum = pingdom.realtime_rum('XXXXXXXXXXX', 30)
#30 seconds later

{
   u'allow_subdomains': False,
   u'total': {u'average': 2456,
        u'count': 15,
        u'median': 1971.4791994493,
        u'p90': 4623.1101804124,
        u'p95': 5853.3586753731,
        u'p99': 10089.605}
   ....
   ....
   'url': 'http://epi10.cl'
}

you can use with statements

with PyngdomDriver(username='user@epi10.cl', password='super-secret-password') as pingdom:
    realtime = pingdom.realtime_rum('XXXXXXXXXXX', 30)

And its just that simple… once again we strongly suggest using phantomjs, installit is so simple in linux and mac.

Extra API

If you need the standard pingom API, i recommend using https://pypi.python.org/pypi/PingdomLib , its mature and it is really simple to use. Never the less we include some extra functionality, using the standard pingdom API, only here because for some projects we really need them.

from pprint import pprint

from pyngdom import Pyngdom

pingdom = Pyngdom(
    username='user@epi10.cl',
    password='super-secret-password',
    apikey='6dz4mqdms0qaxrjstntf6myt6wz5vseg',
    account='owner@epi10.cl'
)

check_list = pingdom.get_check_list()

#print the check lists
pprint(check_list)

#get only the check for api.epi10.cl
api_epi10_check = filter(lambda x: x.get('hostname') == 'api.epi10.cl', check_list.get('checks', []))[0]

#print detailed information
print pingdom.get_detailed_check_information(api_epi10_check['id'])

and that how easy would you use it.

Changelog

0.1.2 2014-06-04

  • Fix (stupid) pypi error at install (we read the README.rst in setup.py, but we never include when we python setup.py sdist).

0.1.1 2014-06-04

  • Fix Documentation to include login.
  • Add example folders.

0.1.0 2014-06-03

  • initial commit
Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyngdom-0.1.2.tar.gz (5.6 kB) Copy SHA256 Checksum SHA256 Source Jun 6, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting