Quick Start

1. Download

  • git clone CUP or download the released tar balls

2. Installation

  • run
python install

3. Doc & Wiki

Visit Wiki to see more details: Visit Doc site to see py-docs:

# Examples:
# 1. Get system info
import cup
# count cpu usage in interval, by default 60 seconds
from cup.res import linux
cpuinfo = linux.get_cpu_usage(intvl_in_sec=60)
print cpuinfo.usr

# total, available, percent, used, free, active, inactive, buffers, cached
from cup.res import linux
meminfo = linux.get_meminfo()
print meminfo.available


- Install python-nose before running the tests
- run `cd ./cup_tests; nosetests -s`

Contribute To CUP

- Commit code to GITHUB,
- Need to check pep8 and pylint rules before you start a pull request


- Github Issues


* Pexpect (under MIT license)
* Httplib2 (under MIT license)
* requests (under Apache V2 license)
* pymysql (under MIT license)


code directory tree:

    |--                module              Memory cache related module
    |--           module              Decorators of python
    |--                  module              Exception classes for CUP
    |--             module              Default
    |--                  module              CUP logging
    |--                 module              CUP Email module (send emails)
    |-- net                     package             Network operations, such as net handler parameter tuning
    |--                 module              Mixin operations
    |--            module              Cross-platform operations
    |-- res                     package             Resource usage queries (in /proc)、Process query、etc
    |-- shell                   package             Shell Operations、cross-hosts execution
    |-- services                package             Heartbeat、Threadpool based executors、file service、etc
    |-- thirdp                  package             Third-party modules: pexpect、httplib2
    |--             module              Time related module
    |--             module              Unittest、assert、noseClass
    |-- util                    package             ThreadPool、Interruptable-Thread、Rich configuration、etc
    |--              module              CUP Version

results matching ""

    No results matching ""