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
- Host: GitHub
- URL: https://github.com/pcolby/pcp-pmda-cpp
- Owner: pcolby
- License: bsl-1.0
- Created: 2013-11-29T10:03:26.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-02-05T22:32:41.000Z (over 6 years ago)
- Last Synced: 2024-08-02T15:37:33.717Z (10 months ago)
- Topics: boost, c-plus-plus, pcp
- Language: C++
- Homepage:
- Size: 3.06 MB
- Stars: 15
- Watchers: 3
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# [](#) PMDA++
[](https://travis-ci.org/pcolby/pcp-pmda-cpp)
[](https://coveralls.io/r/pcolby/pcp-pmda-cpp)
[](https://scan.coverity.com/projects/2973)
[](https://github.com/pcolby/pcp-pmda-cpp/releases/latest)
[](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
#includeclass 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].
[](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"