An open API service indexing awesome lists of open source software.

https://github.com/pcolby/pcp-pmda-cpp

Header-only C++ library for writing PCP PMDAs
https://github.com/pcolby/pcp-pmda-cpp

boost c-plus-plus pcp

Last synced: 4 months ago
JSON representation

Header-only C++ library for writing PCP PMDAs

Awesome Lists containing this project

README

        

# [![PMDA++](https://f.cloud.github.com/assets/5195222/1797017/fcae7e82-6a9f-11e3-90e0-191374ae939b.png)](#) PMDA++
[![Build Status](https://img.shields.io/travis/pcolby/pcp-pmda-cpp/master.svg)](https://travis-ci.org/pcolby/pcp-pmda-cpp)
[![Coverage Status](https://img.shields.io/coveralls/pcolby/pcp-pmda-cpp.svg)](https://coveralls.io/r/pcolby/pcp-pmda-cpp)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/2973/badge.svg)](https://scan.coverity.com/projects/2973)
[![Github Release](https://img.shields.io/github/release/pcolby/pcp-pmda-cpp.svg)](https://github.com/pcolby/pcp-pmda-cpp/releases/latest)
[![Boost License](https://img.shields.io/badge/license-boost-blue.svg)](https://www.boost.org/users/license.html)

PMDA++ is a header-only library that allows developers to write Performance
Metrics Domain Agents (PMDAs) for [Performance Co-Pilot
(PCP)](http://pcp.io/) in C++.

### What is PCP?

> [Performance Co-Pilot (PCP)](http://pcp.io/) is an open source
infrastructure for monitoring, visualizing, recording, responding to,
and controlling the status, activity, and performance of networks, computers,
applications, and servers.
-- [Wikipedia](https://en.wikipedia.org/wiki/Performance_Co-Pilot)

### What is a PMDA?

PCP makes use of add-ons called Performance Metrics Domain Agents (PMDAs) to
fetch performance metrics for specific domains, such as database servers,
hardware, custom applications, etc.

For more information, see the [Performance Co-Pilot Programmer's
Guide](http://pcp.io/doc/pcp-programmers-guide.pdf).

### What is PMDA++?

PCP includes support for writing PMDAs in C, Perl and Python. PMDA++ is a
header-only library that allows developers to write PMDAs in C++. It is a
light C++ wrapper around PCP's C APIs.

Here is a complete, albeit very basic, PMDA written using PMDA++ that simply
returns the current time:

```c++
#include
#include
#include

class trivial : public pcp::pmda {

public:

virtual std::string get_pmda_name() const
{
return "trivial";
}

virtual int get_default_pmda_domain_number() const
{
return 250;
}

protected:

virtual pcp::metrics_description get_supported_metrics()
{
// trivial.time aka TRIVIAL:0:0.
return pcp::metrics_description()(0)
(0, "time",pcp::type(), PM_SEM_COUNTER,
pcp::units(0,1,0, 0,PM_TIME_SEC,0));
}

virtual fetch_value_result fetch_value(const metric_id &metric)
{
return pcp::atom(metric.type,time(NULL));
}

};

int main(int argc, char *argv[])
{
return pcp::pmda::run_daemon(argc, argv);
}
```

Compare that to PCP's official [trivial.c](https://github.com/performancecopilot/pcp/blob/master/src/pmdas/trivial/trivial.c) example.

### API Documentation

See the doxygen-generated [API documentation](
https://pcolby.github.io/pcp-pmda-cpp/api/annotated.html). Some additional
information is available on the [wiki].

## Benchmarks

Some basic [benchmarks](https://github.com/pcolby/pcp-pmda-cpp/wiki/Benchmarks) are availble on the [wiki].

[![simple numfetch](https://f.cloud.github.com/assets/5195222/1700167/56531708-5ff7-11e3-8baf-80d1f3c72234.png)](https://github.com/pcolby/pcp-pmda-cpp/wiki/Benchmarks)

## Requirements

PMDA++ requires little more than a modern C++ compiler and the PCP client libraries.

Additionaly, PMDA++ can make use of Boost libraries (though not required) to provide some enhanced functionaliy.

See the [requirements wiki page](https://github.com/pcolby/pcp-pmda-cpp/wiki/Requirements) for more details.

## Contributing

There are lots of way you can contribute, including (but not limited to):
* reviewing the code itself (its only 1K ~ 2K lines), looking for issues such as
bugs, portability issues, and the like.
* reviewing the API, suggesting improvments such as more intuitive naming and
future-proofing.
* identifying violations of the project's desired [conventions](https://github.com/pcolby/pcp-pmda-cpp/wiki/conventions).
* writing your own PMDA using PMDA++ to test it in real world applications.
* improving the [wiki] documentation.

Issues / suggestions can be reported via GitHub's [issue
tracker](https://github.com/pcolby/pcp-pmda-cpp/issues). Pull requests are very
welcome.

The [PMDA++ Google Group](https://groups.google.com/group/pcp-pmda-cpp/)
is used for general discussion, questions, comments, suggestions, announcements
etc. Email [email protected] to subscribe.

## License

PMDA++ code is available under the [OSI-approved](https://opensource.org/licenses/BSL-1.0)
[Boost Software License](https://www.boost.org/users/license.html).

PMDA++ relies on [PCP](http://pcp.io/) libraries (`libpcp` and `libpcp_pmda`),
which are [available under LGPL v2.1](http://pcp.io/faq.html#Q1b).

[wiki]: https://github.com/pcolby/pcp-pmda-cpp/wiki "PMDA++ Wiki"