Skip to content
Snippets Groups Projects
Commit a365d212 authored by Tobias Bruns's avatar Tobias Bruns
Browse files

add timing metric for loading vorgangs

parent 8de88cf6
No related branches found
No related tags found
1 merge request!28List performance check
......@@ -60,6 +60,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
</dependency>
<!-- TEST -->
<dependency>
......
......@@ -42,6 +42,9 @@ import org.springframework.security.authentication.AuthenticationTrustResolver;
import org.springframework.security.authentication.AuthenticationTrustResolverImpl;
import org.springframework.security.concurrent.DelegatingSecurityContextRunnable;
import io.micrometer.core.aop.TimedAspect;
import io.micrometer.core.instrument.MeterRegistry;
@SpringBootApplication(scanBasePackages = { "de.ozgcloud" })
@EnableAsync(proxyTargetClass = true)
@EnableScheduling
......@@ -83,4 +86,9 @@ public class VorgangManagerServerApplication {
return eventMulticaster;
}
@Bean
TimedAspect timedAspect(MeterRegistry registry) {
return new TimedAspect(registry);
}
}
\ No newline at end of file
......@@ -34,6 +34,7 @@ import org.springframework.stereotype.Service;
import de.ozgcloud.common.errorhandling.TechnicalException;
import de.ozgcloud.vorgang.common.search.SearchService;
import io.micrometer.core.annotation.Timed;
@Service
class VorgangHeaderService {
......@@ -47,6 +48,7 @@ class VorgangHeaderService {
@Autowired(required = false)
private SearchService searchService;
@Timed("findAllVorgangs")
public Page<VorgangHeader> findAll(FindVorgangRequest request) {
if (nonNull(searchService) && nonNull(request.getSearchBy())) {
return removeUnpermitted(searchService.find(request));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment