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

System Metrics/Stats Library for Linux


Description

linux-metrics is a Python package containing modules for getting OS metrics on systems running the Linux kernel. It is a pure python library with no external dependencies.

Basic stats for major subsystems are provided (Processor/CPU, Disk, Memory, Network).

Install from PyPI

  • pip install linux-metrics

Requirements

  • Python 2.6/2.7/3.1/3.2/3.3/PyPy
  • Linux 2.6+

Example Usage

print number of processes running:

from linux_metrics import cpu_stat

print cpu_stat.procs_running()

print CPU utilization every 5 secs:

>>> from linux_metrics import cpu_stat
>>>
>>> while True:
...     cpu_pcts = cpu_stat.cpu_percents(5)
...     print 'cpu utilization: %.2f%%' % (100 - cpu_pcts['idle'])
...
cpu utilization: 0.70%
cpu utilization: 0.50%
cpu utilization: 24.80%
cpu utilization: 20.89%
cpu utilization: 40.04%

API

* linux_metrics
  * cpu_stat
    * cpu_times()
    * cpu_percents(sample_duration=1)
    * procs_running()
    * procs_blocked()
    * load_avg()
    * cpu_info()
  * disk_stat
    * disk_busy(device, sample_duration=1)
    * disk_reads_writes(device)
    * disk_usage(path)
    * disk_reads_writes_persec(device, sample_duration=1)
  * mem_stat
    * mem_stats()
  * net_stat
    * rx_tx_bytes(interface)
    * rx_tx_bits(interface)
    * rx_tx_dump(interface)

Example

linux-metrics package contains an example script:

Unit Tests

You can run the included unit tests and verify all cases pass in your environment:

$ nosetests

Note: you may need to adjust the configuration of the unit tests to match your environment. They are set by default to use:

DISK_DEVICE = 'sda1'

NETWORK_INTERFACE = 'eth0'
Release History

Release History

0.1.4

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.3

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.2

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
linux-metrics-0.1.4.tar.gz (5.9 kB) Copy SHA256 Checksum SHA256 Source Feb 12, 2013

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