Error storing daily statistics
See original GitHub issueHi,
I’m getting this error below when calling to a REST mock. I’m running microcks on k8s with 3 pods and trying to find the performance of the application.
11:14:28.072 [ERROR] org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler - Unexpected exception occurred invoking async method: public void io.github.microcks.listener.DailyStatisticsFeeder.onApplicationEvent(io.github.microcks.event.MockInvocationEvent) org.springframework.dao.IncorrectResultSizeDataAccessException: Query { "$java" : Query: { "day" : "20220103", "serviceName" : "First Mock API", "serviceVersion" : "1.0.0"}, Fields: {}, Sort: {} } returned non unique result. at org.springframework.data.mongodb.core.ExecutableFindOperationSupport$ExecutableFindSupport.oneValue(ExecutableFindOperationSupport.java:139) at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.lambda$getExecution$4(AbstractMongoQuery.java:159) at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.doExecute(AbstractMongoQuery.java:132) at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.execute(AbstractMongoQuery.java:107) at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137) at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121) at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:152) at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:131) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) at com.sun.proxy.$Proxy106.findByDayAndServiceNameAndServiceVersion(Unknown Source) at io.github.microcks.listener.DailyStatisticsFeeder.onApplicationEvent(DailyStatisticsFeeder.java:71) at io.github.microcks.listener.DailyStatisticsFeeder.onApplicationEvent(DailyStatisticsFeeder.java:38) at jdk.internal.reflect.GeneratedMethodAccessor67.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
In case this is not easy to solve, would it be possible to disable daily statistics? I’ve checked the code and there is no property to do it right now
Issue Analytics
- State:
- Created 2 years ago
- Comments:24 (13 by maintainers)
I would love to contribute for sure!!! Once I’m done with all the work I want to do we can consider it!!
That would be perfect!! Yes, I’ll keep an eye to that one as well, it would be really useful for my use case
About my use case, it might be a bit different from other users but I think is quite valid. I’m planning to use Microks to decouple dependencies between several services during Load Testing. Basically, I want to exercise different parts of my system individually in different Load Tests and I want to configure mock APIs using Microcks.
The reason for this is to have a clear understanding of how my components will perform individually before checking the whole system.
I think Microcks will be able to do this work quite well using the flag we’ve been discussing.
I have a few more ideas if you want I’ll be happy to discuss (ideas which will involve better monitoring for microcks)