Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: JFR Visualizer #252

Merged
merged 18 commits into from
Feb 23, 2024
Merged

Conversation

yanglong1010
Copy link
Contributor

@yanglong1010 yanglong1010 commented Feb 2, 2024

Hi,
The current methods for parsing JFR include Java Mission Control (desktop application), jfr (command line), and JFR.view (command line). It would be very cool to add JFR parsing capabilities to JIFA and parse JFR on the Web. It can generate flame graphs for CPU, Memory Allocation, File IO, Socket IO, Lock, Class load, Thread Sleep and other dimensions, and support filtering by threads, classes, and methods. It also supports parsing wall clock JFR files generated by async-profiler (i.e. --wall 10 -t).
In the future we can add viewing capabilities for raw JFR events, as well as other advanced features.

I would be very grateful if you could review this PR.

@D-D-H D-D-H requested review from D-D-H and leveretconey February 3, 2024 00:03
…ense header "2024" to "2023, 2024" in all modified files
@yanglong1010
Copy link
Contributor Author

Thank you for your suggestions.

@D-D-H
Copy link
Contributor

D-D-H commented Feb 10, 2024

The following exception occurs (only happens when using h2 database) when I try to upload a jfr file:

org.springframework.dao.DataIntegrityViolationException: could not execute statement [Check constraint violation: "CONSTRAINT_3: "; SQL statement:
insert into files (created_time,original_name,size,type,unique_name,user_id,id) values (?,?,?,?,?,?,default) [23513-220]] [insert into files (created_time,original_name,size,type,unique_name,user_id,id) values (?,?,?,?,?,?,default)]; SQL [insert into files (created_time,original_name,size,type,unique_name,user_id,id) values (?,?,?,?,?,?,default)]; constraint ["CONSTRAINT_3: "; SQL statement:
insert into files (created_time,original_name,size,type,unique_name,user_id,id) values (?,?,?,?,?,?,default) [23513-220]]
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:269) ~[spring-orm-6.0.12.jar:6.0.12]
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:229) ~[spring-orm-6.0.12.jar:6.0.12]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:550) ~[spring-orm-6.0.12.jar:6.0.12]
	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) ~[spring-tx-6.0.12.jar:6.0.12]
	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:243) ~[spring-tx-6.0.12.jar:6.0.12]
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152) ~[spring-tx-6.0.12.jar:6.0.12]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.12.jar:6.0.12]
	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:164) ~[spring-data-jpa-3.1.4.jar:3.1.4]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.12.jar:6.0.12]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-6.0.12.jar:6.0.12]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.12.jar:6.0.12]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244) ~[spring-aop-6.0.12.jar:6.0.12]
	at jdk.proxy2/jdk.proxy2.$Proxy141.save(Unknown Source) ~[na:na]
	at org.eclipse.jifa.server.service.impl.FileServiceImpl.lambda$handleUploadRequest$3(FileServiceImpl.java:246) ~[main/:na]
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-6.0.12.jar:6.0.12]
	at org.eclipse.jifa.server.service.impl.FileServiceImpl.handleUploadRequest(FileServiceImpl.java:239) ~[main/:na]
	at org.eclipse.jifa.server.controller.FileController.upload(FileController.java:122) ~[main/:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:884) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1081) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1011) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[tomcat-embed-core-10.1.13.jar:6.0]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.13.jar:6.0]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.eclipse.jifa.server.filter.JwtTokenRefreshFilter.doFilterInternal(JwtTokenRefreshFilter.java:47) ~[main/:na]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.12.jar:6.0.12]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:365) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:100) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:131) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:85) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:179) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.oauth2.server.resource.web.authentication.BearerTokenAuthenticationFilter.doFilterInternal(BearerTokenAuthenticationFilter.java:128) ~[spring-security-oauth2-resource-server-6.1.4.jar:6.1.4]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:82) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:69) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191) ~[spring-security-web-6.1.4.jar:6.1.4]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:352) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:268) ~[spring-web-6.0.12.jar:6.0.12]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.12.jar:6.0.12]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.12.jar:6.0.12]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1740) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.13.jar:10.1.13]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement [Check constraint violation: "CONSTRAINT_3: "; SQL statement:
insert into files (created_time,original_name,size,type,unique_name,user_id,id) values (?,?,?,?,?,?,default) [23513-220]] [insert into files (created_time,original_name,size,type,unique_name,user_id,id) values (?,?,?,?,?,?,default)]
	at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:60) ~[hibernate-core-6.2.9.Final.jar:6.2.9.Final]
	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:56) ~[hibernate-core-6.2.9.Final.jar:6.2.9.Final]
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:108) ~[hibernate-core-6.2.9.Final.jar:6.2.9.Final]
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:278) ~[hibernate-core-6.2.9.Final.jar:6.2.9.Final]
	at org.hibernate.id.insert.GetGeneratedKeysDelegate.performInsert(GetGeneratedKeysDelegate.java:107) ~[hibernate-core-6.2.9.Final.jar:6.2.9.Final]
	at org.hibernate.engine.jdbc.mutation.internal.MutationExecutorPostInsertSingleTable.execute(MutationExecutorPostInsertSingleTable.java:100) ~[hibernate-core-6.2.9.Final.jar:6.2.9.Final]
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement [Check constraint violation: "CONSTRAINT_3: "; SQL statement:

frontend/src/i18n/en.ts Outdated Show resolved Hide resolved
frontend/src/i18n/zh.ts Outdated Show resolved Hide resolved
frontend/src/components/profile/Profile.vue Outdated Show resolved Hide resolved
frontend/src/components/profile/Profile.vue Outdated Show resolved Hide resolved
@D-D-H
Copy link
Contributor

D-D-H commented Feb 10, 2024

It seems like a bug.

image

frontend/src/components/profile/Profile.vue Outdated Show resolved Hide resolved
frontend/src/components/profile/Profile.vue Outdated Show resolved Hide resolved
Copy link
Contributor

@D-D-H D-D-H left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add site documents for this feature.

@yanglong1010
Copy link
Contributor Author

yanglong1010 commented Feb 18, 2024

The following exception occurs (only happens when using h2 database) when I try to upload a jfr file:

org.springframework.dao.DataIntegrityViolationException: could not execute statement [Check constraint violation: "CONSTRAINT_3: "; SQL statement:
insert into files (created_time,original_name,size,type,unique_name,user_id,id) values (?,?,?,?,?,?,default) [23513-220]] [insert into files (created_time,original_name,size,type,unique_name,user_id,id) values (?,?,?,?,?,?,default)]; SQL [insert into files (created_time,original_name,size,type,unique_name,user_id,id) values (?,?,?,?,?,?,default)]; constraint 

Hi, DengHui

Happy Chinese New Year.

I have analyzed this problem and I estimate that it will also be encountered when adding file types in the past. The reasons are as follows.

Now in application.yml, spring.jpa.hibernate.ddl-auto=update, this configuration will automatically add fields to the table, but will not update existing constraints.
I added JFR in FileType. If the H2 file was generated before, there may not be JFR in it. You can use the following command line to open the H2 file, and then use SQL statement to check the specific content in CONSTRAINT_3.

java -cp /path/to/h2-2.2.220.jar org.h2.tools.Shell

select * from INFORMATION_SCHEMA.CHECK_CONSTRAINTS; -- no JFR
.H2DB              | PUBLIC            | CONSTRAINT_3 | "TYPE" IN('HEAP_DUMP', 'GC_LOG', 'THREAD_DUMP')

select * from INFORMATION_SCHEMA.CHECK_CONSTRAINTS; -- expected
.H2DB              | PUBLIC            | CONSTRAINT_3 | "TYPE" IN('HEAP_DUMP', 'GC_LOG', 'THREAD_DUMP', 'JFR')

The first method is to delete the old H2 file, which will be regenerated on reboot. The disadvantage is that when developers encounter this problem, they cannot directly see the cause from the logs, and it is difficult for developers to think of this method. I can add the capture of org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException where the new file is added, and print information to prompt the developer to try to clean up the old H2 file.

The second method is to add an application-dev.yml file, set spring.jpa.hibernate.ddl-auto to create, and add a runStandaloneWorkerDev task. This task will delete and recreate the tables and update constraints every time it is restarted. The disadvantage is that as soon as you restart, all the previous files will disappear.

The third possible method is to retain the current spring.jpa.hibernate.ddl-auto=update. After hibernate's automatic table creation is completed, execute additional SQL files through configuration to update the constraints correctly. This method may be more complex and difficult, which is equivalent to implementing something that hibernate is currently imperfect.

Generally speaking, I recommend the first method, which is simple and effective. The second method adds extra trouble, and the third method is more difficult to implement.

May I know what you think about this issue?

@D-D-H
Copy link
Contributor

D-D-H commented Feb 19, 2024

There is a test failure:

TestProfileAnalysisApiExecutor > test() FAILED
    org.opentest4j.AssertionFailedError: expected: <jfr> but was: <jfr-file>
        at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
        at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
        at app//org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
        at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
        at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
        at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1142)
        at app//org.eclipse.jifa.profile.TestProfileAnalysisApiExecutor.test(TestProfileAnalysisApiExecutor.java:24)

