This is an automated email from the ASF dual-hosted git repository.
namelchev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git
The following commit(s) were added to refs/heads/master by this push:
new d45eccb2 IGNITE-23901 Added performance statistics for putAllConflict,
removeAllConflict operations (#299)
d45eccb2 is described below
commit d45eccb277d6dfc7f9b9620ea2867b699b6d1b61
Author: Maksim Davydov <[email protected]>
AuthorDate: Mon Mar 3 14:07:14 2025 +0300
IGNITE-23901 Added performance statistics for putAllConflict,
removeAllConflict operations (#299)
---
.../report/js/operationsTab.js | 7 +++++--
.../PerformanceStatisticsReportSelfTest.java | 22 +++++++++++++++++++++-
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/modules/performance-statistics-ext/report/js/operationsTab.js
b/modules/performance-statistics-ext/report/js/operationsTab.js
index b2f240e4..fc08d03d 100644
--- a/modules/performance-statistics-ext/report/js/operationsTab.js
+++ b/modules/performance-statistics-ext/report/js/operationsTab.js
@@ -16,10 +16,11 @@
*/
const CACHE_OPERATIONS = ["CACHE_GET", "CACHE_PUT", "CACHE_REMOVE",
"CACHE_GET_AND_PUT", "CACHE_GET_AND_REMOVE",
- "CACHE_GET_ALL", "CACHE_PUT_ALL", "CACHE_REMOVE_ALL", "CACHE_INVOKE",
"CACHE_INVOKE_ALL", "CACHE_LOCK"];
+ "CACHE_GET_ALL", "CACHE_PUT_ALL", "CACHE_REMOVE_ALL", "CACHE_INVOKE",
"CACHE_INVOKE_ALL", "CACHE_PUT_ALL_CONFLICT",
+ "CACHE_REMOVE_ALL_CONFLICT", "CACHE_LOCK"];
const CACHE_OPERATIONS_READABLE = ["get", "put", "remove", "getAndPut",
"getAndRemove",
- "getAll", "putAll", "removeAll","invoke", "invokeAll", "lock"];
+ "getAll", "putAll", "removeAll", "invoke", "invokeAll", "putAllConflict",
"removeAllConflict", "lock"];
const CACHE_OPERATIONS_COLORS = {
CACHE_GET: "#007bff",
@@ -32,6 +33,8 @@ const CACHE_OPERATIONS_COLORS = {
CACHE_REMOVE_ALL: "#23BFAA",
CACHE_INVOKE: "#F5A52A",
CACHE_INVOKE_ALL: "#fd7e14",
+ CACHE_PUT_ALL_CONFLICT: "#5289A4",
+ CACHE_REMOVE_ALL_CONFLICT: "#17807E",
CACHE_LOCK: "#FAA586"
};
diff --git
a/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
b/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
index 6720f77d..517b7777 100644
---
a/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
+++
b/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
@@ -40,7 +40,14 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.performancestatistics.handlers.QueryHandler;
+import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.CacheObjectImpl;
+import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
+import org.apache.ignite.internal.processors.cache.KeyCacheObject;
+import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl;
+import org.apache.ignite.internal.processors.cache.dr.GridCacheDrInfo;
import org.apache.ignite.internal.processors.cache.query.GridCacheQueryType;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
@@ -49,6 +56,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
+import static java.util.Collections.singletonMap;
import static org.apache.ignite.cache.query.IndexQueryCriteriaBuilder.gt;
import static
org.apache.ignite.internal.processors.performancestatistics.AbstractPerformanceStatisticsTest.waitForStatisticsEnabled;
import static
org.apache.ignite.internal.processors.performancestatistics.FilePerformanceStatisticsWriter.PERF_STAT_DIR;
@@ -62,6 +70,9 @@ import static org.junit.Assert.assertTrue;
* Tests the performance statistics report.
*/
public class PerformanceStatisticsReportSelfTest {
+ /** Cache name. */
+ private static final String CACHE_NAME = "cache";
+
/** @throws Exception If failed. */
@Test
public void testCreateReport() throws Exception {
@@ -76,7 +87,7 @@ public class PerformanceStatisticsReportSelfTest {
) {
client.context().performanceStatistics().startCollectStatistics();
- IgniteCache<Object, Object> cache = client.createCache(new
CacheConfiguration<>("cache")
+ IgniteCache<Object, Object> cache = client.createCache(new
CacheConfiguration<>(CACHE_NAME)
.setQueryEntities(F.asList(new QueryEntity()
.setKeyType(Integer.class.getName())
.setValueType(Integer.class.getName()))));
@@ -91,6 +102,15 @@ public class PerformanceStatisticsReportSelfTest {
cache.getAndPut(3, 3);
cache.getAndRemove(3);
+ IgniteInternalCache<Object, Object> cachex =
client.cachex(CACHE_NAME);
+
+ KeyCacheObject keyConfl = new KeyCacheObjectImpl(1, null, 1);
+ CacheObject valConfl = new CacheObjectImpl(1, null);
+ GridCacheVersion confl = new GridCacheVersion(1, 0, 1, (byte)2);
+
+ cachex.putAllConflict(singletonMap(keyConfl, new
GridCacheDrInfo(valConfl, confl)));
+ cachex.removeAllConflict(singletonMap(keyConfl, confl));
+
client.compute().run(() -> {
// No-op.
});