← Back to team overview

graphite-dev team mailing list archive

[Question #665679]: Graphite Percentage Calculation using groupbyNode or averageSeriesWithWildCards

 

New question #665679 on Graphite:
https://answers.launchpad.net/graphite/+question/665679

I am trying to create a seyren alert for my page render metric stored in graphite.

My render stats are collected by ststsD and stored in graphite. The structure is following:

stats.counters.renderCompleted.<country>.<placement_id>.<page_version>.count
e.g.

stats.counters.renderCompleted.US.123456.v1_1_03.count
stats.counters.renderCompleted.US.123456.v1_1_09.count

stats.counters.renderCompleted.US.654321.v2_1_05.count
stats.counters.renderCompleted.US.654321.v2_1_07.count

stats.counters.renderCompleted.UK.123456.v1_1_09.count
...
...
I want to create a seyren alert with graphite functions for US whenever the last 2 hour render count average for ANY PLACEMENT ANY VERSION (e.g. group by placement_id, page_version) falls below certain % of its (for that placement's and version's) previous-day-same-time 2 hour window average.

I tried couple of ways, but not getting the the exact result I am intending:

1. using averageSeriesWithWildCards:

asPercent(
    averageSeriesWithWildCards(
        movingAverage(
            scaleToSeconds(stats.counters.renderCompleted.US.*.*.count, 1),
        '2hour'), 
      5),
    averageSeriesWithWildCards(
        movingAverage(
            scaleToSeconds(
                timeShift(stats.counters.renderCompleted.US.*.*.count, '1d'), 
            1), 
        '2hour'), 
    5)
)


2. Using groupByNode:

asPercent(
    groupByNode(
        movingAverage(
            scaleToSeconds(stats.counters.renderCompleted.US.*.*.count, 1),
        '2hour'),
    4, 'averageSeries'),
    groupByNode(
        movingAverage(
            scaleToSeconds(                   
               timeShift(stats.counters.renderCompleted.US.*.*.count,'1d'),
            1),
        '2hour'),
    4, 'averageSeries')
)
Will appreciate some help. Thanks in advance.

-- 
You received this question notification because your team graphite-dev
is an answer contact for Graphite.