### PMNS Installation Output Example Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/libbpf/libbpf/docs/UAG/InstallingAndConfiguringPcp.md Illustrative output from the PMNS installation process, showing user interactions and system updates. This example demonstrates the prompts and confirmations during PMDA installation. ```text Example 2.1. PMNS Installation Output Cisco hostname or IP address? [return to quit] wanmelb A user-level password may be required for Cisco “show int” command. If you are unsure, try the command $ telnet wanmelb and if the prompt “Password:” appears, a user-level password is required; otherwise answer the next question with an empty line. User-level Cisco password? ******** Probing Cisco for list of interfaces ... Enter interfaces to monitor, one per line in the format tX where “t” is a type and one of “e” (Ethernet), or “f” (Fddi), or “s” (Serial), or “a” (ATM), and “X” is an interface identifier which is either an integer (e.g. 4000 Series routers) or two integers separated by a slash (e.g. 7000 Series routers). The currently unselected interfaces for the Cisco “wanmelb” are: e0 s0 s1 Enter “quit” to terminate the interface selection process. Interface? [e0] s0 The currently unselected interfaces for the Cisco “wanmelb” are: e0 s1 Enter “quit” to terminate the interface selection process. Interface? [e0] **s1** The currently unselected interfaces for the Cisco “wanmelb” are: e0 Enter “quit” to terminate the interface selection process. Interface? [e0] **quit** Cisco hostname or IP address? [return to quit] Updating the Performance Metrics Name Space (PMNS) ... Installing pmchart view(s) ... Terminate PMDA if already installed ... Installing files ... Updating the PMCD control file, and notifying PMCD ... Check cisco metrics have appeared ... 5 metrics and 10 values ``` -------------------------------- ### Example PMDA Installation Output Source: https://github.com/performancecopilot/pcp/blob/main/docs/UAG/CustomizingAndExtendingPcpServices.md Sample output from the PMDA installation script, indicating the steps performed during installation. ```none Interval between summary expression evaluation (seconds)? [10] 10 Updating the Performance Metrics Name Space... Installing pmchart view(s) ... Terminate PMDA if already installed ... Installing files .. Updating the PMCD control file, and notifying PMCD ... Wait 15 seconds for the agent to initialize ... ``` -------------------------------- ### Install PCP REST API and Valkey Service Source: https://github.com/performancecopilot/pcp/blob/main/docs/QG/QuickReferenceGuide.md Enable and start both the pmproxy and valkey services for REST API access. ```bash # systemctl enable --now pmproxy valkey ``` -------------------------------- ### Simple PMDA Configuration Example Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/libbpf/libbpf/docs/PG/WritingPMDA.md Illustrates the setup of instance identifiers, instance domains, and metric descriptions for a simple PMDA. ```c /* * list of instances */ static pmdaInstid color[] = { { 0, “red” }, { 1, “green” }, { 2, “blue” } }; static pmdaInstid *timenow = NULL; static unsigned int timesize = 0; /* * list of instance domains */ static pmdaIndom indomtab[] = { #define COLOR_INDOM 0 { COLOR_INDOM, 3, color }, #define NOW_INDOM 1 { NOW_INDOM, 0, NULL }, }; /* * all metrics supported in this PMDA - one table entry for each */ static pmdaMetric metrictab[] = { /* numfetch */ { NULL, { PMDA_PMID(0, 0), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_INSTANT, PMDA_PMUNITS(0, 0, 0, 0, 0, 0) }, }, /* color */ { NULL, { PMDA_PMID(0, 1), PM_TYPE_32, COLOR_INDOM, PM_SEM_INSTANT, PMDA_PMUNITS(0, 0, 0, 0, 0, 0) }, }, /* time.user */ { NULL, { PMDA_PMID(1, 2), PM_TYPE_DOUBLE, PM_INDOM_NULL, PM_SEM_COUNTER, PMDA_PMUNITS(0, 1, 0, 0, PM_TIME_SEC, 0) }, }, /* time.sys */ { NULL, { PMDA_PMID(1,3), PM_TYPE_DOUBLE, PM_INDOM_NULL, PM_SEM_COUNTER, PMDA_PMUNITS(0, 1, 0, 0, PM_TIME_SEC, 0) }, }, /* now */ { NULL, { PMDA_PMID(2,4), PM_TYPE_U32, NOW_INDOM, PM_SEM_INSTANT, PMDA_PMUNITS(0, 0, 0, 0, 0, 0) }, }, }; ``` -------------------------------- ### Build PCP Prerequisites Source: https://github.com/performancecopilot/pcp/blob/main/build/mac/AGENTS.md Run this one-time setup command to build the entire PCP project, including generating headers, building libraries, and installing PCP. This is a prerequisite for using quick build workflows. ```bash cd ./Makepkgs --verbose ``` -------------------------------- ### Run First-Time Setup Validation Source: https://github.com/performancecopilot/pcp/blob/main/AGENTS.md Performs an initial validation of the QA setup. This is a crucial step for new installations or testing environments. ```bash # First-time setup validation cd qa && ./check 000 ``` -------------------------------- ### PMDA Installation Script Example Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/libbpf/libbpf/docs/UAG/InstallingAndConfiguringPcp.md The 'Install' script within a PMDA directory is used to install the PMDA, update the PMNS, and restart the PMCD daemon. ```bash Install ``` -------------------------------- ### Install Script for the Trivial PMDA Source: https://github.com/performancecopilot/pcp/blob/main/docs/PG/WritingPMDA.md This script demonstrates a basic installation process for a PMDA using generic procedures. It sources environment variables and library scripts, sets the PMDA name, and then calls setup and install functions. ```none . ${PCP_DIR}/etc/pcp.env . ${PCP_SHARE_DIR}/lib/pmdaproc.sh iam=trivial pmdaSetup pmdainstall exit ``` -------------------------------- ### Start HTTP Server Source: https://github.com/performancecopilot/pcp/blob/main/build/ci/allure/README.md Manually start an HTTP server to access the report. Ensure Python 3 is installed. ```bash python3 -m http.server --bind 127.0.0.1 ``` -------------------------------- ### Setup Test Clusters Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/valkey-io/libvalkey/tests/CMakeLists.txt Configures and starts test clusters, supporting both Valkey and Redis versions. Additional options for authentication and host binding can be specified. ```cmake set(CLUSTER_SCRIPT "${CMAKE_SOURCE_DIR}/tests/scripts/valkey-cluster") set(CLUSTER_VERSION "VALKEY_VERSION=${TEST_WITH_VALKEY_VERSION}") add_custom_target(start COMMAND PORT=7000 ${CLUSTER_VERSION} ${CLUSTER_SCRIPT} start COMMAND PORT=7100 ${CLUSTER_VERSION} ADDITIONAL_OPTIONS='--requirepass secretword --masterauth secretword' ADDITIONAL_CLI_OPTIONS='-a secretword' ${CLUSTER_SCRIPT} start COMMAND ${NO_IPV6} PORT=7200 ${CLUSTER_VERSION} CLUSTER_HOST=::1 ADDITIONAL_OPTIONS='--bind ::1' ADDITIONAL_CLI_OPTIONS='-h ::1' ${CLUSTER_SCRIPT} start ) ``` ```cmake add_custom_target(stop COMMAND PORT=7000 ${CLUSTER_SCRIPT} stop COMMAND PORT=7100 ${CLUSTER_SCRIPT} stop COMMAND ${NO_IPV6} PORT=7200 ${CLUSTER_SCRIPT} stop ) ``` -------------------------------- ### Install PCP REST API Service Source: https://github.com/performancecopilot/pcp/blob/main/docs/QG/QuickReferenceGuide.md Enable and start the pmproxy service to provide a REST API for performance metrics. ```bash # systemctl enable --now pmproxy ``` -------------------------------- ### PMDA Help Text Example Source: https://github.com/performancecopilot/pcp/blob/main/docs/PG/WritingPMDA.md This example demonstrates the format for terse and verbose help text for PMDA metrics and instance domains. Each entry starts with '@' followed by the metric or instance domain name and a short description. Verbose descriptions follow on subsequent lines, terminated by another '@' line or end of file. ```none @ SIMPLE.0 Instance domain “colour” for simple PMDA Universally 3 instances, “red” (0), “green” (1) and “blue” (3). @ SIMPLE.1 Dynamic instance domain “time” for simple PMDA An instance domain is computed on-the-fly for exporting current time information. Refer to the help text for simple.now for more details. @ simple.numfetch Number of pmFetch operations. The cumulative number of pmFetch operations directed to “simple” PMDA. This counter may be modified with pmstore(1). @ simple.color Metrics which increment with each fetch This metric has 3 instances, designated “red”, “green” and “blue”. The value of the metric is monotonic increasing in the range 0 to 255, then back to 0. The different instances have different starting values, namely 0 (red), 100 (green) and 200 (blue). The metric values my be altered using pmstore(1). @ simple.time.user Time agent has spent executing user code The time in seconds that the CPU has spent executing agent user code. @ simple.time.sys Time agent has spent executing system code The time in seconds that the CPU has spent executing agent system code. @ simple.now Time of day with a configurable instance domain The value reflects the current time of day through a dynamically reconfigurable instance domain. On each metric value fetch request, the agent checks to see whether the configuration file in ${PCP_PMDAS_DIR}/simple/simple.conf has been modified - if it has then the file is re-parsed and the instance domain for this metric is again constructed according to its contents. This configuration file contains a single line of comma-separated time tokens from this set: “sec” (seconds after the minute), “min” (minutes after the hour), “hour” (hour since midnight). An example configuration file could be: sec,min,hour and in this case the simple.now metric would export values for the three instances “sec”, “min” and “hour” corresponding respectively to the components seconds, minutes and hours of the current time of day. The instance domain reflects each token present in the file, and the values reflect the time at which the PMDA processes the fetch. ``` -------------------------------- ### Build PCP Package with Nix Source: https://github.com/performancecopilot/pcp/blob/main/docs/HowTos/nix/index.md Builds the PCP package using Nix. This is the recommended way to get started. ```bash nix build ``` -------------------------------- ### Install iniH using vcpkg Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/benhoyt/inih/README.md Clone the vcpkg repository, bootstrap it, integrate it with your system, and then install the iniH package. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install inih ``` -------------------------------- ### Add Valkey Examples Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/valkey-io/libvalkey/CMakeLists.txt Conditionally adds the examples subdirectory to the build if the ENABLE_EXAMPLES option is set. ```cmake IF(ENABLE_EXAMPLES) ADD_SUBDIRECTORY(examples) ENDIF(ENABLE_EXAMPLES) ``` -------------------------------- ### Install QA Dependencies Source: https://github.com/performancecopilot/pcp/blob/main/AGENTS.md Lists and installs the necessary dependencies for QA testing on your specific platform. ```bash # Install dependencies for your platform qa/admin/list-packages -m ``` -------------------------------- ### Configure, Build, and Install PCP Source: https://github.com/performancecopilot/pcp/blob/main/INSTALL.md Configures the build process with specified directories, compiles the source code, and installs the package. This is part of the manual installation process. ```bash $ ./configure --prefix=/usr --libexecdir=/usr/lib --sysconfdir=/etc \ --localstatedir=/var --with-rcdir=/etc/init.d $ make $ su root # make install ``` -------------------------------- ### MacOS Installation Command Source: https://github.com/performancecopilot/pcp/blob/main/INSTALL.md Open the PCP .dmg file on MacOS to begin the installation process. ```bash $ open pcp-X.Y.Z-N.dmg ``` -------------------------------- ### Install bpftool Man Pages Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/libbpf/bpftool/README.md Install the generated bpftool man pages on the system. ```console $ cd docs # make install ``` -------------------------------- ### Navigate to PMDA Directory for Installation Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/libbpf/libbpf/docs/UAG/InstallingAndConfiguringPcp.md Change to the specific PMDA's directory to begin the installation process. This is a prerequisite for running the 'Install' script. ```bash cd ${PCP_PMDAS_DIR}/cisco ``` -------------------------------- ### Install pmdastatsd Agent Source: https://github.com/performancecopilot/pcp/blob/main/src/pmdas/statsd/README.md Execute the install script to set up the pmdastatsd agent. This should be run as root. ```bash cd $PCP_PMDAS_DIR/statsd ./Install ``` -------------------------------- ### Start MicroVM Source: https://github.com/performancecopilot/pcp/blob/main/docs/HowTos/nix/index.md Starts the MicroVM in the foreground. This command assumes the MicroVM has already been built. ```bash ./result-eval/bin/microvm-run ``` -------------------------------- ### Install PCP Client Package Source: https://github.com/performancecopilot/pcp/blob/main/docs/QG/RecordMetricsFromRemoteSystem.md Installs the Performance Co-Pilot (PCP) package on client systems. ```bash # dnf -y install pcp ``` -------------------------------- ### Install libvalkey Library Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/valkey-io/libvalkey/CMakeLists.txt Installs the built libvalkey library and associated files. ```cmake INSTALL(TARGETS valkey EXPORT valkey-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ``` -------------------------------- ### Install Pkgconfig File Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/valkey-io/libvalkey/CMakeLists.txt Installs the Valkey pkgconfig file, which is used by other projects to find and link against the Valkey library. ```cmake INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/valkey.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ``` -------------------------------- ### Install and Enable New Framework Action Source: https://github.com/performancecopilot/pcp/blob/main/html/howto.enterprise.html Install a new pmieconf file and enable the corresponding framework action for all rules, then restart pmie. ```bash # pmieconf modify global new_action yes # $PCP_RC_DIR/pmie start ``` -------------------------------- ### Setup and Run Disk Performance Analysis Source: https://github.com/performancecopilot/pcp/blob/main/html/howto.diskperf.html This snippet sets up the necessary environment and launches pmchart to visualize disk and CPU activity. It's useful for observing I/O patterns and their impact on CPU wait times. ```bash $ source /etc/pcp.conf $ tar xzf $PCP_DEMOS_DIR/tutorials/diskperf.tgz $ pmchart -t 2sec -O -0sec -a diskperf/waitio -c diskperf/waitio.view ``` -------------------------------- ### Create Mounts Directory and Navigate Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/libbpf/libbpf/docs/QG/SetupAutomatedRules.md Navigate to the pmieconf directory and create a 'mounts' subdirectory to store rule configurations. ```bash cd /var/lib/pcp/config/pmieconf sudo su mkdir mounts cd mounts ``` -------------------------------- ### Install Python Build Dependencies Source: https://github.com/performancecopilot/pcp/blob/main/build/mac/MACOS_DEVELOPMENT.md Installs the 'uv' package manager and runs a setup script for Python environment dependencies. ```bash brew install uv ./build/mac/setup-python-env.sh ``` -------------------------------- ### Setup TAP Networking and Run MicroVM Source: https://github.com/performancecopilot/pcp/blob/main/docs/HowTos/nix/index.md Use these commands to set up TAP networking, build, and run a MicroVM for direct network access. Requires sudo for network setup. ```bash # Verify host environment nix run .#pcp-check-host # Create bridge, TAP device, and NAT rules (requires sudo) sudo nix run .#pcp-network-setup # Build and run TAP-enabled VM nix build .#pcp-microvm-eval-tap ./result/bin/microvm-run # VM is now accessible at 10.177.0.20 ssh root@10.177.0.20 pminfo -h 10.177.0.20 kernel.all.load # Cleanup when done nix run .#pcp-vm-stop sudo nix run .#pcp-network-teardown ``` -------------------------------- ### Start Valkey Cluster with Docker Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/valkey-io/libvalkey/CONTRIBUTING.md Use 'make start' to initiate Valkey cluster instances using Docker. This is a prerequisite for running cluster tests. ```bash make start ``` -------------------------------- ### Set up PCP Demo Environment Source: https://github.com/performancecopilot/pcp/blob/main/html/howto.diskmodel.html This command sets up the PCP disk model demo environment by sourcing configuration, extracting demo files, and running the pmafm tool with pmchart. ```bash source /etc/pcp.conf tar xzf $PCP_DEMOS_DIR/tutorials/diskmodel.tgz cd diskmodel echo * pmafm model.folio run pmchart -t 15 -c model.view ``` -------------------------------- ### Verify Python Dependency Setup Source: https://github.com/performancecopilot/pcp/blob/main/build/mac/AGENTS.md Run this command to verify that the Python dependencies required for PCP's Python PMDAs have been correctly installed. ```bash cd dev/darwin make check-deps ``` -------------------------------- ### Start pmchart for monitoring Source: https://github.com/performancecopilot/pcp/blob/main/docs/QG/ConfigureAutomatedReasoning.md Launches pmchart to visualize system performance metrics with a 0.5-second update interval. ```bash $ pmchart -t 0.5sec -c CPU & ``` -------------------------------- ### C: Example Usage of pmPrintValue Source: https://github.com/performancecopilot/pcp/blob/main/docs/PG/PMAPI.md Illustrates using pmPrintValue to print metric values fetched by pmFetch. Requires setup of PMAPI context and metric descriptors. ```c int numpmid, i, j, sts; pmID pmidlist[10]; pmDesc desc[10]; pmResult *result; /* set up PMAPI context, numpmid and pmidlist[] ... */ /* get metric descriptors */ for (i = 0; i < numpmid; i++) { if ((sts = pmLookupDesc(pmidlist[i], &desc[i])) < 0) { printf("pmLookupDesc(pmid=%s): %s\n", pmIDStr(pmidlist[i]), pmErrStr(sts)); exit(1); } } if ((sts = pmFetch(numpmid, pmidlist, &result)) >= 0) { /* once per metric */ for (i = 0; i < result->numpmid; i++) { printf("PMID: %s", pmIDStr(result->vset[i]->pmid)); /* once per instance for this metric */ for (j = 0; j < result->vset[i]->numval; j++) { printf(" [%d]", result->vset[i]->vlist[j].inst); pmPrintValue(stdout, result->vset[i]->valfmt, desc[i].type, &result->vset[i]->vlist[j], 8); } putchar('\n'); } pmFreeResult(result); } else printf("pmFetch: %s\n", pmErrStr(sts)); ``` -------------------------------- ### Start and Configure Minikube for PCP Testing Source: https://github.com/performancecopilot/pcp/blob/main/docs/HowTos/nix/index.md Launches Minikube with optimized settings for PCP testing, including 4 CPUs, 8GB RAM, and using the Docker driver. ```bash nix run .#pcp-minikube-start ``` -------------------------------- ### libbpf API Documentation Example Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/libbpf/libbpf/docs/libbpf_naming_convention.md Example of a libbpf API comment in btf.h, demonstrating the use of @brief, @param, and @return directives for documentation generation. ```c /** * @brief **btf__new()** creates a new instance of a BTF object from the raw * bytes of an ELF's BTF section * @param data raw bytes * @param size number of bytes passed in `data` * @return new BTF object instance which has to be eventually freed with * **btf__free()** * * On error, error-code-encoded-as-pointer is returned, not a NULL. To extract * error code from such a pointer `libbpf_get_error()` should be used. If * `libbpf_set_strict_mode(LIBBPF_STRICT_CLEAN_PTRS)` is enabled, NULL is * returned on error instead. In both cases thread-local `errno` variable is * always set to error code as well. */ ``` -------------------------------- ### pmie Syslog Action Example Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/libbpf/libbpf/docs/UAG/PerformanceMetricsInferenceEngine.md Illustrates the 'syslog' action for writing messages to the system log. Supports priority specification if the message starts with '-p ', with 'pcp-pmie' as the message tag. ```default syslog("-p ", "message") ``` ```default syslog("message") ``` -------------------------------- ### Deploy and Run Elasticsearch Source: https://github.com/performancecopilot/pcp/blob/main/html/howto.systemlog.html A basic setup for Elasticsearch involves downloading, untarring, and running the Elasticsearch executable. This provides a working solution for indexing log messages. ```bash bin/elasticsearch -f ``` -------------------------------- ### pmie Identifier Examples Source: https://github.com/performancecopilot/pcp/blob/main/docs/UAG/PerformanceMetricsInferenceEngine.md Identifiers in pmie start with an alphabetic character followed by letters, digits, periods, or underscores. Arbitrary sequences of letters enclosed in apostrophes are also valid identifiers. ```none x, disk.dev.total and my_stuff 'vms$slow_response' ``` -------------------------------- ### Initialize Quick Build Environment Source: https://github.com/performancecopilot/pcp/blob/main/dev/darwin/AGENTS.md Set up the local PMDA environment for quick building. This script should be run after the full build has generated the required libraries and headers. ```bash ./setup-local-pcp.sh ``` -------------------------------- ### Define New PMNS Metrics Source: https://github.com/performancecopilot/pcp/blob/main/docs/UAG/CustomizingAndExtendingPcpServices.md Example of adding new metric names and their corresponding PMIDs to the summary PMNS file. Ensure PMNS names start with 'summary' and PMIDs are unique. ```none summary { cpu disk netif fs /*new*/ } summary.fs { cache_write SYSSUMMARY:0:10 cache_hit SYSSUMMARY:0:11 } ``` -------------------------------- ### Start PMCD Daemon on Linux Source: https://github.com/performancecopilot/pcp/blob/main/INSTALL.md Demonstrates various methods to start the Performance Metrics Collection Daemon (PMCD) on Linux systems. This is a crucial post-installation step. ```bash $ su root # systemctl start pmcd (or...) # service pmcd start (or...) # /etc/init.d/pmcd start (or...) # /etc/rc.d/init.d/pmcd start ``` -------------------------------- ### Run Full CI Pipeline Locally Source: https://github.com/performancecopilot/pcp/blob/main/build/ci/README.md Execute the complete CI pipeline for a specified platform, including setup, build, installation, and QA sanity checks. Use this to test your changes against a full workflow. ```bash build/ci/ci-run.py ubuntu2404-container reproduce --until qa_sanity ``` -------------------------------- ### Execute Asynchronous Valkey Commands with Callbacks Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/valkey-io/libvalkey/docs/standalone.md Send commands asynchronously and process their replies using callback functions. This example shows how to handle `INCRBY` and `GET` commands, passing custom application data to the callbacks. ```c struct my_app_data { size_t incrby_replies; size_t get_replies; }; void my_incrby_callback(valkeyAsyncContext *ac, void *r, void *privdata) { struct my_app_data *data = privdata; valkeyReply *reply = r; assert(reply != NULL && reply->type == VALKEY_REPLY_INTEGER); printf("Incremented value: %lld\n", reply->integer); data->incrby_replies++; } void my_get_callback(valkeyAsyncContext *ac, void *r, void *privdata) { struct my_app_data *data = privdata; valkeyReply *reply = r; assert(reply != NULL && reply->type == VALKEY_REPLY_STRING); printf("Key value: %s\n", reply->str); data->get_replies++; } int exec_some_commands(struct my_app_data *data) { valkeyAsyncCommand(ac, my_incrby_callback, data, "INCRBY mykey %d", 42); valkeyAsyncCommand(ac, my_get_callback, data, "GET %s", "mykey"); } ``` -------------------------------- ### Summarize Archive Information with pmlogsummary Source: https://github.com/performancecopilot/pcp/blob/main/docs/UAG/ArchiveLogging.md Use pmlogsummary to get statistical summaries of specific metrics within PCP archives. This example shows how to report on anonymous huge pages usage for a Linux host, including average, maximum, and units. ```none pmlogsummary -MIly ${PCP_LOG_DIR}/pmlogger/pluto/20170815 mem.util.anonhugepages Performance metrics from host pluto commencing Thu Aug 15 00:10:12.318 2017 ending Fri Aug 16 00:10:12.299 2017 mem.util.anonhugepages 7987742.326 8116224.000 15:02:12.300 1437 Kbyte ``` ```bash pminfo -t mem.util.anonhugepages mem.util.anonhugepages [amount of memory in anonymous huge pages] ``` -------------------------------- ### Start Minikube for Kubernetes Testing Source: https://github.com/performancecopilot/pcp/blob/main/docs/HowTos/nix/index.md Starts a Minikube instance, which is a prerequisite for deploying PCP as a privileged DaemonSet for Kubernetes testing. ```bash # Start minikube (if not running) nix run .#pcp-minikube-start ``` -------------------------------- ### Install PCP on Debian/Ubuntu Source: https://github.com/performancecopilot/pcp/blob/main/docs/HowTos/installation/index.md Installs PCP using apt-get. Ensure your system is up-to-date before installing. ```bash $ sudo apt-get update $ sudo apt-get install pcp-zeroconf ``` -------------------------------- ### Build and Install Default Library with Make Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/valkey-io/libvalkey/README.md Installs the default Libvalkey library using make. Ensure you have the necessary build tools and permissions. ```bash sudo make install ``` -------------------------------- ### Install PCP on Fedora/RHEL/CentOS Source: https://github.com/performancecopilot/pcp/blob/main/docs/HowTos/installation/index.md Installs PCP using dnf. Ensure your system is up-to-date before installing. ```bash $ sudo dnf update $ sudo dnf install pcp-zeroconf ``` -------------------------------- ### Install shping PMDA Source: https://github.com/performancecopilot/pcp/blob/main/docs/QG/ConfigureAutomatedReasoning.md Installs the shping PMDA (Performance Data Management Agent) by navigating to its directory and running the install script. ```bash # cd $PCP_PMDAS_DIR/shping # ./Install ``` -------------------------------- ### Construct Custom 3D Scenes with pmview Source: https://github.com/performancecopilot/pcp/blob/main/docs/QG/Use3DViews.md Display a custom pmview scene by providing a configuration file. This example uses 'pmie/example.view' to show load averages and disk I/O metrics. ```bash $ pmview < pmie/example.view ``` -------------------------------- ### Start pmchart Source: https://github.com/performancecopilot/pcp/blob/main/docs/QG/GraphPerformanceMetric.md Launch the pmchart application from the command line to begin graphing performance metrics. ```bash pmchart ``` -------------------------------- ### Install RPM Packages Source: https://github.com/performancecopilot/pcp/blob/main/INSTALL.md Installs PCP .rpm packages on Red Hat-based systems. Ensure you are in the correct build directory and use sudo for installation. ```bash $ cd pcp-/build/rpm $ sudo rpm -U `ls -1 *.rpm | sed -e '/\.src\.rpm$/d'` ``` -------------------------------- ### Install pmdarsyslog Source: https://github.com/performancecopilot/pcp/blob/main/html/howto.systemlog.html This command installs the pmdarsyslog Performance CoPilot Data Access module, which exports rsyslog metrics. Ensure the pcp.env environment is sourced before installation. ```bash # source /etc/pcp.env # pminstall pmdarsyslog ``` -------------------------------- ### Build static libbpf and install Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/libbpf/libbpf/README.md Builds only the static libbpf.a library in a specified build directory and installs headers into a staging directory. ```bash cd src mkdir build root BUILD_STATIC_ONLY=y OBJDIR=build DESTDIR=root make install ``` -------------------------------- ### Install Valkey Package Configuration Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/valkey-io/libvalkey/CMakeLists.txt Installs the generated Valkey CMake package configuration files to the specified installation directory. This makes Valkey discoverable by other CMake projects. ```cmake INSTALL(EXPORT valkey-targets FILE valkey-targets.cmake NAMESPACE valkey:: DESTINATION ${CMAKE_CONF_INSTALL_DIR}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/valkey-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/valkey-config-version.cmake DESTINATION ${CMAKE_CONF_INSTALL_DIR}) ``` -------------------------------- ### Install Custom Summary PMDA Source: https://github.com/performancecopilot/pcp/blob/main/docs/UAG/CustomizingAndExtendingPcpServices.md Execute the Install script from the summary PMDA directory to install the customized PMDA. This prompts for evaluation intervals and updates PMNS and PMCD. ```default ./Install ``` -------------------------------- ### PMIE Configuration File Example Source: https://github.com/performancecopilot/pcp/blob/main/docs/UAG/PerformanceMetricsInferenceEngine.md This snippet shows the content of two PMIE configuration files: a general config.demo and a specific swap_low rule file. These files are simple text files used by pmieconf. ```text file ${PCP_SYSCONF_DIR}/pmie/config.demo ${PCP_SYSCONF_DIR}/pmie/config.demo: PCP pmie config (V.1) file ${PCP_VAR_DIR}/config/pmieconf/memory/swap_low ${PCP_VAR_DIR}/config/pmieconf/memory/swap_low: PCP pmieconf rules (V.1) ``` -------------------------------- ### Install PCP Manually Source: https://github.com/performancecopilot/pcp/blob/main/AGENTS.md Installs PCP manually after it has been built from source. ```bash # Install manually after building sudo make install ``` -------------------------------- ### Run Full Build for Prerequisites Source: https://github.com/performancecopilot/pcp/blob/main/dev/darwin/AGENTS.md Execute the full build process once to generate necessary headers and libraries before using the quick build tools. This is a prerequisite for the quick build environment. ```bash cd && ./Makepkgs --verbose ``` -------------------------------- ### Build and Install Library with Make and Options Source: https://github.com/performancecopilot/pcp/blob/main/vendor/github.com/valkey-io/libvalkey/README.md Builds and installs Libvalkey with optional features like TLS and RDMA enabled. Specify the OpenSSL prefix if it's in a non-default location. ```bash sudo USE_TLS=1 USE_RDMA=1 make install ``` ```bash sudo USE_TLS=1 OPENSSL_PREFIX=/path/to/openssl make install ``` -------------------------------- ### Install Apache PMDA Source: https://github.com/performancecopilot/pcp/blob/main/INSTALL.md Installs the Apache Performance Metrics Domain Agent (PMDA) to monitor web server metrics. This involves navigating to the PMDA directory and running its install script. ```bash $ su root # cd $PCP_PMDAS_DIR/apache (i.e. cd /var/pcp/pmdas/apache) # ./Install # Check everything is working OK ```