From b6b9f5478d77f48ff416d856d57701ea39715a20 Mon Sep 17 00:00:00 2001 From: pj-cegeka Date: Tue, 3 Oct 2023 14:32:27 +0200 Subject: [PATCH 1/6] feat: create statistics page --- .../ldes-fragmentisers-geospatial/README.MD | 2 +- .../service/StatisticsConstants.java | 27 +++ .../statistics/service/StatisticsService.java | 7 + .../service/StatisticsServiceImpl.java | 107 +++++++++++ .../controllers/StatisticsController.java | 22 +++ .../src/main/java/module-info.java | 2 + .../service/StatisticsServiceImplTest.java | 170 ++++++++++++++++++ .../test/resources/statistics/server-dcat.ttl | 8 + .../server/ingest/MemberEntityRepository.java | 2 + .../server/ingest/MemberRepositoryImpl.java | 21 +++ .../IngestMemberSequenceService.java | 13 ++ .../ingest/repositories/MemberRepository.java | 8 + 12 files changed, 388 insertions(+), 1 deletion(-) create mode 100644 ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsConstants.java create mode 100644 ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsService.java create mode 100644 ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsServiceImpl.java create mode 100644 ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/StatisticsController.java create mode 100644 ldes-server-admin/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsServiceImplTest.java create mode 100644 ldes-server-admin/src/test/resources/statistics/server-dcat.ttl diff --git a/ldes-fragmentisers/ldes-fragmentisers-geospatial/README.MD b/ldes-fragmentisers/ldes-fragmentisers-geospatial/README.MD index c43049455b..79e3d01da2 100644 --- a/ldes-fragmentisers/ldes-fragmentisers-geospatial/README.MD +++ b/ldes-fragmentisers/ldes-fragmentisers-geospatial/README.MD @@ -41,7 +41,7 @@ Example properties: tree:fragmentationStrategy [ a tree:GeospatialFragmentation ; - tree:maxZoom "15" ; + tree:maxZoom 15 ; tree:fragmentationPath ; ] . ``` diff --git a/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsConstants.java b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsConstants.java new file mode 100644 index 0000000000..6989871c1c --- /dev/null +++ b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsConstants.java @@ -0,0 +1,27 @@ +package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.statistics.service; + +public class StatisticsConstants { + private StatisticsConstants() { + } + + public static final String DCT = "http://purl.org/dc/terms/"; + public static final String PROP_SERVERNAME = DCT + "title"; + + public static final String SERVERNAME = "server name"; + + public static final String INGESTED_COUNT = "ingested member count"; + + public static final String CURRENT_COUNT = "current member count"; + + public static final String LDESES = "LDESes"; + + public static final String NAME = "name"; + + public static final String VIEWS = "views"; + + public static final String FRAGMENTATIONS = "fragmentations"; + + public static final String FRAGMENT_PROGRESS = "fragmentation progress"; + + public static final String PROPERTIES = "properties"; +} diff --git a/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsService.java b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsService.java new file mode 100644 index 0000000000..e2ce57693a --- /dev/null +++ b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsService.java @@ -0,0 +1,7 @@ +package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.statistics.service; + +import org.apache.jena.atlas.json.JsonObject; + +public interface StatisticsService { + JsonObject getMetrics(); +} diff --git a/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsServiceImpl.java b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsServiceImpl.java new file mode 100644 index 0000000000..11cd71f101 --- /dev/null +++ b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsServiceImpl.java @@ -0,0 +1,107 @@ +package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.statistics.service; + +import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.repositories.DcatServerRepository; +import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventstream.repository.EventStreamRepository; +import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.view.repository.ViewRepository; +import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.EventStream; +import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.FragmentationConfig; +import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.ViewName; +import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.ViewSpecification; +import be.vlaanderen.informatievlaanderen.ldes.server.fragmentation.entities.FragmentSequence; +import be.vlaanderen.informatievlaanderen.ldes.server.fragmentation.repository.FragmentSequenceRepository; +import be.vlaanderen.informatievlaanderen.ldes.server.ingest.repositories.MemberRepository; +import org.apache.jena.atlas.json.JsonArray; +import org.apache.jena.atlas.json.JsonObject; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Statement; +import org.springframework.stereotype.Service; + +import java.util.Objects; + +import static be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.statistics.service.StatisticsConstants.*; +import static org.apache.jena.rdf.model.ResourceFactory.createProperty; + +@Service +public class StatisticsServiceImpl implements StatisticsService { + + private final DcatServerRepository dcatServerRepository; + private final MemberRepository memberRepository; + private final EventStreamRepository eventStreamRepository; + private final ViewRepository viewRepository; + private final FragmentSequenceRepository fragmentSequenceRepository; + + public StatisticsServiceImpl(DcatServerRepository dcatServerRepository, MemberRepository memberRepository, + EventStreamRepository eventStreamRepository, ViewRepository viewRepository, + FragmentSequenceRepository fragmentSequenceRepository) { + this.dcatServerRepository = dcatServerRepository; + this.memberRepository = memberRepository; + this.eventStreamRepository = eventStreamRepository; + this.viewRepository = viewRepository; + this.fragmentSequenceRepository = fragmentSequenceRepository; + } + + @Override + public JsonObject getMetrics() { + JsonObject json = new JsonObject(); + dcatServerRepository.findSingleDcatServer() + .ifPresent(dcatServer -> dcatServer.getDcat() + .listStatements(null, createProperty(PROP_SERVERNAME), (RDFNode) null) + .forEach(statement -> json.put(SERVERNAME + getLanguage(statement), statement.getString()))); + json.put(INGESTED_COUNT, memberRepository.getTotalSequence()); + json.put(CURRENT_COUNT, memberRepository.getMemberCount()); + + JsonArray eventStreamJsons = new JsonArray(); + eventStreamRepository.retrieveAllEventStreams().stream().map(this::getLdesJson).forEach(eventStreamJsons::add); + json.put(LDESES, eventStreamJsons); + return json; + } + + private String getLanguage(Statement statement) { + return Objects.equals(statement.getLanguage(), "") ? "" : " " + statement.getLanguage(); + } + + private JsonObject getLdesJson(EventStream eventStream) { + JsonObject ldesJson = new JsonObject(); + ldesJson.put(NAME, eventStream.getCollection()); + + long ingestedMembers = memberRepository.getSequenceForCollection(eventStream.getCollection()); + ldesJson.put(INGESTED_COUNT, ingestedMembers); + ldesJson.put(CURRENT_COUNT, memberRepository.getMemberCountOfCollection(eventStream.getCollection())); + + JsonArray viewJsons = new JsonArray(); + viewRepository.retrieveAllViewsOfCollection(eventStream.getCollection()).stream() + .map(view -> getViewJson(view, ingestedMembers)).forEach(viewJsons::add); + ldesJson.put(VIEWS, viewJsons); + return ldesJson; + } + + private JsonObject getViewJson(ViewSpecification view, long ingestedMembers) { + JsonObject viewJson = new JsonObject(); + viewJson.put(NAME, view.getName().asString()); + + JsonArray fragmentationJsons = new JsonArray(); + view.getFragmentations().stream().map(this::fragmentationConfigToJson).forEach(fragmentationJsons::add); + viewJson.put(FRAGMENTATIONS, fragmentationJsons); + + viewJson.put(FRAGMENT_PROGRESS, calculateFragmentationProgress(view.getName(), ingestedMembers)); + return viewJson; + } + + private long calculateFragmentationProgress(ViewName viewName, long ingestedMembers) { + long lastProcessed = fragmentSequenceRepository.findLastProcessedSequence(viewName) + .map(FragmentSequence::sequenceNr).orElse(0L); + return ingestedMembers == 0 ? 0 + : Math.round((1 - (ingestedMembers - (double) lastProcessed) / ingestedMembers) * 100); + } + + private JsonObject fragmentationConfigToJson(FragmentationConfig config) { + JsonObject fragmentationJson = new JsonObject(); + fragmentationJson.put(NAME, config.getName()); + + JsonObject propJsons = new JsonObject(); + config.getConfig().forEach(propJsons::put); + fragmentationJson.put(PROPERTIES, propJsons); + return fragmentationJson; + } + +} diff --git a/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/StatisticsController.java b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/StatisticsController.java new file mode 100644 index 0000000000..2fe880473a --- /dev/null +++ b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/StatisticsController.java @@ -0,0 +1,22 @@ +package be.vlaanderen.informatievlaanderen.ldes.server.admin.rest.controllers; + +import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.statistics.service.StatisticsService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(value = "/admin/api/v1/statistics") +public class StatisticsController { + + private final StatisticsService statisticsService; + + public StatisticsController(StatisticsService statisticsService) { + this.statisticsService = statisticsService; + } + + @GetMapping + public String getEventStreams() { + return statisticsService.getMetrics().toString(); + } +} diff --git a/ldes-server-admin/src/main/java/module-info.java b/ldes-server-admin/src/main/java/module-info.java index 51b11540ff..993eb5ca02 100644 --- a/ldes-server-admin/src/main/java/module-info.java +++ b/ldes-server-admin/src/main/java/module-info.java @@ -4,6 +4,8 @@ // LDES dependencies requires ldes.domain; + requires ldes.ingest.domain; + requires ldes.fragmentation.domain; // external dependencies requires spring.boot; diff --git a/ldes-server-admin/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsServiceImplTest.java b/ldes-server-admin/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsServiceImplTest.java new file mode 100644 index 0000000000..13e85f7850 --- /dev/null +++ b/ldes-server-admin/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsServiceImplTest.java @@ -0,0 +1,170 @@ +package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.statistics.service; + +import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.entities.DcatServer; +import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.repositories.DcatServerRepository; +import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventstream.repository.EventStreamRepository; +import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.view.repository.ViewRepository; +import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.EventStream; +import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.FragmentationConfig; +import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.ViewName; +import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.ViewSpecification; +import be.vlaanderen.informatievlaanderen.ldes.server.fragmentation.entities.FragmentSequence; +import be.vlaanderen.informatievlaanderen.ldes.server.fragmentation.repository.FragmentSequenceRepository; +import be.vlaanderen.informatievlaanderen.ldes.server.ingest.repositories.MemberRepository; +import org.apache.jena.atlas.json.JsonObject; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.riot.RDFDataMgr; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.net.URISyntaxException; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import static be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.statistics.service.StatisticsConstants.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +class StatisticsServiceImplTest { + private final DcatServerRepository dcatServerRepository = mock(DcatServerRepository.class); + private final MemberRepository memberRepository = mock(MemberRepository.class); + private final EventStreamRepository eventStreamRepository = mock(EventStreamRepository.class); + private final ViewRepository viewRepository = mock(ViewRepository.class); + private final FragmentSequenceRepository fragmentSequenceRepository = mock(FragmentSequenceRepository.class); + + private StatisticsServiceImpl statisticsService; + + @BeforeEach + void setUp() { + statisticsService = new StatisticsServiceImpl(dcatServerRepository, memberRepository, eventStreamRepository, + viewRepository, fragmentSequenceRepository); + } + + @Test + void when_NoLdesPresent_Then_GetMetrics() throws URISyntaxException { + when(eventStreamRepository.retrieveAllEventStreams()).thenReturn(List.of()); + Model serverDcat = readModelFromFile("statistics/server-dcat.ttl"); + when(dcatServerRepository.findSingleDcatServer()).thenReturn(Optional.of(new DcatServer("", serverDcat))); + when(memberRepository.getTotalSequence()).thenReturn(100L); + when(memberRepository.getMemberCount()).thenReturn(90L); + + JsonObject json = statisticsService.getMetrics(); + + assertEquals(List.of(), json.get(LDESES)); + assertEquals('"'+"My LDES'es"+'"', json.get(SERVERNAME + " en").toString()); + assertEquals('"'+"Mijn LDESen"+'"', json.get(SERVERNAME + " nl").toString()); + assertEquals('"'+"LDES titel"+'"', json.get(SERVERNAME).toString()); + assertEquals("100", json.get(INGESTED_COUNT).toString()); + assertEquals("90", json.get(CURRENT_COUNT).toString()); + } + + @Test + void when_LDESesWithNoViewsPresent_Then_GetMetrics() { + String collectionName = "collection"; + String otherCollectionName = "otherCollection"; + EventStream ldes = new EventStream(collectionName, "timestamp", "version", "membertype"); + EventStream ldes2 = new EventStream(otherCollectionName, "timestamp", "version", "membertype"); + when(eventStreamRepository.retrieveAllEventStreams()).thenReturn(List.of(ldes, ldes2)); + + when(viewRepository.retrieveAllViewsOfCollection(collectionName)).thenReturn(List.of()); + when(memberRepository.getSequenceForCollection(collectionName)).thenReturn(100L); + when(memberRepository.getMemberCountOfCollection(collectionName)).thenReturn(90L); + + when(viewRepository.retrieveAllViewsOfCollection(otherCollectionName)).thenReturn(List.of()); + when(memberRepository.getSequenceForCollection(otherCollectionName)).thenReturn(80L); + when(memberRepository.getMemberCountOfCollection(otherCollectionName)).thenReturn(40L); + + JsonObject json = statisticsService.getMetrics(); + + JsonObject ldesJson = json.get(LDESES).getAsArray().get(0).getAsObject(); + assertEquals('"' + collectionName + '"', ldesJson.get(NAME).toString()); + assertEquals("100", ldesJson.get(INGESTED_COUNT).toString()); + assertEquals("90", ldesJson.get(CURRENT_COUNT).toString()); + assertEquals(List.of(), ldesJson.get(VIEWS)); + + JsonObject ldes2Json = json.get(LDESES).getAsArray().get(1).getAsObject(); + assertEquals('"' + otherCollectionName + '"', ldes2Json.get(NAME).toString()); + assertEquals("80", ldes2Json.get(INGESTED_COUNT).toString()); + assertEquals("40", ldes2Json.get(CURRENT_COUNT).toString()); + assertEquals(List.of(), ldes2Json.get(VIEWS)); + } + + @Test + void when_ViewsWithNoFragmentationsArePresent_Then_GetMetrics() { + String collectionName = "collection"; + ViewName viewName = new ViewName(collectionName, "viewName"); + ViewName viewName2 = new ViewName(collectionName, "otherViewName"); + ViewName viewName3 = new ViewName(collectionName, "thirdViewName"); + EventStream ldes = new EventStream(collectionName, "timestamp", "version", "membertype"); + ViewSpecification view = new ViewSpecification(viewName, List.of(), List.of(), 100); + ViewSpecification view2 = new ViewSpecification(viewName2, List.of(), List.of(), 100); + ViewSpecification view3 = new ViewSpecification(viewName3, List.of(), List.of(), 100); + + when(eventStreamRepository.retrieveAllEventStreams()).thenReturn(List.of(ldes)); + when(viewRepository.retrieveAllViewsOfCollection(collectionName)).thenReturn(List.of(view, view2, view3)); + when(memberRepository.getSequenceForCollection(collectionName)).thenReturn(200L); + when(fragmentSequenceRepository.findLastProcessedSequence(viewName)).thenReturn(Optional.empty()); + when(fragmentSequenceRepository.findLastProcessedSequence(viewName2)) + .thenReturn(Optional.of(new FragmentSequence(viewName2, 153L))); + when(fragmentSequenceRepository.findLastProcessedSequence(viewName3)) + .thenReturn(Optional.of(new FragmentSequence(viewName3, 200L))); + + JsonObject json = statisticsService.getMetrics(); + + JsonObject ldesJson = json.get(LDESES).getAsArray().get(0).getAsObject(); + JsonObject viewJson = ldesJson.get(VIEWS).getAsArray().get(0).getAsObject(); + assertEquals('"' + viewName.asString() + '"', viewJson.get(NAME).toString()); + assertEquals(List.of(), viewJson.get(FRAGMENTATIONS)); + assertEquals("0", viewJson.get(FRAGMENT_PROGRESS).toString()); + + JsonObject view2Json = ldesJson.get(VIEWS).getAsArray().get(1).getAsObject(); + assertEquals('"' + viewName2.asString() + '"', view2Json.get(NAME).toString()); + assertEquals(List.of(), view2Json.get(FRAGMENTATIONS)); + assertEquals("77", view2Json.get(FRAGMENT_PROGRESS).toString()); + + JsonObject view3Json = ldesJson.get(VIEWS).getAsArray().get(2).getAsObject(); + assertEquals('"' + viewName3.asString() + '"', view3Json.get(NAME).toString()); + assertEquals(List.of(), view3Json.get(FRAGMENTATIONS)); + assertEquals("100", view3Json.get(FRAGMENT_PROGRESS).toString()); + } + + @Test + void when_ViewWithFragmentationsIsPresent_Then_GetMetrics() { + String collectionName = "collection"; + ViewName viewName = new ViewName(collectionName, "viewName"); + String fragmentationName = "HierarchicalTimeBasedFragmentation"; + EventStream ldes = new EventStream(collectionName, "timestamp", "version", "membertype"); + FragmentationConfig fragmentation = new FragmentationConfig(); + fragmentation.setName(fragmentationName); + Map properties = Map.of("maxGranularity", "minute", "fragmentationPath", + "http://www.w3.org/ns/prov#generatedAtTime"); + fragmentation.setConfig(properties); + ViewSpecification view = new ViewSpecification(viewName, List.of(), List.of(fragmentation), 100); + + when(eventStreamRepository.retrieveAllEventStreams()).thenReturn(List.of(ldes)); + when(viewRepository.retrieveAllViewsOfCollection(collectionName)).thenReturn(List.of(view)); + when(memberRepository.getSequenceForCollection(collectionName)).thenReturn(200L); + when(fragmentSequenceRepository.findLastProcessedSequence(viewName)).thenReturn(Optional.empty()); + + JsonObject json = statisticsService.getMetrics(); + + JsonObject ldesJson = json.get(LDESES).getAsArray().get(0).getAsObject(); + JsonObject viewJson = ldesJson.get(VIEWS).getAsArray().get(0).getAsObject(); + JsonObject fragmentationJson = viewJson.get(FRAGMENTATIONS).getAsArray().get(0).getAsObject(); + + assertEquals('"' + fragmentationName + '"', fragmentationJson.get(NAME).toString()); + JsonObject propertiesJson = fragmentationJson.get(PROPERTIES).getAsObject(); + assertEquals('"' + "minute" + '"', propertiesJson.get("maxGranularity").toString()); + assertEquals('"' + "http://www.w3.org/ns/prov#generatedAtTime" + '"', + propertiesJson.get("fragmentationPath").toString()); + } + + private Model readModelFromFile(String fileName) throws URISyntaxException { + ClassLoader classLoader = getClass().getClassLoader(); + String uri = Objects.requireNonNull(classLoader.getResource(fileName)).toURI().toString(); + return RDFDataMgr.loadModel(uri); + } +} \ No newline at end of file diff --git a/ldes-server-admin/src/test/resources/statistics/server-dcat.ttl b/ldes-server-admin/src/test/resources/statistics/server-dcat.ttl new file mode 100644 index 0000000000..fe26f652b8 --- /dev/null +++ b/ldes-server-admin/src/test/resources/statistics/server-dcat.ttl @@ -0,0 +1,8 @@ +@prefix dct: . +@prefix dcat: . + +[] a dcat:Catalog ; + dct:title "My LDES'es"@en ; + dct:title "Mijn LDESen"@nl ; + dct:title "LDES titel" ; + dct:description "All LDES'es from publiser X"@en . \ No newline at end of file diff --git a/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberEntityRepository.java b/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberEntityRepository.java index 8205007b63..9ad2dd4e81 100644 --- a/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberEntityRepository.java +++ b/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberEntityRepository.java @@ -19,4 +19,6 @@ public interface MemberEntityRepository extends MongoRepository findFirstByCollectionNameAndSequenceNrGreaterThanOrderBySequenceNrAsc(String collectionName, long sequenceNr); + long countByCollectionName(String collectionName); + } diff --git a/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositoryImpl.java b/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositoryImpl.java index 79b8ec3af5..65d591192c 100644 --- a/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositoryImpl.java +++ b/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositoryImpl.java @@ -72,4 +72,25 @@ public Optional findFirstByCollectionNameAndSequenceNrGreaterThan(String .findFirstByCollectionNameAndSequenceNrGreaterThanOrderBySequenceNrAsc(collectionName, sequenceNr) .map(memberEntityMapper::toMember); } + + @Override + public long getMemberCount() { + return memberEntityRepository.count(); + } + + @Override + public long getMemberCountOfCollection(String collectionName) { + return memberEntityRepository.countByCollectionName(collectionName); + } + + @Override + public long getTotalSequence() { + return sequenceService.getTotalSequence(); + } + + @Override + public long getSequenceForCollection(String collectionName) { + return sequenceService.getSequenceForCollection(collectionName); + } + } diff --git a/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceService.java b/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceService.java index 81409813b1..87c6921657 100644 --- a/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceService.java +++ b/ldes-server-infra-mongo/mongo-ingest-repository/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceService.java @@ -29,6 +29,19 @@ long generateSequence(String collectionName) { return !Objects.isNull(counter) ? counter.getSeq() : 1; } + public long getSequenceForCollection(String collectionName) { + IngestMemberSequenceEntity counter = mongoOperations.find( + query(where("_id").is(collectionName)), + IngestMemberSequenceEntity.class).get(0); + return !Objects.isNull(counter) ? counter.getSeq() : 1; + } + + public long getTotalSequence() { + return mongoOperations.findAll( + IngestMemberSequenceEntity.class).stream() + .reduce(0L, (subtotal, sequence) -> subtotal + sequence.getSeq(), Long::sum); + } + public void removeSequence(String collectionName) { mongoOperations.findAndRemove( query(where("_id").is(collectionName)), diff --git a/ldes-server-port-ingest/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/repositories/MemberRepository.java b/ldes-server-port-ingest/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/repositories/MemberRepository.java index b94a0294a0..f35ceb977b 100644 --- a/ldes-server-port-ingest/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/repositories/MemberRepository.java +++ b/ldes-server-port-ingest/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/repositories/MemberRepository.java @@ -23,4 +23,12 @@ public interface MemberRepository { void deleteMember(String memberId); Optional findFirstByCollectionNameAndSequenceNrGreaterThan(String collectionName, long sequenceNr); + + long getMemberCount(); + + long getMemberCountOfCollection(String collectionName); + + long getTotalSequence(); + + long getSequenceForCollection(String collectionName); } From ed739e1e2f52be7b7ded3b3fc18780b6662b063d Mon Sep 17 00:00:00 2001 From: pj-cegeka Date: Tue, 3 Oct 2023 14:50:07 +0200 Subject: [PATCH 2/6] feat: add OpenApiStatisticsController --- .../OpenApiStatisticsController.java | 46 +++++++++++++++++++ .../controllers/StatisticsController.java | 6 +-- 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/OpenApiStatisticsController.java diff --git a/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/OpenApiStatisticsController.java b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/OpenApiStatisticsController.java new file mode 100644 index 0000000000..3063d3c596 --- /dev/null +++ b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/OpenApiStatisticsController.java @@ -0,0 +1,46 @@ +package be.vlaanderen.informatievlaanderen.ldes.server.admin.rest.controllers; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; + +@SuppressWarnings("java:S2479") // whitespace needed for examples +@Tag(name = "Statistics") +public interface OpenApiStatisticsController { + + @Operation(summary = "Retrieve json with statistics of the LDES server") + @ApiResponse(responseCode = "200", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class), examples = @ExampleObject(value = """ + { + "ingested member count": 4018, + "current member count": 4018, + "LDESes": [ + { + "name": "mobility-hindrances", + "ingested member count": 4018, + "current member count": 4018, + "views": [ + { + "name": "mobility-hindrances/timebased", + "fragmentations": [ + { + "name": "HierarchicalTimeBasedFragmentation", + "properties": { + "maxGranularity": "minute", + "fragmentationPath": "http://www.w3.org/ns/prov#generatedAtTime" + } + } + ], + "fragmentation progress": 100 + } + ] + } + ] + } + """)), + }) + String getStatistics(); +} diff --git a/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/StatisticsController.java b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/StatisticsController.java index 2fe880473a..ece8c1a623 100644 --- a/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/StatisticsController.java +++ b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/rest/controllers/StatisticsController.java @@ -7,7 +7,7 @@ @RestController @RequestMapping(value = "/admin/api/v1/statistics") -public class StatisticsController { +public class StatisticsController implements OpenApiStatisticsController { private final StatisticsService statisticsService; @@ -15,8 +15,8 @@ public StatisticsController(StatisticsService statisticsService) { this.statisticsService = statisticsService; } - @GetMapping - public String getEventStreams() { + @GetMapping(produces = { "application/json" }) + public String getStatistics() { return statisticsService.getMetrics().toString(); } } From bcd36ef70fb7ca04dc21a2daab876d534cdfaf5f Mon Sep 17 00:00:00 2001 From: pj-cegeka Date: Tue, 3 Oct 2023 15:24:30 +0200 Subject: [PATCH 3/6] feat: add tests --- .../server/ingest/MemberRepositorySteps.java | 10 ++++++++ .../IngestMemberSequenceServiceTest.java | 23 +++++++++++++++++++ .../test/resources/features/member.feature | 11 +++++++++ 3 files changed, 44 insertions(+) diff --git a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositorySteps.java b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositorySteps.java index 0d10a401cd..1a6ac7bf8f 100644 --- a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositorySteps.java +++ b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositorySteps.java @@ -129,4 +129,14 @@ public void iSearchForTheFirstMemberFromCollectionAndSequenceNrGreaterThan(Strin public void theRetrievedMemberIsEmpty() { assertTrue(retrievedMember.isEmpty()); } + + @Then("The number of members is {int}") + public void theRetrievedMemberIsEmpty(int memberCount) { + assertEquals(memberCount, memberRepository.getMemberCount()); + } + + @Then("The number of members of the {string} collection is {int}") + public void theRetrievedMemberIsEmpty(String collectionName, int memberCount) { + assertEquals(memberCount, memberRepository.getMemberCountOfCollection(collectionName)); + } } diff --git a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceServiceTest.java b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceServiceTest.java index 81928906e7..1136d53ce1 100644 --- a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceServiceTest.java +++ b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceServiceTest.java @@ -5,6 +5,8 @@ import org.springframework.data.mongodb.core.MongoOperations; import org.springframework.data.mongodb.core.query.Update; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; @@ -40,4 +42,25 @@ void test_memberSequenceEntityIsNull() { assertEquals(1, sequence); } + @Test + void when_MultipleLDESes_Then_getCorrectSequence() { + IngestMemberSequenceEntity ingestMemberSequenceEntity = new IngestMemberSequenceEntity(); + ingestMemberSequenceEntity.setId("collectionName"); + ingestMemberSequenceEntity.setSeq(100); + when(mongoOperations.find(eq(query(where("_id").is("collectionName"))), + eq(IngestMemberSequenceEntity.class))).thenReturn(List.of(ingestMemberSequenceEntity)); + IngestMemberSequenceEntity ingestMemberSequenceEntity2 = new IngestMemberSequenceEntity(); + ingestMemberSequenceEntity2.setId("otherCollectionName"); + ingestMemberSequenceEntity2.setSeq(150); + when(mongoOperations.find(eq(query(where("_id").is("otherCollectionName"))), + eq(IngestMemberSequenceEntity.class))).thenReturn(List.of(ingestMemberSequenceEntity2)); + when(mongoOperations.findAll(IngestMemberSequenceEntity.class)) + .thenReturn(List.of(ingestMemberSequenceEntity, ingestMemberSequenceEntity2)); + + assertEquals(250, ingestMemberSequenceService.getTotalSequence()); + assertEquals(100, ingestMemberSequenceService.getSequenceForCollection("collectionName")); + assertEquals(150, ingestMemberSequenceService.getSequenceForCollection("otherCollectionName")); + + } + } \ No newline at end of file diff --git a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/resources/features/member.feature b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/resources/features/member.feature index 4c274afdf4..ee9798740c 100644 --- a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/resources/features/member.feature +++ b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/resources/features/member.feature @@ -111,3 +111,14 @@ Feature: MemberRepository Then The retrieved member has the same properties as the 1 member in the table and has sequenceNr 5 When I search for the first member from collection "mobility-hindrances" and sequenceNr greater than 15 Then The retrieved member is empty + + Scenario: Get current number of members + Given The following members + | id | collectionName | sequenceNr | versionOf | + | http://test-data/mobility-hindrance/1/1 | mobility-hindrances | 5 | http://test-data/mobility-hindrance/1 | + | http://test-data/mobility-hindrance/1/2 | mobility-hindrances | 12 | http://test-data/mobility-hindrance/1 | + | http://test-data/mobility-hindrance/1/3 | mobility-hindrances | 3 | http://test-data/mobility-hindrance/1 | + | http://test-data/other/1/1 | other | 4 | http://test-data/mobility-hindrance/1 | + When I save the members using the MemberRepository + Then The number of members is 4 + Then The number of members of the "mobility-hindrances" collection is 3 \ No newline at end of file From b3d0fadfcb6a0b5af9d85b69dbe4a09bc6f3fca1 Mon Sep 17 00:00:00 2001 From: pj-cegeka Date: Tue, 3 Oct 2023 16:11:54 +0200 Subject: [PATCH 4/6] feat: add tests --- .../server/ingest/MemberRepositorySteps.java | 5 ++ .../test/resources/features/member.feature | 58 ++++++++++++------- 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositorySteps.java b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositorySteps.java index 1a6ac7bf8f..c7520a0cb1 100644 --- a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositorySteps.java +++ b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/MemberRepositorySteps.java @@ -139,4 +139,9 @@ public void theRetrievedMemberIsEmpty(int memberCount) { public void theRetrievedMemberIsEmpty(String collectionName, int memberCount) { assertEquals(memberCount, memberRepository.getMemberCountOfCollection(collectionName)); } + + @Then("I delete all members from the {string} collection") + public void theRetrievedMemberIsEmpty(String collectionName) { + memberRepository.deleteMembersByCollection(collectionName); + } } diff --git a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/resources/features/member.feature b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/resources/features/member.feature index ee9798740c..938cf86187 100644 --- a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/resources/features/member.feature +++ b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/resources/features/member.feature @@ -9,6 +9,7 @@ Feature: MemberRepository When I save the members using the MemberRepository Then The member with id "http://test-data/mobility-hindrance/1/1" can be retrieved from the database And The retrieved member has the same properties as the 1 member in the table and has sequenceNr 15 + And I delete all members from the "mobility-hindrances" collection Scenario: Saving members without a sequenceNr which gets a sequenceNr assigned Given The following members @@ -29,6 +30,8 @@ Feature: MemberRepository And The retrieved member has the same properties as the 3 member in the table and has sequenceNr 1 Then The member with id "http://test-data/gipod/1/2" can be retrieved from the database And The retrieved member has the same properties as the 5 member in the table and has sequenceNr 2 + And I delete all members from the "mobility-hindrances" collection + And I delete all members from the "gipod" collection Scenario: The repository can delete all members of a certain collection Given The following members @@ -46,6 +49,8 @@ Feature: MemberRepository And The member with id "http://test-data/gipod/1/2" will not exist And The sequence for "gipod" will have been removed And The sequence for "mobility-hindrances" will still exist + And I delete all members from the "mobility-hindrances" collection + And I delete all members from the "gipod" collection Scenario: The repository can indicate if members exist or not Given The following members @@ -54,6 +59,7 @@ Feature: MemberRepository When I save the members using the MemberRepository Then The member with id "http://test-data/mobility-hindrance/1/1" will exist And The member with id "http://test-data/mobility-hindrance/fantasy-id" will not exist + And I delete all members from the "mobility-hindrances" collection Scenario: The repository can provide a stream of the eventsource Given The following members @@ -66,6 +72,8 @@ Feature: MemberRepository When I save the members using the MemberRepository Then I can get an ordered stream from all the members of the "mobility-hindrances" collection containing 3 members And I can get an ordered stream from all the members of the "gipod" collection containing 2 members + And I delete all members from the "mobility-hindrances" collection + And I delete all members from the "gipod" collection Scenario: The repository can bulk retrieve members Given The following members @@ -79,13 +87,17 @@ Feature: MemberRepository When I try to retrieve the following members by Id | http://test-data/mobility-hindrance/1/1 | http://test-data/mobility-hindrance/1/2 | http://test-data/mobility-hindrance/1/3 | Then I expect a list of 3 members - Scenario: The repository can indicate if members exist or not - Given The following members - | id | collectionName | sequenceNr | versionOf | - | http://test-data/mobility-hindrance/1/1 | mobility-hindrances | [blank] | http://test-data/mobility-hindrance/1 | - When I save the members using the MemberRepository - Then The member with id "http://test-data/mobility-hindrance/1/1" will exist - And The member with id "http://test-data/mobility-hindrance/fantasy-id" will not exist + And I delete all members from the "mobility-hindrances" collection + And I delete all members from the "gipod" collection + + Scenario: The repository can indicate if members exist or not + Given The following members + | id | collectionName | sequenceNr | versionOf | + | http://test-data/mobility-hindrance/1/1 | mobility-hindrances | [blank] | http://test-data/mobility-hindrance/1 | + When I save the members using the MemberRepository + Then The member with id "http://test-data/mobility-hindrance/1/1" will exist + And The member with id "http://test-data/mobility-hindrance/fantasy-id" will not exist + And I delete all members from the "mobility-hindrances" collection Scenario: Delete a member with a certain id Given The following members @@ -97,20 +109,22 @@ Feature: MemberRepository When I delete the member with id "http://test-data/mobility-hindrance/1/1" Then The member with id "http://test-data/mobility-hindrance/1/2" will exist And The member with id "http://test-data/mobility-hindrance/1/1" will not exist + And I delete all members from the "mobility-hindrances" collection - Scenario: Find member by collection name and sequence number greater than - Given The following members - | id | collectionName | sequenceNr | versionOf | - | http://test-data/mobility-hindrance/1/1 | mobility-hindrances | 5 | http://test-data/mobility-hindrance/1 | - | http://test-data/mobility-hindrance/1/2 | mobility-hindrances | 12 | http://test-data/mobility-hindrance/1 | - | http://test-data/mobility-hindrance/1/3 | mobility-hindrances | 3 | http://test-data/mobility-hindrance/1 | - When I save the members using the MemberRepository - And I search for the first member from collection "mobility-hindrances" and sequenceNr greater than -1 - Then The retrieved member has the same properties as the 3 member in the table and has sequenceNr 3 - When I search for the first member from collection "mobility-hindrances" and sequenceNr greater than 3 - Then The retrieved member has the same properties as the 1 member in the table and has sequenceNr 5 - When I search for the first member from collection "mobility-hindrances" and sequenceNr greater than 15 - Then The retrieved member is empty + Scenario: Find member by collection name and sequence number greater than + Given The following members + | id | collectionName | sequenceNr | versionOf | + | http://test-data/mobility-hindrance/1/1 | mobility-hindrances | 5 | http://test-data/mobility-hindrance/1 | + | http://test-data/mobility-hindrance/1/2 | mobility-hindrances | 12 | http://test-data/mobility-hindrance/1 | + | http://test-data/mobility-hindrance/1/3 | mobility-hindrances | 3 | http://test-data/mobility-hindrance/1 | + When I save the members using the MemberRepository + And I search for the first member from collection "mobility-hindrances" and sequenceNr greater than -1 + Then The retrieved member has the same properties as the 3 member in the table and has sequenceNr 3 + When I search for the first member from collection "mobility-hindrances" and sequenceNr greater than 3 + Then The retrieved member has the same properties as the 1 member in the table and has sequenceNr 5 + When I search for the first member from collection "mobility-hindrances" and sequenceNr greater than 15 + Then The retrieved member is empty + And I delete all members from the "mobility-hindrances" collection Scenario: Get current number of members Given The following members @@ -121,4 +135,6 @@ Feature: MemberRepository | http://test-data/other/1/1 | other | 4 | http://test-data/mobility-hindrance/1 | When I save the members using the MemberRepository Then The number of members is 4 - Then The number of members of the "mobility-hindrances" collection is 3 \ No newline at end of file + And The number of members of the "mobility-hindrances" collection is 3 + And I delete all members from the "mobility-hindrances" collection + And I delete all members from the "other" collection \ No newline at end of file From 279cecaeecca16924278bd14604f37d82c8c79b3 Mon Sep 17 00:00:00 2001 From: pj-cegeka Date: Tue, 3 Oct 2023 16:25:15 +0200 Subject: [PATCH 5/6] feat: remove code smells --- .../membersequence/IngestMemberSequenceServiceTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceServiceTest.java b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceServiceTest.java index 1136d53ce1..d98d6db39c 100644 --- a/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceServiceTest.java +++ b/ldes-server-infra-mongo/mongo-ingest-repository/src/test/java/be/vlaanderen/informatievlaanderen/ldes/server/ingest/membersequence/IngestMemberSequenceServiceTest.java @@ -47,13 +47,13 @@ void when_MultipleLDESes_Then_getCorrectSequence() { IngestMemberSequenceEntity ingestMemberSequenceEntity = new IngestMemberSequenceEntity(); ingestMemberSequenceEntity.setId("collectionName"); ingestMemberSequenceEntity.setSeq(100); - when(mongoOperations.find(eq(query(where("_id").is("collectionName"))), - eq(IngestMemberSequenceEntity.class))).thenReturn(List.of(ingestMemberSequenceEntity)); + when(mongoOperations.find(query(where("_id").is("collectionName")), + IngestMemberSequenceEntity.class)).thenReturn(List.of(ingestMemberSequenceEntity)); IngestMemberSequenceEntity ingestMemberSequenceEntity2 = new IngestMemberSequenceEntity(); ingestMemberSequenceEntity2.setId("otherCollectionName"); ingestMemberSequenceEntity2.setSeq(150); - when(mongoOperations.find(eq(query(where("_id").is("otherCollectionName"))), - eq(IngestMemberSequenceEntity.class))).thenReturn(List.of(ingestMemberSequenceEntity2)); + when(mongoOperations.find(query(where("_id").is("otherCollectionName")), + IngestMemberSequenceEntity.class)).thenReturn(List.of(ingestMemberSequenceEntity2)); when(mongoOperations.findAll(IngestMemberSequenceEntity.class)) .thenReturn(List.of(ingestMemberSequenceEntity, ingestMemberSequenceEntity2)); From a9cab6d04e7aa282680d5ff84d3e05e43905c890 Mon Sep 17 00:00:00 2001 From: pj-cegeka Date: Thu, 5 Oct 2023 18:00:38 +0200 Subject: [PATCH 6/6] feat: changed membercount name --- .../admin/domain/statistics/service/StatisticsConstants.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsConstants.java b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsConstants.java index 6989871c1c..ded907e73b 100644 --- a/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsConstants.java +++ b/ldes-server-admin/src/main/java/be/vlaanderen/informatievlaanderen/ldes/server/admin/domain/statistics/service/StatisticsConstants.java @@ -9,9 +9,9 @@ private StatisticsConstants() { public static final String SERVERNAME = "server name"; - public static final String INGESTED_COUNT = "ingested member count"; + public static final String INGESTED_COUNT = "member count"; - public static final String CURRENT_COUNT = "current member count"; + public static final String CURRENT_COUNT = "currently retained member count"; public static final String LDESES = "LDESes";