Skip to content
handful of useful shortcuts for creating common python gmond module metrics
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This package attempts to abstract out reusable python gmond metric extension 
functions and classes that I found myself rewriting again and again.

I've never written a or learned disutils.  For now, just copy the file 
into your existing PYTHONPATH or modify PYTHONPATH to include the location of

FILES: - a set of classes that provides iterator access to records 
    from non-blocking IO resources.

    unix's 'tail -f' is great for following files and keeping up with logs
    rotating underneath, but reading from it will block your gmond process.
    this was implemented with threading at first, but IMHO single proc, 
    single threaded is preferrable when possible.
    the intention is that this approach makes it easy to reuse code to pull 
    metrics off of other file descriptor resources ..sockets etc...
  - gmreader.GrecordReader - generic base class
      pass a file descriptor or file-like object(implements a fileno() methood) 
      and a record terminating pattern('\n')

  - gmreader.GlineReader - extends GrecordReader, 
      pass a file descriptor, it will iterate over '\n', 
      implements readline() and readlines() methods
  - gmreader.GlogReader - extends GlineReader, 
      pass a filename, use readline() or readlines()

  g = gmreader.GlineReader('/var/log/httpd/access.log')
  for line in g.readlines():
    print line

  check out * to see more detailed example
Something went wrong with that request. Please try again.