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

[feature request] asPercent taking two series lists #207

Closed
mleinart opened this issue Mar 13, 2013 · 15 comments
Closed

[feature request] asPercent taking two series lists #207

mleinart opened this issue Mar 13, 2013 · 15 comments

Comments

@mleinart
Copy link
Member

Imported from https://bugs.launchpad.net/bugs/1005366

Reported by harisuthan
Date Created May 28, 2012

Originial Desc:
I have a use case where I need to find the percentage between two series lists like:

asPercent(groupByNode(serieslist1, x, "sumSeries"), groupByNode(serieslist2, y, "sumSeries"))

Is there way to achieve this? If not and if you find this useful may I request a feature addition where, when two series lists with "equal length" are passed as parameters to asPercent, it will return a serieslist with the same length where each series is a percentage of the individual input series?

Michael's Response:
I think asPercent and divideSeries could probably support this - rather
than the 2nd series being required to have a length of 1, it could be
required to have either: a length of 1 (current behavior) or a length
equal to the 1st series (your proposed behavior).

Unfortunately I cant spot a way to do this without having to enumerate
every series out.

If you'd like the new feature to be explored, convert this question to a
bug report and mark it as a feature request so that it can be tracked.

@mleinart
Copy link
Member Author

Comment by tewner on Jun 11, 2012:

I have a similar request with "divideSeries" - I want to specify a wildcard list of hosts and divide two metrics from each host - I still would love to use the coolest feature of Graphite - I want new plots for new hosts as the hosts are created.

cactiStyle(
alias(
divideSeries(
perSecond(
servers.Server1.com_application_GatewayStats.TotalParsingTime
),
perSecond(
servers.Server1.com_application_GatewayStats.CallsCount
)
)
,"Server1 - TotalParsingTime per Req"
)
)

@mleinart
Copy link
Member Author

Comment by tewner on Jun 11, 2012:

Small difference with my situation is that because I want to use wildcards, I need the 2 series' matched by host, and not by position in the series. Group-by index in the NODE name (likegroupByNode) SHOULD be ok, though.

@mathias-baumann-sociomantic

+1 from me for this feature

leandro-lucarella-sociomantic added a commit to leandro-lucarella-sociomantic/graphite-web that referenced this issue Dec 23, 2013
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
leandro-lucarella-sociomantic added a commit to leandro-lucarella-sociomantic/graphite-web that referenced this issue Dec 23, 2013
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
leandro-lucarella-sociomantic added a commit to leandro-lucarella-sociomantic/graphite-web that referenced this issue Dec 23, 2013
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
@pcn
Copy link

pcn commented Dec 23, 2013

❤️

Does this rely on any other PRs?

@mathias-baumann-sociomantic

No, it works as is :)

leandro-lucarella-sociomantic added a commit to leandro-lucarella-sociomantic/graphite-web that referenced this issue Dec 23, 2013
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
@leandro-lucarella-sociomantic

Does this rely on any other PRs?

Nope :)

leandro-lucarella-sociomantic added a commit to leandro-lucarella-sociomantic/graphite-web that referenced this issue Dec 27, 2013
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
leandro-lucarella-sociomantic added a commit to leandro-lucarella-sociomantic/graphite-web that referenced this issue Dec 27, 2013
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
mathias-baumann-sociomantic pushed a commit to mathias-baumann-sociomantic/graphite-web that referenced this issue Apr 14, 2014
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
mathias-baumann-sociomantic pushed a commit to mathias-baumann-sociomantic/graphite-web that referenced this issue Apr 14, 2014
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
kamaradclimber pushed a commit to criteo-forks/graphite-web that referenced this issue Jul 18, 2014
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
@corradio
Copy link

corradio commented Dec 1, 2014

Status here?

@deniszh
Copy link
Member

deniszh commented Dec 1, 2014

Not very good as I see - #551 needs to be rebased and tests need to be added (IIRC no function changes w/o testing accepted).

@corradio
Copy link

corradio commented Dec 1, 2014

Is there another workaround right now?

@leandro-lucarella-sociomantic

Sorry, I didn't have the take to get into this again (I'm not regularly working with this so I will have to dive into graphite again to rebase and add tests, so it might not happen very soon :-/ ).

@jemshad
Copy link

jemshad commented Feb 18, 2016

looking forward to this feature! :)

iksaif pushed a commit to criteo-forks/graphite-web that referenced this issue Mar 1, 2016
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
iksaif pushed a commit to criteo-forks/graphite-web that referenced this issue Jun 3, 2016
If multiple series as used as total, the length of the total series must
match the length of the seriesList, and they will be matched together to
calculate the percentage of the individual values.

This fixes graphite-project#207.
@obfuscurity
Copy link
Member

asPercent now supports multiple divisor series in the total parameter, or you can pass the results of sumSeries(seriesList). Closing this one.

@eyablonowitz
Copy link

Thanks @obfuscurity, asPercent works great. But the original issue description and subsequent comments also included divideSeries, but it looks like only asPercent was actually addressed? I looked but failed to find a separate issue for divideSeries. Would it make sense to create one or reopen this?

@obfuscurity
Copy link
Member

@ericy-jana Correct. Can you elaborate on a user case not covered by the asPercent() enhancements?

@eyablonowitz
Copy link

eyablonowitz commented Jul 29, 2016

@obfuscurity I am trying to graph I/O latency from stats fed to Graphite by a Sensu check reading /proc/diskstats (https://github.com/sensu-plugins/sensu-plugins-disk-checks/blob/master/bin/metrics-disk.rb).

I am trying to divide the time spent doing I/O over the sample period by the number of I/O operations during the same time period. This works ok if I am graphing a single host, but fails when using variables/wildcards to attempt to graph multiple hosts. This same pattern used to fail in a similar way with asPercent prior to .10 but now works great (e.g. for graphing CPU utilization %).

Below is the targets array from the Grafana panel json to further illustrate what I am trying to do. Apologies if I am missing an obvious solution. I am new to Graphite.

Edit - After typing this up a colleague made the suggestion that I could just use the asPercent function and scale it by 0.01 which works fine.

  "targets": [
    {
      "target": "nonNegativeDerivative(linux.io.$cluster.$host.*.ioTime)",
      "hide": true
    },
    {
      "target": "groupByNodes(#A, 'sum', 2,3)",
      "textEditor": true,
      "hide": false
    },
    {
      "target": "nonNegativeDerivative(linux.io.$cluster.$host.*.{reads,writes})",
      "hide": true
    },
    {
      "target": "groupByNodes(#C, 'sum', 2,3)",
      "textEditor": true,
      "hide": false
    },
    {
      "target": "divideSeries(#B,#D)",
      "hide": false,
      "textEditor": true
    }
  ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants