File tree Expand file tree Collapse file tree 4 files changed +32
-1
lines changed
iexec-task-api/src/main/java/com/iexec/core/metric
main/java/com/iexec/core/metric
test/java/com/iexec/core/metric Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ All notable changes to this project will be documented in this file.
1313- Configuration server is now optional by default. (#728 )
1414- Improve switch statements after Java 17 migration. (#729 )
1515- Remove redundant blockchain calls to diminish pressure on Ethereum JSON-RPC API. (#734 )
16- - Compute alive workers metrics in ` WorkerService#updateMetrics ` scheduled job. (#739 )
16+ - Compute alive workers metrics in ` WorkerService#updateMetrics ` scheduled job. (#739 # 745 )
1717- Fix Spring Security deprecations after Spring Boot 3.3.8 upgrade. (#740 )
1818- Remove code related to reopen PoCo feature in ` IexecHubService ` and ` TaskUpdateManager ` . (#743 )
1919- Harmonize YML internal variables to proper case. (#744 )
Original file line number Diff line number Diff line change @@ -40,6 +40,29 @@ public class PlatformMetric {
4040 long replayDealsCount ;
4141 BigInteger latestBlockNumberWithDeal ;
4242
43+ // region backward compatibility
44+ /**
45+ * @deprecated Use aliveComputingCpu = aliveRegisteredCpu - aliveComputingCpu instead
46+ */
47+ @ Deprecated (forRemoval = true , since = "9.0.0" )
48+ int aliveAvailableCpu ;
49+ /**
50+ * @deprecated Use aliveRegisteredCpu instead
51+ */
52+ @ Deprecated (forRemoval = true , since = "9.0.0" )
53+ int aliveTotalCpu ;
54+ /**
55+ * @deprecated Use aliveComputingGpu = aliveRegisteredGpu - aliveComputingGpu instead
56+ */
57+ @ Deprecated (forRemoval = true , since = "9.0.0" )
58+ int aliveAvailableGpu ;
59+ /**
60+ * @deprecated Use aliveRegisteredGpu instead
61+ */
62+ @ Deprecated (forRemoval = true , since = "9.0.0" )
63+ int aliveTotalGpu ;
64+ // endregion
65+
4366 @ JsonPOJOBuilder (withPrefix = "" )
4467 public static class PlatformMetricBuilder {
4568 }
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ public PlatformMetric getPlatformMetrics() {
5353 .dealsCount (dealWatcherService .getDealsCount ())
5454 .replayDealsCount (dealWatcherService .getReplayDealsCount ())
5555 .latestBlockNumberWithDeal (dealWatcherService .getLatestBlockNumberWithDeal ())
56+ .aliveAvailableCpu (aliveWorkerMetrics .aliveRegisteredCpu () - aliveWorkerMetrics .aliveComputingCpu ())
57+ .aliveTotalCpu (aliveWorkerMetrics .aliveRegisteredCpu ())
58+ .aliveAvailableGpu (aliveWorkerMetrics .aliveRegisteredGpu () - aliveWorkerMetrics .aliveComputingGpu ())
59+ .aliveTotalGpu (aliveWorkerMetrics .aliveRegisteredGpu ())
5660 .build ();
5761 }
5862
Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ void shouldGetPlatformMetrics() {
6464
6565 PlatformMetric metric = metricService .getPlatformMetrics ();
6666 Assertions .assertAll (
67+ () -> assertThat (metric .getAliveAvailableCpu ()).isZero (),
68+ () -> assertThat (metric .getAliveTotalCpu ()).isEqualTo (1 ),
69+ () -> assertThat (metric .getAliveAvailableGpu ()).isZero (),
70+ () -> assertThat (metric .getAliveTotalGpu ()).isEqualTo (1 ),
6771 () -> assertThat (metric .getAliveWorkers ()).isEqualTo (1 ),
6872 () -> assertThat (metric .getAliveComputingCpu ()).isEqualTo (1 ),
6973 () -> assertThat (metric .getAliveRegisteredCpu ()).isEqualTo (1 ),
You can’t perform that action at this time.
0 commit comments