@y1yang0
Copy link
Contributor

y1yang0 commented Feb 20, 2024

Looks good in general.

Some obvious bugs:

  1. it renders none by default, and then flamegraph appears only when we hover over empty canvas
    image

  2. Press [CMD] + [C] or [Ctrl] + [C] to copy method is not working the second time we try to do that

@yanglong1010
Copy link
Contributor Author

It seems like a bug.

image

Under investigation, seems to be related to the flame graph component

@yanglong1010
Copy link
Contributor Author

Looks good in general.

Some obvious bugs:

  1. it renders none by default, and then flamegraph appears only when we hover over empty canvas
    image
  2. Press [CMD] + [C] or [Ctrl] + [C] to copy method is not working the second time we try to do that

hi y1yang0, Thanks.

  • bug 1: Denghui also pointed out this bug. Feature: JFR Visualizer #252 (comment), seems related to flame-graph component, I'm investigating.
  • bug 2: I tested it and it works fine. Friendly reminder, the mouse should keep hovering over the method to be copied.

@yanglong1010
Copy link
Contributor Author

Please add site documents for this feature.

added

@D-D-H
Copy link
Contributor

D-D-H commented Feb 21, 2024

image

@yanglong1010
Copy link
Contributor Author

image

pushed

@yanglong1010
Copy link
Contributor Author

It seems like a bug.

image

pushed


@Setter
@Getter
public class BasicMetadata {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to Metadata.

@D-D-H
Copy link
Contributor

D-D-H commented Feb 22, 2024

It would be nice if you could fix the warnings, like:

image

site/docs/index.md Outdated Show resolved Hide resolved
site/docs/guide/jfr-analysis.md Show resolved Hide resolved
site/docs/.vitepress/config.mts Outdated Show resolved Hide resolved
site/docs/zh/guide/jfr-analysis.md Outdated Show resolved Hide resolved
@D-D-H
Copy link
Contributor

D-D-H commented Feb 22, 2024

Hi @yanglong1010 ,

I've done a complete review. I'll approve the pr after you fix the left comments.

JFR is a very cool tool, and it's exciting that Jifa can support analyzing JFR files.

Currently, this feature only supports the performance view. We can enhance it in the future.

Thanks for the contribution.

…readPark dimensions clearer; some text changes; fix Java code warnings
@yanglong1010
Copy link
Contributor Author

@D-D-H pushed, please review again at a time convenient for you.

D-D-H
D-D-H previously approved these changes Feb 22, 2024
Copy link
Contributor

@D-D-H D-D-H left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@D-D-H D-D-H merged commit 92a4445 into eclipse-jifa:main Feb 23, 2024
2 checks passed
@yanglong1010
Copy link
Contributor Author

Thank you all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants