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 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] (Not implemented!)

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 -- report.html & report_2.html share the same charts when they shouldn't... (different data)
FIX -- before.txt and after.txt (dummy files for testing without using collect()) were not included in pypi package -- /example/ is missing from package -- (low priority)
ADD -- Create a single unified test instead of having a bunch of tests.
ADD -- 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
https://pypi.org/project/net-prof/0.1.0/

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.1.tar.gz (12.5 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.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: net_prof-0.1.1.tar.gz
  • Upload date:
  • Size: 12.5 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.1.tar.gz
Algorithm Hash digest
SHA256 26cea87646c1311b1acca9881cb4a2877248e70e36bbde2726e4dc863960990d
MD5 c387a532e7639eba38a4a59dfd4097f1
BLAKE2b-256 43a62b500d6f52dfffdabc16bd663c5fc4aa83280b08aa6290cfa6a2c8bf6013

See more details on using hashes here.

File details

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

File metadata

  • Download URL: net_prof-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92637b57e2d2e9809f718653b70c1c1b8967026fae442ddcf28a17afc1c4541d
MD5 00027189dac6c0b70f487bfefce87956
BLAKE2b-256 ebaafddb63793f786393375c71af55c13396c709bb429b8df1f5fe923f9a8926

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