Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
This Python package reads the native .cali files produced by the Caliper performance profiling library.
You can install caliper-reader with pip:
$ pip install caliper-reader
Alternatively, add the python/caliper-reader
path in the cloned
Caliper repository to PYTHONPATH
.
The CaliperReader
class reads a Caliper file and then provides its
contents in the records
and globals
class members, where records
is a Python list-of-dicts containing the recorded performance data
and globals
is a Python dict with program metadata about the run.
The dicts represent Caliper attribute:value records: the key is the
Caliper attribute name; the value is a string or list of strings.
The example below prints the avg#inclusive#sum#time.duration
metric
for every region path in the provided example profile data file:
import caliperreader as cr
r = cr.CaliperReader()
r.read('example-profile.cali')
metric = 'avg#inclusive#sum#time.duration'
for rec in r.records:
path = rec['path'] if 'path' in rec else 'UNKNOWN'
time = rec[metric] if metric in rec else '0'
if (isinstance(path, list)):
path = "/".join(path)
print("{0}: {1}".format(path, time))
The CaliperReader attributes()
function returns the list of Caliper
attributes. The attribute()
function returns an Attribute
object
to query metadata for a given Caliper attribute name:
>>> a = r.attribute('avg#inclusive#sum#time.duration')
>>> a.get('attribute.unit')
'sec'
You can use the read_caliper_contents
function as a shortcut to read
Caliper data without creating a CaliperReader
object:
(records,globals) = cr.read_caliper_contents('example-profile.cali')
Use read_caliper_globals
if you only need the global (metadata) record:
globals = cr.read_caliper_globals('example-profile.cali')
Caliper was created by David Boehme, boehme3@llnl.gov.
Caliper is released under a BSD 3-clause license. See LICENSE for details.
LLNL-CODE-678900
FAQs
A Python library for reading Caliper .cali files
We found that caliper-reader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.