[xwiki/xwiki-platform] 1387d5: XWIKI-24710: Add script APIs to count distinct act...
Branch: refs/heads/XWIKI-24710 Home: https://github.com/xwiki/xwiki-platform Commit: 1387d549e50da459460a0ee44e92933ee832fa8b https://github.com/xwiki/xwiki-platform/commit/1387d549e50da459460a0ee44e929... Author: Vincent Massol <[email protected]> Date: 2026-08-25 (Tue, 25 Aug 2026) Changed paths: M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/pom.xml M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/ActiveInstallsConfiguration.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/DataManager.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/internal/DefaultActiveInstallsConfiguration.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/internal/DefaultDataManager.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/script/ActiveInstallsScriptService.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/test/it/org/xwiki/activeinstalls2/internal/PingSenderIT.java A xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/test/java/org/xwiki/activeinstalls2/ActiveInstallsConfigurationTest.java A xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/test/java/org/xwiki/activeinstalls2/DataManagerTest.java A xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/test/java/org/xwiki/activeinstalls2/internal/DefaultActiveInstallsConfigurationTest.java A xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/test/java/org/xwiki/activeinstalls2/script/ActiveInstallsScriptServiceTest.java M xwiki-platform-tools/xwiki-platform-tool-configuration-resources/src/main/resources/xwiki.properties.vm Log Message: ----------- XWIKI-24710: Add script APIs to count distinct active installs globally and per extension * Add DataManager#countDistinctInstalls(), counting the distinct instances matching a query with a cardinality aggregation on the instance id. Contrary to countInstalls(), which counts pings, this counts installs: an instance pings once a day but also on every restart. * Add DataManager#countDistinctInstallsByExtension(), returning the same count per extension id in a single query. It uses a reverse nested aggregation since the extensions are indexed as a nested type while the instance id is on the root document. * Expose both through the activeinstalls2 script service. * Both methods are default methods throwing their declared checked exception, so that existing DataManager implementations keep working. * Set the cardinality precision threshold explicitly on both aggregations: the maximum Elasticsearch supports for the global count, and the lower default for the per-extension one, which pays that memory once per extension bucket. Document in both APIs the count above which the result is an approximation. * Return the per-extension counts in the order Elasticsearch returns them rather than in a hash order. * Add ActiveInstallsConfiguration#getMaxExtensionCount(), configurable with the new activeinstalls2.maxExtensionCount property, to bound how many extensions a single per-extension count can report. This makes both the point at which the query starts failing and the cost it can impose on the Elasticsearch cluster configurable. * Add unit tests for the DataManager and ActiveInstallsConfiguration default methods, for the script service and for the configuration, and raise the module's instruction coverage ratios accordingly. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications