{"action":"closed","issue":{"url":"https://api.github.com/repos/vladimir-bukhtoyarov/metrics-core-hdr/issues/4","repository_url":"https://api.github.com/repos/vladimir-bukhtoyarov/metrics-core-hdr","labels_url":"https://api.github.com/repos/vladimir-bukhtoyarov/metrics-core-hdr/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/vladimir-bukhtoyarov/metrics-core-hdr/issues/4/comments","events_url":"https://api.github.com/repos/vladimir-bukhtoyarov/metrics-core-hdr/issues/4/events","html_url":"https://github.com/vladimir-bukhtoyarov/metrics-core-hdr/issues/4","id":176006852,"number":4,"title":"Implement \"query top\" monitoring structure","user":{"login":"vladimir-bukhtoyarov","id":6761830,"avatar_url":"https://avatars.githubusercontent.com/u/6761830?v=3","gravatar_id":"","url":"https://api.github.com/users/vladimir-bukhtoyarov","html_url":"https://github.com/vladimir-bukhtoyarov","followers_url":"https://api.github.com/users/vladimir-bukhtoyarov/followers","following_url":"https://api.github.com/users/vladimir-bukhtoyarov/following{/other_user}","gists_url":"https://api.github.com/users/vladimir-bukhtoyarov/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimir-bukhtoyarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimir-bukhtoyarov/subscriptions","organizations_url":"https://api.github.com/users/vladimir-bukhtoyarov/orgs","repos_url":"https://api.github.com/users/vladimir-bukhtoyarov/repos","events_url":"https://api.github.com/users/vladimir-bukhtoyarov/events{/privacy}","received_events_url":"https://api.github.com/users/vladimir-bukhtoyarov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-09T13:16:44Z","updated_at":"2016-11-11T06:13:39Z","closed_at":"2016-11-11T06:13:39Z","body":"**Problem:**\nSometimes we execute different kind of queries on same third-party resource. When third-party service became slow then simple measurement of average latency and its percentiles is not enough to determine concrete queries which lead to problem. So we need in monitoring structure which I call by \"Query Top\", it should shows first N slowest queries with its description.\n\n**The proposals for java interface:**\n\n``` java\npublic class QueryTop {\n\n    /**\n     *\n     * @param minimumLatencyThreshold latencies lesser than minimumLatencyThreshold will not be trackable in the top\n     *                                in order to avoid CPU spending for non-problematic queries\n     * @param itemCount the number of item in the top\n     */\n    public QueryTop(long minimumLatencyThreshold, int itemCount) {\n          ....\n    }\n\n    /**\n     * Register completed query.\n     */\n    void update(long time, Supplier<String> lazySupplierForUserFriendlyQueryRepresentation) {\n      // supplier should not be called if query is not added to top.\n        ...\n    }\n\n    /**\n     * Return the top of slow queries. The key - is duration, the value is a query(for example SQL or URL)\n     */\n    List<Pair<Long, String>> getTop() {\n         ...\n    }\n\n}\n```\n\n**Proposed release date:**\nSeptember 2016\n"}}
{"actor":{"display_login":"vladimir-bukhtoyarov"}}