Skip to main content

My cool package

Project description

net-prof

Net-prof is a network profiler aimed to profile the HPE Cray Cassini Network Interface Card (NIC) on a compute node to collect, analyze and visualize the network counter events.

To Install

pip install -r requirements.txt
pip install net-prof

Functions

collect(input_directory, "counters.json")
summarize(before, after)
dump(summary)
dump_html(summary, output_html)

To Use

import net-prof

script_dir = os.path.dirname(os.path.abspath(__file__))

collect("/cxi/cxi0/device/telemetry/", os.path.join(script_dir, "before.json")) # Collects before interface (1)
dist.all_reduce(x, op=dist.ReduceOp.SUM) # Process that should cause changes to the network runs -- note: can be replaced with something like "os.execute('ping google.com')"
collect("/cxi/cxi0/device/telemetry/", os.path.join(script_dir, "after.json")) # Collects after interface (1)

before = os.path.join(script_dir, "before.json") # assigns before
after = os.path.join(script_dir, "after.json") # assigns after

output_html = os.path.join(script_dir, "report_2.html")
os.makedirs(os.path.join(script_dir, "charts"), exist_ok=True) # make sure charts exists within tests/ or project root

summary = summarize(before, after) # runs summary
dump(summary) # outputs summary to terminal
dump_html(summary, output_html) # outputs summary to html
# example using dummy example files for interfaces 1-8. (no collect())
import net-prof

script_dir = os.path.dirname(os.path.abspath(__file__))
project_root = os.path.abspath(os.path.join(script_dir, '..'))  # go up from tests/

before = os.path.join(project_root, "example", "before.txt") # takes dummy before.txt
after = os.path.join(project_root, "example", "after.txt") # takes dummy after.txt
metrics = os.path.join(project_root, "src", "net_prof", "data", "metrics.txt") # takes dummy metrics.txt

output_html = os.path.join(script_dir, "report_2.html")
os.makedirs(os.path.join(script_dir, "charts"), exist_ok=True) # make sure charts exists within tests/ or project root

summary = summarize(before, after) # runs summary. Note summary supports an implementation of .txt or .json
dump(summary) # outputs summary to terminal
dump_html(summary, output_html) # outputs summary to html

Eventhough we have cxi0 as default, we can loop through and find all available cxi's from [0-8]

Features in Devolopment:

FIX -- Being able to loop through with collect() in the /cxi/ directory -- Right now only one interface can be examined at a time.
FIX -- Feature isn't set up as a package yet so import won't work.
FIX -- report.html & report_2.html share the same charts when they shouldn't... (different data)
Create a single unified test instead of having a bunch of tests.
Adding more charts with mpl.

Profiler Snapshots

Alt text Alt text Alt text Alt text

References

https://cpe.ext.hpe.com/docs/latest/getting_started/HPE-Cassini-Performance-Counters.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

net_prof-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

net_prof-0.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file net_prof-0.1.0.tar.gz.

File metadata

  • Download URL: net_prof-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for net_prof-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a774acd941bc81a16b76eed2af05c6779a1a511ec257ef3662e1ec52cd649f41
MD5 be9fbef1101de3d6b849f1936b403552
BLAKE2b-256 878e988f6d42d74164f08a1bd828958b2728629e0ba0a2cb26999427cc479085

See more details on using hashes here.

File details

Details for the file net_prof-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: net_prof-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for net_prof-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63694d0849ed6d69e4e12d62c89cc3f7fe9f182f1c8ac86eb430236446046cbc
MD5 182343e6cffe2474f35980e402bc7766
BLAKE2b-256 a17b6e60c343786b5a4142a28525b02cda6158dc8e5201ba9cefdad647015736

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page