New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cockpit pcp python #20049
base: main
Are you sure you want to change the base?
Cockpit pcp python #20049
Conversation
ed025f6
to
11c3806
Compare
raise | ||
|
||
@staticmethod | ||
def semantic_val(sem_id: int): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
# TODO: take care of this later... | ||
if units: | ||
try: | ||
_pm_units_buf = context.pmParseUnitsStr(units) |
Check notice
Code scanning / CodeQL
Unused local variable Note
name=name, | ||
derive=derive, | ||
desc=pm_desc, | ||
factor=factor, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
2821ebd
to
920768d
Compare
# if self.omit_instances and self.instances: | ||
# raise ChannelError('protocol-error', message='') |
Check notice
Code scanning / CodeQL
Commented-out code Note
# if value_count > 1: | ||
# _, instances = context.pmGetInDom(indom=descs[i].contents.indom) |
Check notice
Code scanning / CodeQL
Commented-out code Note
# for j in range(value_count): | ||
# atom = context.pmExtractValue(results.contents.get_valfmt(i), | ||
# results.contents.get_vlist(i, j), | ||
# content_type, | ||
# content_type) | ||
# | ||
# if value_count > 1: | ||
# assert isinstance(instances, list) | ||
# assert isinstance(values, dict) | ||
# values[instances[j]] = atom.dref(content_type) | ||
# else: | ||
# # TODO does float() need to be here? | ||
# values = float(atom.dref(content_type)) |
Check notice
Code scanning / CodeQL
Commented-out code Note
|
||
return samples | ||
|
||
def build_sample(self, context, valfmt, value, desc): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
except Exception as exc: | ||
print("BORK", exc) | ||
|
||
sample_value = atom.d |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
Co-Authored-By: Allison Karlitskaya <allison.karlitskaya@redhat.com> Co-Authored-By: Tomas Matus <tomatus777@gmail.com>
Pytest test functions are called test_foo test_bar, this leads to confusion.
920768d
to
cd74f24
Compare
Rewrite
cockpit-pcp
as a Python bridge channel using thepython3-pcp
bindings:ToDo's when picking this up:
pkg/pcp/manifest.json
and test the metrics pageThe first version should support:
Source:
/
- this is the simplest case (used on metrics page)For the metrics page we need to support multi-instanced instances and a
limit
,timestamp
and settinginterval
options. Includingomit-instances
support fornetwork.interface.total.bytes
.Comparing to the C implementation:
We also have some valid test archives in
test/verify/files/metric-archives
, untar them and you can then for example load them with: