Created
March 14, 2013 19:54
-
-
Save besquared/5164617 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WebBase : NancyModule | |
{ | |
private ExponentiallyDecayingSample _sample; | |
public WebBase() | |
{ | |
Setup(); | |
Get["/sampling"] = param => | |
{ | |
_sample.Clear(); | |
for (int i = 0; i < 100; i++) | |
{ | |
_sample.Update(i); | |
} | |
var values = new List<long>(_sample.Values); | |
values.Sort(); | |
return string.Join(",", values); | |
}; | |
} | |
private void Setup() | |
{ | |
_sample = new ExponentiallyDecayingSample(1024, 0.15); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This causes a problem in timers where only 3 values are ever in the sample even when there have been a lot of things timed.
Broker.Worker: {
BlobDelete: {
type: "timer",
duration: {
unit: "Milliseconds",
min: 20.037987,
max: 1225.699515,
mean: 73.35299645333333,
median: 51.318412,
p75: 478.825806,
p95: 478.825806,
p98: 478.825806,
p99: 478.825806,
p999: 478.825806,
values: "478.825806, 21.784853, 51.318412"
},
rate: {
unit: "Seconds",
count: 225,
mean: 0.5495942080080811,
m1: 0.4888301904187456,
m5: 0.5077636432513755,
m15: 0.45482446625868517
}
},