Skip to content
This repository has been archived by the owner on Feb 1, 2018. It is now read-only.

send other metrics #7

Open
tj opened this issue Apr 19, 2014 · 2 comments
Open

send other metrics #7

tj opened this issue Apr 19, 2014 · 2 comments

Comments

@tj
Copy link

tj commented Apr 19, 2014

I'm seeing all this stuff in statsd, but only rate and count in stackdriver for timers/histograms:

          var clean_pct = '' + pct;
          clean_pct = clean_pct.replace('.', '_').replace('-', 'top');
          current_timer_data["count_" + clean_pct] = numInThreshold;
          current_timer_data["mean_" + clean_pct] = mean;
          current_timer_data[(pct > 0 ? "upper_" : "lower_") + clean_pct] = thresholdBoundary;
          current_timer_data["sum_" + clean_pct] = sum;
          current_timer_data["sum_squares_" + clean_pct] = sumSquares;

        }

        sum = cumulativeValues[count-1];
        sumSquares = cumulSumSquaresValues[count-1];
        mean = sum / count;

        var sumOfDiffs = 0;
        for (var i = 0; i < count; i++) {
           sumOfDiffs += (values[i] - mean) * (values[i] - mean);
        }

        var mid = Math.floor(count/2);
        var median = (count % 2) ? values[mid] : (values[mid-1] + values[mid])/2;

        var stddev = Math.sqrt(sumOfDiffs / count);
        current_timer_data["std"] = stddev;
        current_timer_data["upper"] = max;
        current_timer_data["lower"] = min;
        current_timer_data["count"] = timer_counters[key];
        current_timer_data["count_ps"] = timer_counters[key] / (flushInterval / 1000);
        current_timer_data["sum"] = sum;
        current_timer_data["sum_squares"] = sumSquares;
        current_timer_data["mean"] = mean;
        current_timer_data["median"] = median;
@ekilby
Copy link
Contributor

ekilby commented Apr 19, 2014

There should be min max avg and sum in addition to count and rate for timers, unless the params to disable them are set. There is also a param to send percentiles if it is set.

Not sure about histograms, is that the same as sets? I don't know much about those types.

@tj
Copy link
Author

tj commented Apr 19, 2014

hmm using histos might be the problem then, it's just an alias of timers, but I'm just getting those two metrics

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants