Skip to content

Commit

Permalink
cockpit: Implement PCP metrics channel in the Python bridge
Browse files Browse the repository at this point in the history
The Python bridge still used the separate `cockpit-pcp` bridge for
metrics gathering. For us to remove the full C bridge implementation the
separate PCP bridge also has to be rewritten.

This rewrite is a more or less Python copy of the C implementation using
the Python PCP module. Even though the Python PCP module offers a
"higher level" fetchGroup API but preliminary testing has found this has
some issues with changing multi instance values and instances can not be
omitted with a fetch group (but this can be done in our own code)

Co-Authored-By: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Co-Authored-By: Tomas Matus <tomatus777@gmail.com>
  • Loading branch information
3 people committed Sep 23, 2024
1 parent 74f3569 commit fdf20b7
Show file tree
Hide file tree
Showing 16 changed files with 1,360 additions and 46 deletions.
5 changes: 0 additions & 5 deletions pkg/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ EXTRA_DIST += \
$(pixmaps_DATA) \
$(NULL)

if ENABLE_PCP
pcpmanifestdir = $(datadir)/cockpit/pcp
dist_pcpmanifest_DATA = pkg/pcp/manifest.json
endif

# one built file in dist/ which we use as dependency
DIST_STAMP = $(srcdir)/dist/static/manifest.json

Expand Down
11 changes: 0 additions & 11 deletions pkg/pcp/manifest.json

This file was deleted.

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ module = [
"libvirt_qemu",
"pika",

# run without pcp module types
"pcp",
"cpmapi",

# run without gobject-introspection (used from cockpit-client for Gtk)
"gi.*",

Expand Down Expand Up @@ -158,6 +162,7 @@ ignore_names = [
"do_*",
"pytest_*",
"test[A-Z0-9]*",
"pytestmark",
]
ignore_decorators = [
"@*.getter",
Expand Down Expand Up @@ -200,6 +205,8 @@ wheel_build_env = pkg
# All other environments (names like py311-lint, py36-pytest, etc) are isolated
# from the system and get their packages from PyPI, according to the specific
# test environment being requested. We build the wheel in a common environment.
# These tests will not run the PCP tests as there is no wheel available.
# https://github.com/performancecopilot/pcp/issues/2076
[testenv]
package = wheel
wheel_build_env = venv-pkg
Expand Down
3 changes: 0 additions & 3 deletions src/bridge/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ endif

if ENABLE_PCP

pmlogconfdir = $(localstatedir)/lib/pcp/config/pmlogconf/tools
dist_pmlogconf_DATA = src/bridge/pmlogconf/cockpit

libexec_PROGRAMS += cockpit-pcp

noinst_LIBRARIES += libcockpit-pcp.a
Expand Down
9 changes: 0 additions & 9 deletions src/bridge/pmlogconf/cockpit

This file was deleted.

2 changes: 2 additions & 0 deletions src/cockpit/channels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .http import HttpChannel
from .metrics import InternalMetricsChannel
from .packages import PackagesChannel
from .pcp import PcpMetricsChannel
from .stream import SocketStreamChannel, SubprocessStreamChannel
from .trivial import EchoChannel, NullChannel

Expand All @@ -35,6 +36,7 @@
InternalMetricsChannel,
NullChannel,
PackagesChannel,
PcpMetricsChannel,
SubprocessStreamChannel,
SocketStreamChannel,
]
Loading

0 comments on commit fdf20b7

Please sign in to comment.