Skip to main content

Monitor your (SimPy) simulation models or other objects and collect data from them.

Project description

Collectors was initially developed to monitor SimPy simulation models but it can also be used to monitor any Python objects and collect data from them.

Our main development goals were:

  • Ease of use (simple API, little typing)

  • Memory and CPU efficiency

    • No impact on simulation speed if you don’t use it.

    • As little impact as possible if you use it.

  • Flexibility and easy extensibility

  • Separation of data collection and data analysis

Simple usage example

>>> class Spam(object):
...     a = 1
...     b = 2
...
>>> spam = Spam()
>>>
>>> # Create and configure the collector
>>> col = Collector(
...     ('a', lambda: spam.a),
...     ('b', lambda: self.b)
... )
>>>
>>> # Collect all monitored variables (spam.a and spam.b)
>>> col()
>>> spam.a, spam.b = 3, 4
>>> col()
>>>
>>> # Get the collector’s data
>>> col
([1, 3], [2, 4])
>>> # You can also access it's elements by their name ...
>>> col.a
[1, 3]
>>> # ... or by their index
>>> col[1]
[2, 4]

Requirements

Collectors has only been tested with Python 2.6 but older versions should also work. Python 3.0 might also work; if not, we’ll put it on our schedule.

Installation

The easiest way to install Collectors is via PIP or distribute:

pip install Collectors

or

easy_install Collectors

If you downloaded the archive, execute:

python setup.py install

And finally, if you checked out the repository and always want to use the newest version, type:

pip install -e path/to/Collectors

or

pip install -e https+hg://bitbucket.org/scherfke/collectors/

Usage

The Documentation can be found in the docs/ directory or online.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Collectors-0.1.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file Collectors-0.1.tar.gz.

File metadata

  • Download URL: Collectors-0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Collectors-0.1.tar.gz
Algorithm Hash digest
SHA256 8e1acd7606e6f4d677c20dc19fb5aa341b6a744a2a645f4c6397d288b02d85b0
MD5 3e8ec78215ed4c1ced7e3cc1800792cf
BLAKE2b-256 52e3524a82199b4cda3ba08e12054833095ad2d1b20556bb75860a6dfd37ca17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page