Skip to main content

A small graph package used to draw image for ndnsim metrics

Project description

ndnsim-graph

A small graph package used to draw image for ndnsim metrics

1. Install

pip install ndnsimgraph

2. Usage Example

2.1 Throughput

from ndnsimgraph.throughput import ThroughputGraph, ThroughputType, ThroughputTarget

# save picture to file
ThroughputGraph.parse("data_test0409/wfq-test2_throughput.txt"). \
        setThroughputType(ThroughputType.OutData). \
        setThroughputTarget(ThroughputTarget.Kilobytes). \
        setSamplingInterval(0.5). \
        plot("C1", 258). \
        plot("C2", 258). \
        plot("C3", 258). \
        plot("C4", 258). \
        title("test title"). \
        xlabel("Throughputs"). \
        ylabel("Times(s)"). \
        legend(). \
        drawAndSave("output", "test-throughput.svg"). \
        close()

# show
ThroughputGraph.parse("data_test0409/wfq-test2_throughput.txt"). \
        setThroughputType(ThroughputType.OutData). \
        setThroughputTarget(ThroughputTarget.Kilobytes). \
        setSamplingInterval(0.5). \
        plot("C1", 258). \
        plot("C2", 258). \
        plot("C3", 258). \
        plot("C4", 258). \
        title("test title"). \
        xlabel("Throughputs"). \
        ylabel("Times(s)"). \
        legend(). \
        drawAndSave("output", "test-throughput.svg"). \
        close()

test-throughput.svg

2.2 Delay

from ndnsimgraph.delay import DelayGraph, DelayType, DelayTarget

DelayGraph.parse("data_content_delivery/delay_abilene.txt"). \
        setDelayType(DelayType.LastDelay). \
        setDelayTarget(DelayTarget.DelayMS). \
        setSamplingInterval(0.1). \
        plot("C1", 1). \
        plot("C1", 2). \
        title("test title"). \
        xlabel("Delay(ms)"). \
        ylabel("Times(s)"). \
        legend(). \
        drawAndSave("output", "test-delay.svg"). \
        close()

test-delay.svg

2.3 Drop

from ndnsimgraph.drop import DropGraph, DropType, DropTarget

DropGraph.parse("data_content_delivery/drop_abilene.txt"). \
        setDropType(DropType.Drop). \
        setDropTarget(DropTarget.PacketRaw). \
        setSamplingInterval(1). \
        plot("C1"). \
        plot("C2"). \
        title("test title"). \
        xlabel("Drop(packets)"). \
        ylabel("Times(s)"). \
        ylim(0). \
        legend(). \
        drawAndSave("output", "test-drop.svg"). \
        close()

test-drop.svg

3. Upload new packet

Python 打包自己的库到 PYPI (可pip安装)

python3 setup.py sdist bdist_wheel
twine upload dist/*

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

ndnsimgraph-0.0.6.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

ndnsimgraph-0.0.6-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

Supported by

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