{"action":"created","issue":{"url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/290","repository_url":"https://api.github.com/repos/AppMetrics/AppMetrics","labels_url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/290/labels{/name}","comments_url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/290/comments","events_url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/290/events","html_url":"https://github.com/AppMetrics/AppMetrics/issues/290","id":340673152,"node_id":"MDU6SXNzdWUzNDA2NzMxNTI=","number":290,"title":"Response Timer produces jagged graphs","user":{"login":"lyosha-kor","id":33552936,"node_id":"MDQ6VXNlcjMzNTUyOTM2","avatar_url":"https://avatars2.githubusercontent.com/u/33552936?v=4","gravatar_id":"","url":"https://api.github.com/users/lyosha-kor","html_url":"https://github.com/lyosha-kor","followers_url":"https://api.github.com/users/lyosha-kor/followers","following_url":"https://api.github.com/users/lyosha-kor/following{/other_user}","gists_url":"https://api.github.com/users/lyosha-kor/gists{/gist_id}","starred_url":"https://api.github.com/users/lyosha-kor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyosha-kor/subscriptions","organizations_url":"https://api.github.com/users/lyosha-kor/orgs","repos_url":"https://api.github.com/users/lyosha-kor/repos","events_url":"https://api.github.com/users/lyosha-kor/events{/privacy}","received_events_url":"https://api.github.com/users/lyosha-kor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-12T14:52:40Z","updated_at":"2018-07-12T19:45:33Z","closed_at":null,"author_association":"NONE","body":"Hello.\r\n\r\nI'm trying to log response time percentiles for a WebAPI app. \r\n\r\nI'm using InfluxDb and the Timer with the default reservoir and several tags. I also have a couple of global tags.\r\n\r\nFor some reason the resulting graphs are jagged -- like jumping between the same values for a period of time.\r\n\r\nHere is the picture to show what I mean--\r\n\r\n![2018-07-12 17_23_52-grafana - sports api](https://user-images.githubusercontent.com/33552936/42641565-7b6c1d2e-85fd-11e8-9e52-1912dbbd4d19.png)\r\n\r\nThis looks wrong. Any ideas what might be the cause and how do I solve this?\r\n\r\nMy code is\r\n```\r\npublic class AppMetricsFilter : ActionFilterAttribute\r\n{\r\n    private readonly string _siteIdHeader;\r\n\r\n    private static readonly TimerOptions TimerOptions = \r\n        new TimerOptions { Name = MetricsKeys.ResponseTime };\r\n    private static readonly string[] MetricsTagKeys = { \"operator_id\", \"action_name\" };\r\n    \r\n    public AppMetricsFilter(string siteIdHeader)\r\n    {\r\n        _siteIdHeader = siteIdHeader;\r\n    }\r\n\r\n    public override async Task OnActionExecutionAsync(\r\n        ActionExecutingContext context, ActionExecutionDelegate next)\r\n    {\r\n        var metrics = context.HttpContext.RequestServices.GetService<IMetricsRoot>();\r\n\r\n        if (metrics != null)\r\n            await ExecuteWithMetrics(context, next, metrics);\r\n        else\r\n            await next();\r\n    }\r\n\r\n    private async Task ExecuteWithMetrics(\r\n        ActionExecutingContext context, ActionExecutionDelegate next, IMetricsRoot metrics)\r\n    {\r\n        var actionName = context.RouteData.Values[\"action\"]?.ToString();\r\n        var operatorId = context.HttpContext.Request.Headers[_siteIdHeader].FirstOrDefault();\r\n\r\n        var metricsTags = new MetricTags(MetricsTagKeys, new[] { operatorId, actionName });\r\n\r\n        using (metrics.Measure.Timer.Time(TimerOptions, metricsTags))\r\n            await next();\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/comments/404628834","html_url":"https://github.com/AppMetrics/AppMetrics/issues/290#issuecomment-404628834","issue_url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/290","id":404628834,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDYyODgzNA==","user":{"login":"kroppt","id":14015672,"node_id":"MDQ6VXNlcjE0MDE1Njcy","avatar_url":"https://avatars0.githubusercontent.com/u/14015672?v=4","gravatar_id":"","url":"https://api.github.com/users/kroppt","html_url":"https://github.com/kroppt","followers_url":"https://api.github.com/users/kroppt/followers","following_url":"https://api.github.com/users/kroppt/following{/other_user}","gists_url":"https://api.github.com/users/kroppt/gists{/gist_id}","starred_url":"https://api.github.com/users/kroppt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroppt/subscriptions","organizations_url":"https://api.github.com/users/kroppt/orgs","repos_url":"https://api.github.com/users/kroppt/repos","events_url":"https://api.github.com/users/kroppt/events{/privacy}","received_events_url":"https://api.github.com/users/kroppt/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T19:45:33Z","updated_at":"2018-07-12T19:45:33Z","author_association":"NONE","body":"I have been getting the same results using the default dashboard, reporting, and reservoir, along with InfluxDB. Given that, I think your implementation is working fine. But I certainly would like to know why our graphs look like this... I assumed that it represented the average of 95% of the data using standard deviation or something, but that doesn't follow the graph at all."}}
{"actor":{"display_login":"kroppt"}}