From dev-return-45621-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Mon Apr 8 08:45:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 704A3180654 for ; Mon, 8 Apr 2019 10:45:02 +0200 (CEST) Received: (qmail 5487 invoked by uid 500); 8 Apr 2019 08:25:24 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 5357 invoked by uid 99); 8 Apr 2019 08:25:23 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Apr 2019 08:25:23 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B33D3E063A for ; Mon, 8 Apr 2019 08:45:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 431F524599 for ; Mon, 8 Apr 2019 08:45:00 +0000 (UTC) Date: Mon, 8 Apr 2019 08:45:00 +0000 (UTC) From: "Evgenii Zhuravlev (JIRA)" To: dev@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (IGNITE-11695) AverageGetTime metric doesn't work properly with ScanQuery predicate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Evgenii Zhuravlev created IGNITE-11695: ------------------------------------------ Summary: AverageGetTime metric doesn't work properly with ScanQuery predicate Key: IGNITE-11695 URL: https://issues.apache.org/jira/browse/IGNITE-11695 Project: Ignite Issue Type: Bug Reporter: Evgenii Zhuravlev In *GridCacheQueryManager.advance* method *start* variable is set only once, at the start of executing the method, while metrics.onRead inside this method could be executed multiple times in case if Predicate returns false: Reproducer: {code:java} public class ExampleNodeStartup { private static int FILTER_COUNT = 100000; /** * Start up an empty node with example compute configuration. * * @param args Command line arguments, none required. * @throws IgniteException If failed. */ public static void main(String[] args) throws IgniteException { Ignite ignite = Ignition.start(); IgniteCache cache = ignite.getOrCreateCache(new CacheConfiguration<>("test").setStatisticsEnabled(true)); for (int i = 0; i < 100000; i++) cache.put(i, i); long start = System.currentTimeMillis(); Iterator it = cache.query(new ScanQuery().setFilter(new IgniteBiPredicate() { @Override public boolean apply(Object o, Object o2) { if ((int)o2 % FILTER_COUNT == 0) return true; return false; } })).iterator(); while (it.hasNext()) System.out.println("iterator value: " + it.next()); System.out.println("Execution time: " + (System.currentTimeMillis() - start)); System.out.println("GETS: " + cache.metrics().getCacheGets()); System.out.println("GET times: " + cache.metrics().getAverageGetTime()); } } {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)