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 <[email protected]>
Co-Authored-By: Tomas Matus <[email protected]>
  • Loading branch information
3 people committed Sep 24, 2024
1 parent 5d7508a commit 5e5f3f2
Show file tree
Hide file tree
Showing 11 changed files with 1,356 additions and 16 deletions.
8 changes: 1 addition & 7 deletions pkg/pcp/manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"requires": {
"cockpit": "239"
},
"bridges": [
{
"match": { "payload": "metrics1" },
"spawn": [ "${libexecdir}/cockpit-pcp" ]
}
]
}
}
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
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 5e5f3f2

Please sign in to comment.