Code Monkey home page Code Monkey logo

hdr-plot's Issues

More sophisticated label name mechanism

Thank you for this script, it surely makes life easier :)
When used with several files, displaying the correct label is a bit of a heuristic process, though. I could rename my files, but generally, perhaps it could be improved
What do you think about the following heuristic for labeling:

  • split file names on a set of strings such as ., _, -
  • count the occurrences in each bin in the split (we care about 1 vs. many)
  • many bins are selected for label names
  • 1 bins (common for all) can become the title

I wouldn't mind PRing this

Thanks

Percentile filter

Hi, thank you for great tool.

Is there any way to filter out high percentiles?

Due to the high value for tail percentiles (99.9, 99.99....), I hardly see normal values. So if I can get a functionality to skip such an extreme case, I think it's more valuable as visualizer.

I'm not familiar with pandas/matplot, but if you give me some hint I will happily change it on my own.

Thanks :)

Exception when input does not have percentile at exactly 0.5

My input data does not have a percentile at exactly 0.5. It was at 0.52 for some reasons.

Traceback (most recent call last):
  File ".venv/bin/hdr-plot", line 18, in <module>
    plot.main()
  File "/opt/intel/flexran/dpdk/vmwaretools/.venv/lib/python3.7/site-packages/hdr_plot/hdr_plot.py", line 110, in main
    plot_summarybox(ax, pct_data, labels)
  File "/opt/intel/flexran/dpdk/vmwaretools/.venv/lib/python3.7/site-packages/hdr_plot/hdr_plot.py", line 60, in plot_summarybox
       Value     Percentile TotalCount 1/(1-Percentile)

        0.00 0.000000000000         19           1.00
       59.00 0.100000000000      15609           1.11
       76.00 0.190000000000      29483           1.23
       83.00 0.271000000000      41776           1.37
       86.00 0.343900000000      56308           1.52
       87.00 0.409510000000      62278           1.69
       89.00 0.468559000000      74214           1.88
       90.00 0.521703100000      79637           2.09
       92.00 0.569532790000      89321           2.32
       93.00 0.612579511000      94175           2.58
... (rest of the file)

    textstr = '\n'.join([info_text(labels[i], percentiles[i]) for i in range(len(labels))])
  File "/opt/intel/flexran/dpdk/vmwaretools/.venv/lib/python3.7/site-packages/hdr_plot/hdr_plot.py", line 60, in <listcomp>
    textstr = '\n'.join([info_text(labels[i], percentiles[i]) for i in range(len(labels))])
  File "/opt/intel/flexran/dpdk/vmwaretools/.venv/lib/python3.7/site-packages/hdr_plot/hdr_plot.py", line 46, in info_text
    "max",    data['Latency'].max())
  File "/opt/intel/flexran/dpdk/vmwaretools/.venv/lib/python3.7/site-packages/pandas/core/series.py", line 139, in wrapper
    raise TypeError(f"cannot convert the series to {converter}")
TypeError: cannot convert the series to <class 'float'>

Offending line is the median calculation:

def info_text(name, data):
    textstr = '%-18s\n------------------\n%-6s = %6.2f ms\n%-6s = %6.2f ms\n%-6s = %6.2f ms\n'%(
        name,
        "min",    data['Latency'].min(),
        "median", data[data["Percentile"] == 0.5]["Latency"],
        "max",    data['Latency'].max())
    return textstr

I don't know why we're trying to calculate this manually but simply calling the median function fixes the problem.

def info_text(name, data):
    textstr = '%-18s\n------------------\n%-6s = %6.2f ms\n%-6s = %6.2f ms\n%-6s
 = %6.2f ms\n'%(
        name,
        "min",    data['Latency'].min(),
        "median", data['Latency'].median(),
        "max",    data['Latency'].max())
    return textstr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.