question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error storing daily statistics

See original GitHub issue

Hi,

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:closed
  • Created 2 years ago
  • Comments:24 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
miguelchicoespincommented, Jan 5, 2022

The use-case is great! In case you’re happy with what you’ve done and want to share more, we welcome contributions to our blog https://microcks.io/blog 😉

I would love to contribute for sure!!! Once I’m done with all the work I want to do we can consider it!!

Regarding monitoring, I am currently working on #411. It will bring Prometheus exporters for webapp and async-minion components.

That would be perfect!! Yes, I’ll keep an eye to that one as well, it would be really useful for my use case

2reactions
miguelchicoespincommented, Jan 4, 2022

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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues with data and analyses: Errors, underlying themes, and ...
Errors in long-term data storage and sharing can render findings nonconfirmable because data are not available to be reanalyzed.
Read more >
What is the best way to store statistics? : r/PHP - Reddit
What is the best way to store statistics? · Create two tables (article_statistics & widget_statistics) and track each of their stats there. ·...
Read more >
Six Ways To Reduce Your (Inevitable) Data Errors
Six Ways To Reduce Your (Inevitable) Data Errors · 1. Be skeptical and dubious about your own work · 2. Be extra suspicous...
Read more >
The 7 Biggest Problems in Data Storage - SmartData Collective
These are some of the most important potential data storage issues you'll need to consider: 1. Infrastructure. Data needs a place to rest,...
Read more >
How to efficiently store and query time-series data - Medium
Luckily, the problem of storing and querying time-series data is very frequent today and there are many solutions available on the market.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found