Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converter script to convert the raw values for the axis legend #97

Open
dwt opened this issue Nov 25, 2020 · 2 comments
Open

Converter script to convert the raw values for the axis legend #97

dwt opened this issue Nov 25, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@dwt
Copy link

dwt commented Nov 25, 2020

Hi there,

I use sampler to show what my mobile router is actually transmitting with a config like this:

runcharts:
  - title: Net Statistics
    position: [[0, 0], [80, 40]]
    rate-ms: 1000
    legend:
        enabled: true
        details: false
    scale: 2
    items:
      - label: Downloadrate
        sample: curl --cookie SessionID=$(curl --silent --cookie-jar - 'http://www.huaweimobilewifi.com/html/index.html'
            | tail -n 1 | cut -f 7) 'http://www.huaweimobilewifi.com/api/monitoring/traffic-statistics'
            | xpath '//response/CurrentDownloadRate/text()' 2>/dev/null
        transform: numfmt --to=iec
      - label: Uploadloadrate
        sample: curl --cookie SessionID=$(curl --silent --cookie-jar - 'http://www.huaweimobilewifi.com/html/index.html'
            | tail -n 1 | cut -f 7) 'http://www.huaweimobilewifi.com/api/monitoring/traffic-statistics'
            | xpath '//response/CurrentUploadRate/text()' 2>/dev/null
        transform: numfmt --to=iec

Now I would really like to convert the numbers that are shown in the x axis of the graph so that instead of the 3333.323 I could have something like 30k / 40k / 40k …

I haven't been able to find a way to achieve this - but maybe I overlooked something? If not, I would like to promote a key like transform_display: $some_shell_command that would allow this.

@dwt
Copy link
Author

dwt commented Dec 11, 2020

ping, anybody out there? Is this something you guys like / dislike?

@sqshq
Copy link
Owner

sqshq commented Jan 3, 2022

That sounds reasonable, I think we can introduce an option for that (with the current behavior as a default). Might implement this in future, feel free to contribute if interested.

@sqshq sqshq added the enhancement New feature or request label Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants