From 93a3a9895128b23e5788bbf78ead5f4b807fe64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=A0=E7=89=9B=E4=B8=8D=E8=BE=A3?= <2058684+wcp1231@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:22:04 +0800 Subject: [PATCH 01/20] feat: add worker image pull secret name (#273) --- .../java/org/eclipse/jifa/server/Configuration.java | 5 +++++ .../jifa/server/service/impl/K8SWorkerScheduler.java | 8 ++++++++ site/docs/guide/configuration.md | 10 +++++++++- site/docs/zh/guide/configuration.md | 10 +++++++++- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/eclipse/jifa/server/Configuration.java b/server/src/main/java/org/eclipse/jifa/server/Configuration.java index 80f4d7c4..be337454 100644 --- a/server/src/main/java/org/eclipse/jifa/server/Configuration.java +++ b/server/src/main/java/org/eclipse/jifa/server/Configuration.java @@ -98,6 +98,11 @@ public class Configuration { */ private String serviceAccountName; + /** + * The name of image pull secret + */ + private String imagePullSecretName; + /** * The container image of elastic workers. */ diff --git a/server/src/main/java/org/eclipse/jifa/server/service/impl/K8SWorkerScheduler.java b/server/src/main/java/org/eclipse/jifa/server/service/impl/K8SWorkerScheduler.java index 0eba9611..191c96ce 100644 --- a/server/src/main/java/org/eclipse/jifa/server/service/impl/K8SWorkerScheduler.java +++ b/server/src/main/java/org/eclipse/jifa/server/service/impl/K8SWorkerScheduler.java @@ -23,6 +23,7 @@ import io.kubernetes.client.openapi.models.V1ContainerStatus; import io.kubernetes.client.openapi.models.V1EnvVar; import io.kubernetes.client.openapi.models.V1HTTPGetAction; +import io.kubernetes.client.openapi.models.V1LocalObjectReference; import io.kubernetes.client.openapi.models.V1ObjectMeta; import io.kubernetes.client.openapi.models.V1PersistentVolumeClaimVolumeSource; import io.kubernetes.client.openapi.models.V1Pod; @@ -125,6 +126,13 @@ public void scheduleAsync(long identity, long requestedMemSize, BiConsumer Date: Thu, 4 Apr 2024 15:09:12 +0800 Subject: [PATCH 02/20] build(deps-dev): bump vite from 4.5.2 to 4.5.3 in /frontend (#275) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.2 to 4.5.3. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v4.5.3/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v4.5.3/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/package-lock.json | 8 ++++---- frontend/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ec5a1e5b..ff45ee0f 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -51,7 +51,7 @@ "typescript": "~5.1.6", "unplugin-auto-import": "^0.16.6", "unplugin-vue-components": "^0.25.1", - "vite": "^4.5.2", + "vite": "^4.5.3", "vitest": "^0.33.0", "vue-tsc": "^1.8.6" } @@ -7051,9 +7051,9 @@ } }, "node_modules/vite": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", - "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", + "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", "dev": true, "dependencies": { "esbuild": "^0.18.10", diff --git a/frontend/package.json b/frontend/package.json index cbbba6b6..96f7b428 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -57,7 +57,7 @@ "typescript": "~5.1.6", "unplugin-auto-import": "^0.16.6", "unplugin-vue-components": "^0.25.1", - "vite": "^4.5.2", + "vite": "^4.5.3", "vitest": "^0.33.0", "vue-tsc": "^1.8.6" } From f9f5113884f234f2ece7fe8e27aec1dafaa91cbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:09:45 +0800 Subject: [PATCH 03/20] build(deps-dev): bump vite from 4.5.2 to 4.5.3 in /site (#276) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.2 to 4.5.3. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v4.5.3/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v4.5.3/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- site/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/package-lock.json b/site/package-lock.json index a7990ddf..b5c88e98 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -1169,9 +1169,9 @@ "dev": true }, "node_modules/vite": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", - "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", + "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", "dev": true, "dependencies": { "esbuild": "^0.18.10", From b5f7c422a388f7f98cb8aac98b599dc752255d7b Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 23 Apr 2024 10:09:01 +0800 Subject: [PATCH 04/20] feat: add helm charts (#272) --- manifests/README.md | 85 +++++++++++ manifests/charts/jifa/.helmignore | 23 +++ manifests/charts/jifa/Chart.yaml | 19 +++ manifests/charts/jifa/templates/NOTES.txt | 22 +++ manifests/charts/jifa/templates/_helpers.tpl | 107 +++++++++++++ manifests/charts/jifa/templates/hpa.yaml | 41 +++++ manifests/charts/jifa/templates/ingress.yaml | 74 +++++++++ .../charts/jifa/templates/jifa-configmap.yaml | 23 +++ .../templates/jifa-master-deployment.yaml | 90 +++++++++++ manifests/charts/jifa/templates/jifa-pvc.yaml | 29 ++++ .../charts/jifa/templates/jifa-service.yaml | 28 ++++ .../jifa/templates/mysql-deployment.yaml | 38 +++++ .../charts/jifa/templates/mysql-pvc.yaml | 18 +++ .../charts/jifa/templates/mysql-service.yaml | 13 ++ manifests/charts/jifa/templates/role.yaml | 13 ++ .../charts/jifa/templates/rolebinding.yaml | 17 +++ .../charts/jifa/templates/serviceaccount.yaml | 13 ++ manifests/charts/jifa/values.yaml | 141 ++++++++++++++++++ 18 files changed, 794 insertions(+) create mode 100644 manifests/README.md create mode 100644 manifests/charts/jifa/.helmignore create mode 100644 manifests/charts/jifa/Chart.yaml create mode 100644 manifests/charts/jifa/templates/NOTES.txt create mode 100644 manifests/charts/jifa/templates/_helpers.tpl create mode 100644 manifests/charts/jifa/templates/hpa.yaml create mode 100644 manifests/charts/jifa/templates/ingress.yaml create mode 100644 manifests/charts/jifa/templates/jifa-configmap.yaml create mode 100644 manifests/charts/jifa/templates/jifa-master-deployment.yaml create mode 100644 manifests/charts/jifa/templates/jifa-pvc.yaml create mode 100644 manifests/charts/jifa/templates/jifa-service.yaml create mode 100644 manifests/charts/jifa/templates/mysql-deployment.yaml create mode 100644 manifests/charts/jifa/templates/mysql-pvc.yaml create mode 100644 manifests/charts/jifa/templates/mysql-service.yaml create mode 100644 manifests/charts/jifa/templates/role.yaml create mode 100644 manifests/charts/jifa/templates/rolebinding.yaml create mode 100644 manifests/charts/jifa/templates/serviceaccount.yaml create mode 100644 manifests/charts/jifa/values.yaml diff --git a/manifests/README.md b/manifests/README.md new file mode 100644 index 00000000..4ec5e1b1 --- /dev/null +++ b/manifests/README.md @@ -0,0 +1,85 @@ + + +## Deploy jifa by helm + +We can use [helm](https://helm.sh/) to quickly deploy jifa. + +## Install jifa + +```shell +helm install jifa jifa -n jifa --create-namespace +``` + +Check workloads: + +```shell +# kubectl get po -n jifa +NAME READY STATUS RESTARTS AGE +jifa-54d6b4d888-ngr6j 1/1 Running 2 (8m32s ago) 8m45s +jifa-mysql-cfd5dbdb4-2m8bn 1/1 Running 0 8m45s +``` + +Check service available:Upload an analysis file, check whether the worker starts normally, +whether the log is normal, and whether the analysis results are obtained on the jifa interface. + +```shell +kubectl get po -n jifa -w +NAME READY STATUS RESTARTS AGE +jifa-54d6b4d888-ngr6j 1/1 Running 2 (12m ago) 13m +jifa-elastic-worker-1 1/1 Running 0 16s +jifa-mysql-cfd5dbdb4-2m8bn 1/1 Running 0 13m +``` + +``jifa-elastic-worker-1`` logs: +```shell +kubectl logs -f -n jifa jifa-elastic-worker-1 + ,--. ,--. ,------. ,---. + | | | | | .---' / O \ +,--. | | | | | `--, | .-. | +| '-' / | | | |` | | | | + `-----' `--' `--' `--' `--' +Eclipse Jifa +Powered by Spring Boot 3.1.4 + +2024-03-19T04:19:15.573Z INFO 1 --- [ main] org.eclipse.jifa.server.Launcher : Starting Launcher using Java 17.0.8.1 with PID 1 (/jifa started by root in /) +2024-03-19T04:19:15.579Z INFO 1 --- [ main] org.eclipse.jifa.server.Launcher : No active profile set, falling back to 1 default profile: "default" +2024-03-19T04:19:16.693Z INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2024-03-19T04:19:16.917Z INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 215 ms. Found 8 JPA repository interfaces. +2024-03-19T04:19:17.876Z INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8102 (http) +2024-03-19T04:19:17.886Z INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2024-03-19T04:19:17.886Z INFO 1 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.13] +2024-03-19T04:19:18.019Z INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext +2024-03-19T04:19:18.020Z INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2330 ms +2024-03-19T04:19:18.178Z INFO 1 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] +2024-03-19T04:19:18.236Z INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.2.9.Final +2024-03-19T04:19:18.238Z INFO 1 --- [ main] org.hibernate.cfg.Environment : HHH000406: Using bytecode reflection optimizer +2024-03-19T04:19:18.368Z INFO 1 --- [ main] o.h.b.i.BytecodeProviderInitiator : HHH000021: Bytecode provider name : bytebuddy +2024-03-19T04:19:18.511Z INFO 1 --- [ main] o.s.o.j.p.SpringPersistenceUnitInfo : No LoadTimeWeaver setup: ignoring JPA class transformer +2024-03-19T04:19:18.531Z INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2024-03-19T04:19:18.695Z INFO 1 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@2558f65c +2024-03-19T04:19:18.698Z INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2024-03-19T04:19:18.752Z WARN 1 --- [ main] org.hibernate.dialect.Dialect : HHH000511: The 5.6.51 version for [org.hibernate.dialect.MySQLDialect] is no longer supported, hence certain features may not work properly. The minimum supported version is 5.7.0. Check the community dialects project for available legacy versions. +2024-03-19T04:19:19.044Z INFO 1 --- [ main] o.h.b.i.BytecodeProviderInitiator : HHH000021: Bytecode provider name : bytebuddy +2024-03-19T04:19:19.799Z INFO 1 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2024-03-19T04:19:19.926Z INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' +2024-03-19T04:19:23.844Z WARN 1 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2024-03-19T04:19:24.408Z INFO 1 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@18e0c618, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@32002a21, org.springframework.security.web.context.SecurityContextHolderFilter@c1aa8f9, org.springframework.security.web.header.HeaderWriterFilter@3106efb9, org.springframework.web.filter.CorsFilter@b13c600, org.springframework.security.web.authentication.logout.LogoutFilter@30090808, org.springframework.security.oauth2.server.resource.web.authentication.BearerTokenAuthenticationFilter@476fc8a1, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@498e9130, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@7b779c7b, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@7ae5231c, org.springframework.security.web.session.SessionManagementFilter@54ba7366, org.springframework.security.web.access.ExceptionTranslationFilter@4acbe932, org.springframework.security.web.access.intercept.AuthorizationFilter@34a7decd] +2024-03-19T04:19:24.737Z INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8102 (http) with context path '' +2024-03-19T04:19:24.752Z INFO 1 --- [ main] org.eclipse.jifa.server.Launcher : Started Launcher in 9.805 seconds (process running for 10.276) +2024-03-19T04:19:26.470Z INFO 1 --- [nio-8102-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2024-03-19T04:19:26.470Z INFO 1 --- [nio-8102-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2024-03-19T04:19:26.471Z INFO 1 --- [nio-8102-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms +``` + + Successful installation! \ No newline at end of file diff --git a/manifests/charts/jifa/.helmignore b/manifests/charts/jifa/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/manifests/charts/jifa/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/manifests/charts/jifa/Chart.yaml b/manifests/charts/jifa/Chart.yaml new file mode 100644 index 00000000..8504d80d --- /dev/null +++ b/manifests/charts/jifa/Chart.yaml @@ -0,0 +1,19 @@ +# +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +# + +apiVersion: v2 +name: jifa +description: Eclipse Jifa (abbreviated as Jifa) stands for "Java Issues Finding Assistant". This project originated from an internal system which was designed to improve the efficiency of diagnosing Java heap related issues that occurred in the production environment. It was open sourced and contributed to the Eclipse Foundation in 2020. +type: application +version: 0.3.0 +appVersion: 0.3.0-SNAPSHOT \ No newline at end of file diff --git a/manifests/charts/jifa/templates/NOTES.txt b/manifests/charts/jifa/templates/NOTES.txt new file mode 100644 index 00000000..5758b01a --- /dev/null +++ b/manifests/charts/jifa/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "jifa.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "jifa.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "jifa.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "jifa.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifests/charts/jifa/templates/_helpers.tpl b/manifests/charts/jifa/templates/_helpers.tpl new file mode 100644 index 00000000..243700b9 --- /dev/null +++ b/manifests/charts/jifa/templates/_helpers.tpl @@ -0,0 +1,107 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "jifa.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "jifa.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "jifa.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "jifa.labels" -}} +helm.sh/chart: {{ include "jifa.chart" . }} +{{ include "jifa.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "jifa.selectorLabels" -}} +app.kubernetes.io/name: {{ include "jifa.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "jifa.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "jifa.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Return the appropriate apiVersion for RBAC resources. +*/}} +{{- define "common.capabilities.rbac.apiVersion" -}} +{{- if semverCompare "<1.17-0" (include "common.capabilities.kubeVersion" .) -}} +{{- print "rbac.authorization.k8s.io/v1beta1" -}} +{{- else -}} +{{- print "rbac.authorization.k8s.io/v1" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the target Kubernetes version +*/}} +{{- define "common.capabilities.kubeVersion" -}} +{{- if .Values.global }} + {{- if .Values.global.kubeVersion }} + {{- .Values.global.kubeVersion -}} + {{- else }} + {{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}} + {{- end -}} +{{- else }} +{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}} +{{- end -}} +{{- end -}} + + +{{/* +Get Mysql Host +*/}} +{{- define "jifa.mysqlHost" -}} +{{- if .Values.mysql.create }} +{{- default (include "jifa.mysqlName" .) .Values.mysql.host }} +{{- else }} +{{- default "default" .Values.mysql.host }} +{{- end }} +{{- end }} + +{{/* +Get Mysql Default Name +*/}} +{{- define "jifa.mysqlName" -}} +jifa-mysql +{{- end }} \ No newline at end of file diff --git a/manifests/charts/jifa/templates/hpa.yaml b/manifests/charts/jifa/templates/hpa.yaml new file mode 100644 index 00000000..50224006 --- /dev/null +++ b/manifests/charts/jifa/templates/hpa.yaml @@ -0,0 +1,41 @@ +# +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +# + +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "jifa.fullname" . }} + labels: + {{- include "jifa.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "jifa.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifests/charts/jifa/templates/ingress.yaml b/manifests/charts/jifa/templates/ingress.yaml new file mode 100644 index 00000000..e4a22a76 --- /dev/null +++ b/manifests/charts/jifa/templates/ingress.yaml @@ -0,0 +1,74 @@ +# +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +# + +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "jifa.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "jifa.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifests/charts/jifa/templates/jifa-configmap.yaml b/manifests/charts/jifa/templates/jifa-configmap.yaml new file mode 100644 index 00000000..8a05dfa2 --- /dev/null +++ b/manifests/charts/jifa/templates/jifa-configmap.yaml @@ -0,0 +1,23 @@ +# +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +# + +apiVersion: v1 +kind: ConfigMap +metadata: + name: mysql-initdb-config + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "jifa.labels" . | nindent 4 }} +data: + initdb.sql: | + CREATE DATABASE IF NOT EXISTS jifa; \ No newline at end of file diff --git a/manifests/charts/jifa/templates/jifa-master-deployment.yaml b/manifests/charts/jifa/templates/jifa-master-deployment.yaml new file mode 100644 index 00000000..a17bb8e1 --- /dev/null +++ b/manifests/charts/jifa/templates/jifa-master-deployment.yaml @@ -0,0 +1,90 @@ +# +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +# + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "jifa.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "jifa.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "jifa.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "jifa.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "jifa.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + volumes: + - name: {{ include "jifa.fullname" . }} + persistentVolumeClaim: + claimName: {{ include "jifa.fullname" . }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default "latest" }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: jifa-port + containerPort: 8102 + env: + - name: MYSQL_HOST + value: {{ include "jifa.mysqlHost" . }} + - name: MYSQL_DATABASE + value: {{ .Values.mysql.database }} + - name: MYSQL_USER + value: {{ .Values.mysql.user }} + - name: MYSQL_PASSWORD + value: {{ .Values.mysql.password }} + args: + - --jifa.role=master + - --jifa.storage-pvc-name={{- include "jifa.fullname" . }} + - --jifa.storage-path=/jifa-storage + - --jifa.service-account-name={{- include "jifa.serviceAccountName" . }} + - --jifa.elastic-worker-image={{- .Values.image.worker.repository }}:{{ .Values.image.worker.tag | default "latest" }} + - --jifa.port=8102 + # - --jifa.cluster-namespace={{- .Release.Namespace | quote }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: {{ include "jifa.fullname" . }} + mountPath: "/jifa-storage" + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifests/charts/jifa/templates/jifa-pvc.yaml b/manifests/charts/jifa/templates/jifa-pvc.yaml new file mode 100644 index 00000000..574e4f53 --- /dev/null +++ b/manifests/charts/jifa/templates/jifa-pvc.yaml @@ -0,0 +1,29 @@ +# +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +# + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "jifa.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "jifa.labels" . | nindent 4 }} +spec: + storageClassName: {{ .Values.storageClass }} + accessModes: + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} \ No newline at end of file diff --git a/manifests/charts/jifa/templates/jifa-service.yaml b/manifests/charts/jifa/templates/jifa-service.yaml new file mode 100644 index 00000000..6112bea1 --- /dev/null +++ b/manifests/charts/jifa/templates/jifa-service.yaml @@ -0,0 +1,28 @@ +# +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +# + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "jifa.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "jifa.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: jifa-port + protocol: TCP + selector: + {{- include "jifa.selectorLabels" . | nindent 4 }} diff --git a/manifests/charts/jifa/templates/mysql-deployment.yaml b/manifests/charts/jifa/templates/mysql-deployment.yaml new file mode 100644 index 00000000..57170deb --- /dev/null +++ b/manifests/charts/jifa/templates/mysql-deployment.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "jifa.mysqlName" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + app: mysql +spec: + replicas: 1 + selector: + matchLabels: + app: mysql + template: + metadata: + labels: + app: mysql + spec: + containers: + - image: mysql:5.6 + name: mysql + env: + - name: MYSQL_ROOT_PASSWORD + value: {{ .Values.mysql.password }} + ports: + - containerPort: 3306 + name: mysql + volumeMounts: + - name: {{ include "jifa.mysqlName" . }} + mountPath: /var/lib/mysql + - name: mysql-initdb + mountPath: /docker-entrypoint-initdb.d + volumes: + - name: {{ include "jifa.mysqlName" . }} + persistentVolumeClaim: + claimName: {{ include "jifa.mysqlName" . }} + - name: mysql-initdb + configMap: + name: mysql-initdb-config diff --git a/manifests/charts/jifa/templates/mysql-pvc.yaml b/manifests/charts/jifa/templates/mysql-pvc.yaml new file mode 100644 index 00000000..15720259 --- /dev/null +++ b/manifests/charts/jifa/templates/mysql-pvc.yaml @@ -0,0 +1,18 @@ +{{- if .Values.mysql.create -}} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "jifa.mysqlName" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "jifa.labels" . | nindent 4 }} +spec: + storageClassName: {{ .Values.storageClass }} + accessModes: + {{- range .Values.mysql.persistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.mysql.persistence.size | quote }} +{{- end }} \ No newline at end of file diff --git a/manifests/charts/jifa/templates/mysql-service.yaml b/manifests/charts/jifa/templates/mysql-service.yaml new file mode 100644 index 00000000..c2fed106 --- /dev/null +++ b/manifests/charts/jifa/templates/mysql-service.yaml @@ -0,0 +1,13 @@ +{{- if .Values.mysql.create -}} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "jifa.mysqlName" . }} + namespace: {{ .Release.Namespace | quote }} +spec: + type: {{ .Values.mysql.service.type }} + ports: + - port: {{ .Values.mysql.service.port }} + selector: + app: mysql +{{- end }} diff --git a/manifests/charts/jifa/templates/role.yaml b/manifests/charts/jifa/templates/role.yaml new file mode 100644 index 00000000..eccb6cd9 --- /dev/null +++ b/manifests/charts/jifa/templates/role.yaml @@ -0,0 +1,13 @@ +{{- if .Values.rbac.create -}} +apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} +kind: Role +metadata: + name: {{ include "jifa.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "jifa.labels" . | nindent 4 }} +rules: + - apiGroups: [ "" ] + resources: [ "pods", "pods/exec" ] + verbs: [ "get", "list", "delete", "patch", "create" ] +{{- end -}} \ No newline at end of file diff --git a/manifests/charts/jifa/templates/rolebinding.yaml b/manifests/charts/jifa/templates/rolebinding.yaml new file mode 100644 index 00000000..5c317060 --- /dev/null +++ b/manifests/charts/jifa/templates/rolebinding.yaml @@ -0,0 +1,17 @@ +{{- if .Values.rbac.create }} +apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} +kind: RoleBinding +metadata: + name: {{ include "jifa.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "jifa.labels" . | nindent 4 }} +roleRef: + kind: Role + name: {{ include "jifa.fullname" . }} + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: {{ template "jifa.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/manifests/charts/jifa/templates/serviceaccount.yaml b/manifests/charts/jifa/templates/serviceaccount.yaml new file mode 100644 index 00000000..cde33b6f --- /dev/null +++ b/manifests/charts/jifa/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "jifa.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "jifa.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifests/charts/jifa/values.yaml b/manifests/charts/jifa/values.yaml new file mode 100644 index 00000000..ace1207a --- /dev/null +++ b/manifests/charts/jifa/values.yaml @@ -0,0 +1,141 @@ +# +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +# + +replicaCount: 1 + +## @param image.repository jifa master workload image +image: + repository: eclipsejifa/jifa + pullPolicy: IfNotPresent + # Overrides the image tag whose default is latest. + tag: "" + + ## @param worker.repository jifa worker workload image + worker: + repository: eclipsejifa/jifa + pullPolicy: IfNotPresent + # Overrides the image tag whose default is latest. + tag: "" + + +persistence: + ## @param persistence.storageClass PVC Storage Class for jifa data volume + storageClass: "" + ## @param persistence.accessModes PVC Access Mode for jifa data volume + accessModes: + - ReadWriteMany + ## @param persistence.size PVC Storage Request for jifa data volume + size: 3Gi + +## Role Based Access Control +## ref: https://kubernetes.io/docs/admin/authorization/rbac/ +## +rbac: + ## @param rbac.create Whether to create & use RBAC resources or not + ## binding jifa ServiceAccount to a role + ## that allows jifa pods querying the K8s API + ## + create: true + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + + +mysql: + ## @param mysql.create Whether to build Mysql by itself. If set to true, a Mysql instance will be created. + create: true + ## @param mysql.host Mysql Host for jifa database + host: "jifa-mysql:3306" + database: "jifa" + user: "root" + password: "password" + + service: + type: ClusterIP + port: 3306 + + persistence: + ## @param persistence.accessModes PVC Access Mode for mysql data volume + accessModes: + - ReadWriteOnce + ## @param persistence.size PVC Storage Request for mysql data volume + size: 1Gi + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + From 5f1cf1cc732621cc21b425fec6c46a358d5a9e31 Mon Sep 17 00:00:00 2001 From: Jason Koch Date: Wed, 8 May 2024 19:19:48 -0700 Subject: [PATCH 05/20] refactor: stomp ApiStompController to stash a more general auth value (#277) --- .../jifa/server/controller/AnalysisApiStompController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/eclipse/jifa/server/controller/AnalysisApiStompController.java b/server/src/main/java/org/eclipse/jifa/server/controller/AnalysisApiStompController.java index ba2c569c..de7aaa42 100644 --- a/server/src/main/java/org/eclipse/jifa/server/controller/AnalysisApiStompController.java +++ b/server/src/main/java/org/eclipse/jifa/server/controller/AnalysisApiStompController.java @@ -18,7 +18,6 @@ import org.eclipse.jifa.server.domain.dto.AnalysisApiRequest; import org.eclipse.jifa.server.domain.dto.AnalysisApiStompResponseMessage; import org.eclipse.jifa.server.domain.exception.ElasticWorkerNotReadyException; -import org.eclipse.jifa.server.domain.security.JifaAuthenticationToken; import org.eclipse.jifa.server.enums.Role; import org.eclipse.jifa.server.service.AnalysisApiService; import org.eclipse.jifa.server.util.ControllerUtil; @@ -31,6 +30,7 @@ import org.springframework.messaging.simp.stomp.StompHeaders; import org.springframework.messaging.support.MessageHeaderAccessor; import org.springframework.security.authentication.AnonymousAuthenticationToken; +import org.springframework.security.core.Authentication; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; @@ -63,8 +63,8 @@ public AnalysisApiStompController(AnalysisApiService apiService) { Message message) { StompHeaderAccessor accessor = MessageHeaderAccessor.getAccessor(message, StompHeaderAccessor.class); assert accessor != null; - JifaAuthenticationToken token = (JifaAuthenticationToken) accessor.getUser(); - SecurityContextHolder.getContext().setAuthentication(token != null ? token : ANONYMOUS); + Authentication auth = (Authentication) accessor.getUser(); + SecurityContextHolder.getContext().setAuthentication(auth != null ? auth : ANONYMOUS); try { MimeType mimeType = ControllerUtil.checkMimeTypeForStompMessage(contentType); From 553d2cec57339671eabd5ee03e56546b6b3589e3 Mon Sep 17 00:00:00 2001 From: Jason Koch Date: Thu, 9 May 2024 18:41:51 -0700 Subject: [PATCH 06/20] feat: add support to disable spring security web filters (#279) --- .../eclipse/jifa/server/Configuration.java | 7 +++ .../configurer/SecurityCryptoConfigurer.java | 59 +++++++++++++++++++ ...rer.java => SecurityFilterConfigurer.java} | 38 +----------- site/docs/guide/configuration.md | 8 +++ 4 files changed, 77 insertions(+), 35 deletions(-) create mode 100644 server/src/main/java/org/eclipse/jifa/server/configurer/SecurityCryptoConfigurer.java rename server/src/main/java/org/eclipse/jifa/server/configurer/{SecurityConfigurer.java => SecurityFilterConfigurer.java} (85%) diff --git a/server/src/main/java/org/eclipse/jifa/server/Configuration.java b/server/src/main/java/org/eclipse/jifa/server/Configuration.java index be337454..2e4621bf 100644 --- a/server/src/main/java/org/eclipse/jifa/server/Configuration.java +++ b/server/src/main/java/org/eclipse/jifa/server/Configuration.java @@ -166,6 +166,13 @@ public class Configuration { */ private Set disabledFileTransferMethods = Collections.emptySet(); + /** + * Install the web security filters. Default is true. + * + * Use this to allow integration with custom security filters. + */ + private boolean securityFiltersEnabled = true; + @PostConstruct private void init() { if (role == Role.MASTER) { diff --git a/server/src/main/java/org/eclipse/jifa/server/configurer/SecurityCryptoConfigurer.java b/server/src/main/java/org/eclipse/jifa/server/configurer/SecurityCryptoConfigurer.java new file mode 100644 index 00000000..e4b3f8a4 --- /dev/null +++ b/server/src/main/java/org/eclipse/jifa/server/configurer/SecurityCryptoConfigurer.java @@ -0,0 +1,59 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + ********************************************************************************/ +package org.eclipse.jifa.server.configurer; + +import com.nimbusds.jose.jwk.JWKSet; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.ImmutableJWKSet; +import org.eclipse.jifa.server.ConfigurationAccessor; +import org.eclipse.jifa.server.service.CipherService; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.oauth2.jwt.JwtDecoder; +import org.springframework.security.oauth2.jwt.JwtEncoder; +import org.springframework.security.oauth2.jwt.JwtTimestampValidator; +import org.springframework.security.oauth2.jwt.NimbusJwtDecoder; +import org.springframework.security.oauth2.jwt.NimbusJwtEncoder; +import java.time.Duration; + +import static org.eclipse.jifa.server.enums.Role.MASTER; +import static org.eclipse.jifa.server.enums.Role.STANDALONE_WORKER; + +@Configuration +public class SecurityCryptoConfigurer extends ConfigurationAccessor { + + @Bean + public JwtEncoder jwtEncoder(CipherService cipherService) { + RSAKey jwk = new RSAKey.Builder(cipherService.getPublicKey()).privateKey(cipherService.getPrivateKey()).build(); + return new NimbusJwtEncoder(new ImmutableJWKSet<>(new JWKSet(jwk))); + } + + @Bean + @Primary + public JwtDecoder jwtDecoder(CipherService cipherService) { + NimbusJwtDecoder decoder = NimbusJwtDecoder.withPublicKey(cipherService.getPublicKey()).build(); + + if (getRole() == MASTER || getRole() == STANDALONE_WORKER) { + decoder.setJwtValidator(new JwtTimestampValidator(Duration.ZERO)); + } + return decoder; + } + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } +} diff --git a/server/src/main/java/org/eclipse/jifa/server/configurer/SecurityConfigurer.java b/server/src/main/java/org/eclipse/jifa/server/configurer/SecurityFilterConfigurer.java similarity index 85% rename from server/src/main/java/org/eclipse/jifa/server/configurer/SecurityConfigurer.java rename to server/src/main/java/org/eclipse/jifa/server/configurer/SecurityFilterConfigurer.java index bdb63d19..f824121a 100644 --- a/server/src/main/java/org/eclipse/jifa/server/configurer/SecurityConfigurer.java +++ b/server/src/main/java/org/eclipse/jifa/server/configurer/SecurityFilterConfigurer.java @@ -12,9 +12,6 @@ ********************************************************************************/ package org.eclipse.jifa.server.configurer; -import com.nimbusds.jose.jwk.JWKSet; -import com.nimbusds.jose.jwk.RSAKey; -import com.nimbusds.jose.jwk.source.ImmutableJWKSet; import jakarta.annotation.Nullable; import jakarta.servlet.Filter; import jakarta.servlet.http.Cookie; @@ -22,9 +19,9 @@ import org.eclipse.jifa.server.Constant; import org.eclipse.jifa.server.condition.ConditionalOnRole; import org.eclipse.jifa.server.filter.JwtTokenRefreshFilter; -import org.eclipse.jifa.server.service.CipherService; import org.eclipse.jifa.server.service.JwtService; import org.eclipse.jifa.server.service.UserService; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; @@ -39,14 +36,7 @@ import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; -import org.springframework.security.oauth2.jwt.JwtDecoder; -import org.springframework.security.oauth2.jwt.JwtEncoder; -import org.springframework.security.oauth2.jwt.JwtTimestampValidator; -import org.springframework.security.oauth2.jwt.NimbusJwtDecoder; -import org.springframework.security.oauth2.jwt.NimbusJwtEncoder; import org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationEntryPoint; import org.springframework.security.oauth2.server.resource.web.DefaultBearerTokenResolver; import org.springframework.security.oauth2.server.resource.web.access.BearerTokenAccessDeniedHandler; @@ -56,8 +46,6 @@ import org.springframework.web.cors.CorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -import java.time.Duration; - import static org.eclipse.jifa.server.Constant.COOKIE_JIFA_TOKEN_KEY; import static org.eclipse.jifa.server.Constant.HTTP_API_PREFIX; import static org.eclipse.jifa.server.Constant.HTTP_HANDSHAKE_MAPPING; @@ -70,23 +58,8 @@ @Configuration @EnableWebSecurity @EnableMethodSecurity -public class SecurityConfigurer extends ConfigurationAccessor { - - @Bean - public JwtEncoder jwtEncoder(CipherService cipherService) { - RSAKey jwk = new RSAKey.Builder(cipherService.getPublicKey()).privateKey(cipherService.getPrivateKey()).build(); - return new NimbusJwtEncoder(new ImmutableJWKSet<>(new JWKSet(jwk))); - } - - @Bean - public JwtDecoder jwtDecoder(CipherService cipherService) { - NimbusJwtDecoder decoder = NimbusJwtDecoder.withPublicKey(cipherService.getPublicKey()).build(); - - if (getRole() == MASTER || getRole() == STANDALONE_WORKER) { - decoder.setJwtValidator(new JwtTimestampValidator(Duration.ZERO)); - } - return decoder; - } +@ConditionalOnProperty(value = "jifa.security-filters-enabled", havingValue = "true", matchIfMissing = true) +public class SecurityFilterConfigurer extends ConfigurationAccessor { @Bean public SecurityFilterChain configure(HttpSecurity hs, UserService userService, JwtService jwtService, @@ -178,11 +151,6 @@ public FilterRegistrationBean refreshJwtTokenFilter(JwtService jwtServic return frb; } - @Bean - public PasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); - } - @Bean CorsConfigurationSource corsConfigurationSource() { final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); diff --git a/site/docs/guide/configuration.md b/site/docs/guide/configuration.md index bb7aca99..b9d00c08 100644 --- a/site/docs/guide/configuration.md +++ b/site/docs/guide/configuration.md @@ -171,6 +171,14 @@ Type: String Default: password +## security-filters-enabled + +Whether to enable the default security filters for web authentication. If set to 'false', the web security filters will not be enabled. + +Use this option if you intend to customize JIFA with an alternative authentication and authorization layer. + +Default: true + ## input-files Local files to be analyzed, used only in `STANDALONE_WORKER` role. From d4d6bd4a74a4d515b3508c7aa0e27f13af96b567 Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Fri, 10 May 2024 09:49:14 +0800 Subject: [PATCH 07/20] docs: Chinese version doc for security-filters-enabled --- site/docs/zh/guide/configuration.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/site/docs/zh/guide/configuration.md b/site/docs/zh/guide/configuration.md index e7ba42e9..001f65e0 100644 --- a/site/docs/zh/guide/configuration.md +++ b/site/docs/zh/guide/configuration.md @@ -169,6 +169,14 @@ Default: false 默认值:password +## security-filters-enabled + +是否启用默认的安全过滤器用于认证与授权。 + +如果需要自定义应用的安全认证方式,请将此参数设置为 false。 + +默认值: true + ## input-files 本地的待分析文件,仅在 `STANDALONE_WORKER` 角色中使用。 From 27ada14811fc0c10512da2afff7230c01e4574ab Mon Sep 17 00:00:00 2001 From: Jason Koch Date: Fri, 10 May 2024 16:53:51 -0700 Subject: [PATCH 08/20] chore: add .vscode to gitignore (#280) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index bb3f8151..b8cbc938 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ gradle-app.setting .idea +.vscode/ **/node_modules/ **/tmp/ From 63072cd3b0ee82489e156572cb8293c57edf12a1 Mon Sep 17 00:00:00 2001 From: Jason Koch Date: Fri, 10 May 2024 23:07:37 -0700 Subject: [PATCH 09/20] feat: allow sort by Name in heapdump Threads view (#281) --- frontend/src/components/heapdump/Threads.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/heapdump/Threads.vue b/frontend/src/components/heapdump/Threads.vue index eda49884..4c151f8d 100644 --- a/frontend/src/components/heapdump/Threads.vue +++ b/frontend/src/components/heapdump/Threads.vue @@ -67,7 +67,8 @@ const columns = [ label: 'Name', width: 130, align: 'right', - property: 'name' + property: 'name', + sortable: true, }, { label: 'Shallow Size', From 303a21f20705f43db516e5f0504f080d29686ecf Mon Sep 17 00:00:00 2001 From: Jeffery <54900261+superajun-wsj@users.noreply.github.com> Date: Mon, 20 May 2024 17:25:26 +0800 Subject: [PATCH 10/20] fix: update start time stamp in autoDecideStartEndTime (#283) Signed-off-by: wangshaojun.jeffery --- .../main/java/org/eclipse/jifa/gclog/model/GCModel.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java index 0703b2ed..6a610a40 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java @@ -466,6 +466,13 @@ public void autoDecideStartEndTime() { endTime = Math.max(endTime, event.getPhases().get(event.getPhases().size() - 1).getEndTime()); } setEndTime(Math.max(this.endTime, endTime)); + // update start time. + event = gcEvents.get(0); + double startTime = event.getStartTime(); + if (event.hasPhases()) { + startTime = Math.min(startTime, event.getPhases().get(0).getStartTime()); + } + setStartTime(Math.min(this.startTime, startTime)); } @ApiMeta("timeGraphData") From f430b0d5d6d3bd5344dd2204bb04a435de5f2bde Mon Sep 17 00:00:00 2001 From: Yifeng Jin Date: Sun, 16 Jun 2024 19:33:59 +0800 Subject: [PATCH 11/20] fix: typo of eventInfo (#286) --- .../diagnoser/EventAbnormalDetector.java | 22 ++++----- .../jifa/gclog/diagnoser/GlobalDiagnoser.java | 2 +- .../org/eclipse/jifa/gclog/event/GCEvent.java | 22 ++++----- .../{evnetInfo => eventInfo}/CpuTime.java | 2 +- .../{evnetInfo => eventInfo}/GCCause.java | 2 +- .../GCEventBooleanType.java | 2 +- .../GCEventLevel.java | 2 +- .../GCMemoryItem.java | 2 +- .../{evnetInfo => eventInfo}/GCPause.java | 2 +- .../{evnetInfo => eventInfo}/MemoryArea.java | 2 +- .../{evnetInfo => eventInfo}/ReferenceGC.java | 2 +- .../jifa/gclog/fragment/GCModelConverter.java | 2 +- .../eclipse/jifa/gclog/model/CMSGCModel.java | 6 +-- .../eclipse/jifa/gclog/model/G1GCModel.java | 24 +++++----- .../eclipse/jifa/gclog/model/GCEventType.java | 14 +++--- .../org/eclipse/jifa/gclog/model/GCModel.java | 26 +++++------ .../jifa/gclog/model/GenerationalGCModel.java | 6 +-- .../eclipse/jifa/gclog/model/ZGCModel.java | 2 +- .../parser/AbstractPreUnifiedGCLogParser.java | 8 ++-- .../gclog/parser/PreUnifiedG1GCLogParser.java | 6 +-- .../PreUnifiedGenerationalGCLogParser.java | 10 ++-- .../gclog/parser/UnifiedG1GCLogParser.java | 2 +- .../UnifiedG1OrGenerationalGCLogParser.java | 10 ++-- .../UnifiedGenerationalGCLogParser.java | 2 +- .../gclog/parser/UnifiedZGCLogParser.java | 6 +-- .../eclipse/jifa/gclog/util/GCLogUtil.java | 2 +- .../gclog/TestFragmentedParserToGCModel.java | 4 +- .../TestFragmentedParserToGCModelLegacy.java | 14 +++--- .../org/eclipse/jifa/gclog/TestGCModel.java | 18 ++++---- .../org/eclipse/jifa/gclog/TestParser.java | 46 +++++++++---------- 30 files changed, 135 insertions(+), 135 deletions(-) rename analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/{evnetInfo => eventInfo}/CpuTime.java (96%) rename analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/{evnetInfo => eventInfo}/GCCause.java (99%) rename analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/{evnetInfo => eventInfo}/GCEventBooleanType.java (96%) rename analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/{evnetInfo => eventInfo}/GCEventLevel.java (92%) rename analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/{evnetInfo => eventInfo}/GCMemoryItem.java (99%) rename analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/{evnetInfo => eventInfo}/GCPause.java (93%) rename analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/{evnetInfo => eventInfo}/MemoryArea.java (97%) rename analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/{evnetInfo => eventInfo}/ReferenceGC.java (97%) diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/diagnoser/EventAbnormalDetector.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/diagnoser/EventAbnormalDetector.java index 58a7ef29..9486e2a6 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/diagnoser/EventAbnormalDetector.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/diagnoser/EventAbnormalDetector.java @@ -14,10 +14,10 @@ package org.eclipse.jifa.gclog.diagnoser; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.CpuTime; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.CpuTime; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; @@ -39,13 +39,13 @@ import static org.eclipse.jifa.gclog.diagnoser.AbnormalType.BAD_USR; import static org.eclipse.jifa.gclog.diagnoser.AbnormalType.BAD_YOUNG_GEN_CAPACITY; import static org.eclipse.jifa.gclog.diagnoser.AbnormalType.TO_SPACE_EXHAUSTED; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType.GC_AFTER_REMARK; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType.GC_AT_END_OF_OLD_CYCLE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HEAP; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HUMONGOUS; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.METASPACE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.OLD; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.YOUNG; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType.GC_AFTER_REMARK; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType.GC_AT_END_OF_OLD_CYCLE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HEAP; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HUMONGOUS; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.METASPACE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.OLD; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.YOUNG; import static org.eclipse.jifa.gclog.util.Constant.UNKNOWN_DOUBLE; import static org.eclipse.jifa.gclog.util.Constant.UNKNOWN_INT; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/diagnoser/GlobalDiagnoser.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/diagnoser/GlobalDiagnoser.java index 47939197..6812d1b3 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/diagnoser/GlobalDiagnoser.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/diagnoser/GlobalDiagnoser.java @@ -20,7 +20,7 @@ import org.eclipse.jifa.common.domain.exception.CommonException; import org.eclipse.jifa.common.domain.exception.ShouldNotReachHereException; import org.eclipse.jifa.gclog.event.TimedEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCCause; +import org.eclipse.jifa.gclog.event.eventInfo.GCCause; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; import org.eclipse.jifa.gclog.model.ZGCModel; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/GCEvent.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/GCEvent.java index 792ac04a..17390d2d 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/GCEvent.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/GCEvent.java @@ -15,14 +15,14 @@ import org.eclipse.jifa.common.domain.exception.ShouldNotReachHereException; import org.eclipse.jifa.gclog.diagnoser.GlobalDiagnoseInfo; -import org.eclipse.jifa.gclog.event.evnetInfo.CpuTime; -import org.eclipse.jifa.gclog.event.evnetInfo.GCCause; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventLevel; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; -import org.eclipse.jifa.gclog.event.evnetInfo.GCPause; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; -import org.eclipse.jifa.gclog.event.evnetInfo.ReferenceGC; +import org.eclipse.jifa.gclog.event.eventInfo.CpuTime; +import org.eclipse.jifa.gclog.event.eventInfo.GCCause; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventLevel; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.GCPause; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.ReferenceGC; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; import org.eclipse.jifa.gclog.util.Constant; @@ -36,9 +36,9 @@ import java.util.Map; import java.util.function.Consumer; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventLevel.EVENT; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventLevel.PHASE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.values; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventLevel.EVENT; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventLevel.PHASE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.values; import static org.eclipse.jifa.gclog.util.Constant.KB2MB; public class GCEvent extends TimedEvent { diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/CpuTime.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/CpuTime.java similarity index 96% rename from analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/CpuTime.java rename to analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/CpuTime.java index 08441589..ab259eb1 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/CpuTime.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/CpuTime.java @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.gclog.event.evnetInfo; +package org.eclipse.jifa.gclog.event.eventInfo; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCCause.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCCause.java similarity index 99% rename from analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCCause.java rename to analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCCause.java index 8a92b4a9..2450f56a 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCCause.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCCause.java @@ -10,7 +10,7 @@ * * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.gclog.event.evnetInfo; +package org.eclipse.jifa.gclog.event.eventInfo; import java.util.HashMap; import java.util.List; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCEventBooleanType.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCEventBooleanType.java similarity index 96% rename from analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCEventBooleanType.java rename to analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCEventBooleanType.java index 670f4574..c45c2e39 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCEventBooleanType.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCEventBooleanType.java @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.gclog.event.evnetInfo; +package org.eclipse.jifa.gclog.event.eventInfo; /* * This class records some boolean types related to a GCEvent. They will be saved in a BitSet of GCEvent, diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCEventLevel.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCEventLevel.java similarity index 92% rename from analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCEventLevel.java rename to analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCEventLevel.java index 31ff4794..b9ac697a 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCEventLevel.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCEventLevel.java @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.gclog.event.evnetInfo; +package org.eclipse.jifa.gclog.event.eventInfo; public enum GCEventLevel { EVENT, diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCMemoryItem.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCMemoryItem.java similarity index 99% rename from analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCMemoryItem.java rename to analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCMemoryItem.java index 9fd3f614..3a0f1c5f 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCMemoryItem.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCMemoryItem.java @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.gclog.event.evnetInfo; +package org.eclipse.jifa.gclog.event.eventInfo; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCPause.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCPause.java similarity index 93% rename from analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCPause.java rename to analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCPause.java index 5b9fc14c..6658f309 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/GCPause.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/GCPause.java @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.gclog.event.evnetInfo; +package org.eclipse.jifa.gclog.event.eventInfo; public enum GCPause { PAUSE, diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/MemoryArea.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/MemoryArea.java similarity index 97% rename from analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/MemoryArea.java rename to analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/MemoryArea.java index 8cfa78e5..226fbaf0 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/MemoryArea.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/MemoryArea.java @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.gclog.event.evnetInfo; +package org.eclipse.jifa.gclog.event.eventInfo; public enum MemoryArea { EDEN("eden"), diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/ReferenceGC.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/ReferenceGC.java similarity index 97% rename from analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/ReferenceGC.java rename to analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/ReferenceGC.java index a1b47686..f57022f1 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/evnetInfo/ReferenceGC.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/event/eventInfo/ReferenceGC.java @@ -10,7 +10,7 @@ * * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.gclog.event.evnetInfo; +package org.eclipse.jifa.gclog.event.eventInfo; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/fragment/GCModelConverter.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/fragment/GCModelConverter.java index 823ade80..b733b97d 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/fragment/GCModelConverter.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/fragment/GCModelConverter.java @@ -16,7 +16,7 @@ import com.google.common.collect.ImmutableSet; import lombok.extern.slf4j.Slf4j; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.model.GCModel; import org.eclipse.jifa.gclog.util.Constant; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/CMSGCModel.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/CMSGCModel.java index 835abe5f..4c85c3e8 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/CMSGCModel.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/CMSGCModel.java @@ -15,15 +15,15 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; import org.eclipse.jifa.gclog.model.modeInfo.GCCollectorType; import org.eclipse.jifa.gclog.util.LongData; import org.eclipse.jifa.gclog.vo.TimeRange; import java.util.List; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.METASPACE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.OLD; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.METASPACE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.OLD; import static org.eclipse.jifa.gclog.model.GCEventType.CMS_CONCURRENT_ABORTABLE_PRECLEAN; import static org.eclipse.jifa.gclog.model.GCEventType.CMS_CONCURRENT_FAILURE; import static org.eclipse.jifa.gclog.model.GCEventType.CMS_CONCURRENT_INTERRUPTED; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/G1GCModel.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/G1GCModel.java index 150ad655..2c4be017 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/G1GCModel.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/G1GCModel.java @@ -14,9 +14,9 @@ package org.eclipse.jifa.gclog.model; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.model.modeInfo.GCCollectorType; import org.eclipse.jifa.gclog.model.modeInfo.GCLogStyle; import org.eclipse.jifa.gclog.util.LongData; @@ -25,15 +25,15 @@ import java.util.Arrays; import java.util.List; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType.GC_AFTER_REMARK; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType.GC_AT_END_OF_OLD_CYCLE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.ARCHIVE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.EDEN; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HEAP; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HUMONGOUS; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.METASPACE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.OLD; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.SURVIVOR; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType.GC_AFTER_REMARK; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType.GC_AT_END_OF_OLD_CYCLE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.ARCHIVE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.EDEN; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HEAP; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HUMONGOUS; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.METASPACE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.OLD; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.SURVIVOR; import static org.eclipse.jifa.gclog.model.GCEventType.FULL_GC; import static org.eclipse.jifa.gclog.model.GCEventType.G1_CONCURRENT_CYCLE; import static org.eclipse.jifa.gclog.model.GCEventType.G1_CONCURRENT_MARK; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCEventType.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCEventType.java index 1a1be852..0c31fb66 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCEventType.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCEventType.java @@ -13,19 +13,19 @@ package org.eclipse.jifa.gclog.model; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventLevel; -import org.eclipse.jifa.gclog.event.evnetInfo.GCPause; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventLevel; +import org.eclipse.jifa.gclog.event.eventInfo.GCPause; import org.eclipse.jifa.gclog.model.modeInfo.GCCollectorType; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventLevel.EVENT; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventLevel.PHASE; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCPause.CONCURRENT; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCPause.PARTIAL; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCPause.PAUSE; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventLevel.EVENT; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventLevel.PHASE; +import static org.eclipse.jifa.gclog.event.eventInfo.GCPause.CONCURRENT; +import static org.eclipse.jifa.gclog.event.eventInfo.GCPause.PARTIAL; +import static org.eclipse.jifa.gclog.event.eventInfo.GCPause.PAUSE; /* * store all info that may affect the way model is organized and explained diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java index 6a610a40..92bcd6a4 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java @@ -37,11 +37,11 @@ import org.eclipse.jifa.gclog.event.Safepoint; import org.eclipse.jifa.gclog.event.ThreadEvent; import org.eclipse.jifa.gclog.event.TimedEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCCause; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventLevel; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; -import org.eclipse.jifa.gclog.event.evnetInfo.GCPause; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.GCCause; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventLevel; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.GCPause; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.model.modeInfo.GCCollectorType; import org.eclipse.jifa.gclog.model.modeInfo.GCLogMetadata; import org.eclipse.jifa.gclog.model.modeInfo.GCLogStyle; @@ -75,14 +75,14 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.ARCHIVE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.EDEN; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HEAP; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HUMONGOUS; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.METASPACE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.OLD; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.SURVIVOR; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.YOUNG; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.ARCHIVE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.EDEN; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HEAP; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HUMONGOUS; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.METASPACE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.OLD; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.SURVIVOR; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.YOUNG; import static org.eclipse.jifa.gclog.model.GCEventType.CMS_CONCURRENT_MARK_SWEPT; import static org.eclipse.jifa.gclog.model.GCEventType.FULL_GC; import static org.eclipse.jifa.gclog.model.GCEventType.G1_CONCURRENT_CYCLE; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GenerationalGCModel.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GenerationalGCModel.java index 61606f0d..daef1fd4 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GenerationalGCModel.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GenerationalGCModel.java @@ -14,9 +14,9 @@ package org.eclipse.jifa.gclog.model; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCCause; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.GCCause; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.model.modeInfo.GCCollectorType; import org.eclipse.jifa.gclog.model.modeInfo.GCLogStyle; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/ZGCModel.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/ZGCModel.java index ef2743aa..245556bf 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/ZGCModel.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/ZGCModel.java @@ -18,7 +18,7 @@ import lombok.NoArgsConstructor; import org.eclipse.jifa.gclog.event.GCEvent; import org.eclipse.jifa.gclog.event.TimedEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.model.modeInfo.GCCollectorType; import org.eclipse.jifa.gclog.util.Constant; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/AbstractPreUnifiedGCLogParser.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/AbstractPreUnifiedGCLogParser.java index 408b14d2..e956499b 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/AbstractPreUnifiedGCLogParser.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/AbstractPreUnifiedGCLogParser.java @@ -17,10 +17,10 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.jifa.common.domain.exception.ShouldNotReachHereException; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.CpuTime; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; -import org.eclipse.jifa.gclog.event.evnetInfo.ReferenceGC; +import org.eclipse.jifa.gclog.event.eventInfo.CpuTime; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.ReferenceGC; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; import org.eclipse.jifa.gclog.model.modeInfo.GCCollectorType; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/PreUnifiedG1GCLogParser.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/PreUnifiedG1GCLogParser.java index 629fcb38..e8cc2526 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/PreUnifiedG1GCLogParser.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/PreUnifiedG1GCLogParser.java @@ -16,9 +16,9 @@ import org.apache.commons.lang3.StringUtils; import org.eclipse.jifa.common.domain.exception.ShouldNotReachHereException; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; import org.eclipse.jifa.gclog.util.GCLogUtil; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/PreUnifiedGenerationalGCLogParser.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/PreUnifiedGenerationalGCLogParser.java index 053cfe07..47a0077d 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/PreUnifiedGenerationalGCLogParser.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/PreUnifiedGenerationalGCLogParser.java @@ -15,10 +15,10 @@ import org.eclipse.jifa.common.domain.exception.ShouldNotReachHereException; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCCause; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.GCCause; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; import org.eclipse.jifa.gclog.util.GCLogUtil; @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.List; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HEAP; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HEAP; import static org.eclipse.jifa.gclog.model.GCEventType.*; import static org.eclipse.jifa.gclog.parser.ParseRule.ParseRuleContext; import static org.eclipse.jifa.gclog.parser.ParseRule.ParseRuleContext.EVENT; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedG1GCLogParser.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedG1GCLogParser.java index 014826af..b1be1098 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedG1GCLogParser.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedG1GCLogParser.java @@ -15,7 +15,7 @@ import org.eclipse.jifa.common.domain.exception.ShouldNotReachHereException; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; import org.eclipse.jifa.gclog.model.G1GCModel; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedG1OrGenerationalGCLogParser.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedG1OrGenerationalGCLogParser.java index 044fe2dd..22204c8c 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedG1OrGenerationalGCLogParser.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedG1OrGenerationalGCLogParser.java @@ -15,11 +15,11 @@ import org.apache.commons.lang3.StringUtils; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.CpuTime; -import org.eclipse.jifa.gclog.event.evnetInfo.GCCause; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.CpuTime; +import org.eclipse.jifa.gclog.event.eventInfo.GCCause; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; import org.eclipse.jifa.gclog.model.modeInfo.GCCollectorType; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedGenerationalGCLogParser.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedGenerationalGCLogParser.java index 9cd83f5f..082fadeb 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedGenerationalGCLogParser.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedGenerationalGCLogParser.java @@ -15,7 +15,7 @@ import org.eclipse.jifa.common.domain.exception.ShouldNotReachHereException; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedZGCLogParser.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedZGCLogParser.java index 11ff3fa8..f83a9ec0 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedZGCLogParser.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/parser/UnifiedZGCLogParser.java @@ -16,7 +16,7 @@ import org.eclipse.jifa.common.domain.exception.ShouldNotReachHereException; import org.eclipse.jifa.gclog.event.GCEvent; import org.eclipse.jifa.gclog.event.ThreadEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; import org.eclipse.jifa.gclog.model.ZGCModel; @@ -26,8 +26,8 @@ import java.util.ArrayList; import java.util.List; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HEAP; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.METASPACE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HEAP; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.METASPACE; import static org.eclipse.jifa.gclog.model.GCEventType.ZGC_ALLOCATION_STALL; import static org.eclipse.jifa.gclog.model.GCEventType.ZGC_CONCURRENT_DETATCHED_PAGES; import static org.eclipse.jifa.gclog.model.GCEventType.ZGC_CONCURRENT_MARK; diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/util/GCLogUtil.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/util/GCLogUtil.java index d315f3d6..4a94ea36 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/util/GCLogUtil.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/util/GCLogUtil.java @@ -13,7 +13,7 @@ package org.eclipse.jifa.gclog.util; -import org.eclipse.jifa.gclog.event.evnetInfo.CpuTime; +import org.eclipse.jifa.gclog.event.eventInfo.CpuTime; import java.time.OffsetDateTime; import java.util.ArrayList; diff --git a/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestFragmentedParserToGCModel.java b/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestFragmentedParserToGCModel.java index 53cc1178..6e5b7a64 100644 --- a/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestFragmentedParserToGCModel.java +++ b/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestFragmentedParserToGCModel.java @@ -16,7 +16,7 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.jifa.analysis.listener.DefaultProgressListener; import org.eclipse.jifa.gclog.event.GCEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea; +import org.eclipse.jifa.gclog.event.eventInfo.MemoryArea; import org.eclipse.jifa.gclog.fragment.GCLogAnalyzer; import org.eclipse.jifa.gclog.model.*; import org.eclipse.jifa.gclog.parser.*; @@ -27,7 +27,7 @@ import java.util.*; import static org.eclipse.jifa.gclog.TestUtil.generateShuffledGCLog; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.*; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.*; /* This test aims the same as TestFragmentedParserToGCModelLegacy. diff --git a/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestFragmentedParserToGCModelLegacy.java b/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestFragmentedParserToGCModelLegacy.java index 88529cbe..b41bc971 100644 --- a/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestFragmentedParserToGCModelLegacy.java +++ b/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestFragmentedParserToGCModelLegacy.java @@ -15,7 +15,7 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.jifa.gclog.event.GCEvent; import org.eclipse.jifa.gclog.event.Safepoint; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; import org.eclipse.jifa.gclog.fragment.GCLogAnalyzer; import org.eclipse.jifa.gclog.model.*; import org.eclipse.jifa.gclog.model.modeInfo.GCCollectorType; @@ -27,12 +27,12 @@ import java.util.*; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.*; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.ALLOCATION_FAILURE; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType.TO_SPACE_EXHAUSTED; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType.YOUNG_GC_BECOME_FULL_GC; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.*; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HEAP; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.*; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.ALLOCATION_FAILURE; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType.TO_SPACE_EXHAUSTED; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType.YOUNG_GC_BECOME_FULL_GC; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.*; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HEAP; import static org.eclipse.jifa.gclog.util.Constant.UNKNOWN_DOUBLE; /* diff --git a/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestGCModel.java b/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestGCModel.java index dc7a4854..6bc78bf1 100644 --- a/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestGCModel.java +++ b/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestGCModel.java @@ -16,9 +16,9 @@ import org.eclipse.jifa.analysis.listener.DefaultProgressListener; import org.eclipse.jifa.gclog.event.GCEvent; import org.eclipse.jifa.gclog.event.Safepoint; -import org.eclipse.jifa.gclog.event.evnetInfo.GCCause; -import org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.GCCause; +import org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; import org.eclipse.jifa.gclog.model.G1GCModel; import org.eclipse.jifa.gclog.model.GCEventType; import org.eclipse.jifa.gclog.model.GCModel; @@ -41,12 +41,12 @@ import java.util.Map; import static org.eclipse.jifa.gclog.TestUtil.stringToBufferedReader; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.EDEN; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HEAP; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HUMONGOUS; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.METASPACE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.OLD; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.SURVIVOR; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.EDEN; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HEAP; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HUMONGOUS; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.METASPACE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.OLD; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.SURVIVOR; import static org.eclipse.jifa.gclog.model.GCEventType.FULL_GC; import static org.eclipse.jifa.gclog.model.GCEventType.G1_CONCURRENT_CLEAR_CLAIMED_MARKS; import static org.eclipse.jifa.gclog.model.GCEventType.G1_CONCURRENT_CYCLE; diff --git a/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestParser.java b/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestParser.java index 7929ae0b..074c8daa 100644 --- a/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestParser.java +++ b/analysis/gc-log/src/test/java/org/eclipse/jifa/gclog/TestParser.java @@ -17,7 +17,7 @@ import org.eclipse.jifa.gclog.event.GCEvent; import org.eclipse.jifa.gclog.event.Safepoint; import org.eclipse.jifa.gclog.event.ThreadEvent; -import org.eclipse.jifa.gclog.event.evnetInfo.GCMemoryItem; +import org.eclipse.jifa.gclog.event.eventInfo.GCMemoryItem; import org.eclipse.jifa.gclog.model.CMSGCModel; import org.eclipse.jifa.gclog.model.G1GCModel; import org.eclipse.jifa.gclog.model.GCEventType; @@ -44,28 +44,28 @@ import java.util.List; import static org.eclipse.jifa.gclog.TestUtil.stringToBufferedReader; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.ALLOCATION_FAILURE; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.CMS_FINAL_REMARK; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.ERGONOMICS; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.G1_COMPACTION; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.G1_EVACUATION_PAUSE; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.HEAP_DUMP; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.METADATA_GENERATION_THRESHOLD; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.PROACTIVE; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.PROMOTION_FAILED; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCCause.WARMUP; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType.TO_SPACE_EXHAUSTED; -import static org.eclipse.jifa.gclog.event.evnetInfo.GCEventBooleanType.YOUNG_GC_BECOME_FULL_GC; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.ARCHIVE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.CLASS; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.EDEN; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HEAP; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.HUMONGOUS; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.METASPACE; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.NONCLASS; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.OLD; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.SURVIVOR; -import static org.eclipse.jifa.gclog.event.evnetInfo.MemoryArea.YOUNG; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.ALLOCATION_FAILURE; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.CMS_FINAL_REMARK; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.ERGONOMICS; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.G1_COMPACTION; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.G1_EVACUATION_PAUSE; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.HEAP_DUMP; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.METADATA_GENERATION_THRESHOLD; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.PROACTIVE; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.PROMOTION_FAILED; +import static org.eclipse.jifa.gclog.event.eventInfo.GCCause.WARMUP; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType.TO_SPACE_EXHAUSTED; +import static org.eclipse.jifa.gclog.event.eventInfo.GCEventBooleanType.YOUNG_GC_BECOME_FULL_GC; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.ARCHIVE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.CLASS; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.EDEN; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HEAP; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.HUMONGOUS; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.METASPACE; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.NONCLASS; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.OLD; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.SURVIVOR; +import static org.eclipse.jifa.gclog.event.eventInfo.MemoryArea.YOUNG; import static org.eclipse.jifa.gclog.util.Constant.UNKNOWN_DOUBLE; import static org.eclipse.jifa.gclog.util.Constant.UNKNOWN_INT; From 253e3fba09d1377c6e27edc780b04b8ca655bfe3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:45:02 +0800 Subject: [PATCH 12/20] build(deps): bump braces from 3.0.2 to 3.0.3 in /frontend (#289) Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ff45ee0f..bef95433 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -2389,11 +2389,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -3823,9 +3823,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, From ed6e5c09d37c82fe83b5dbc777fb73667ce8cd39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:45:27 +0800 Subject: [PATCH 13/20] build(deps-dev): bump ws from 8.13.0 to 8.17.1 in /frontend (#290) Bumps [ws](https://github.com/websockets/ws) from 8.13.0 to 8.17.1. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/8.13.0...8.17.1) --- updated-dependencies: - dependency-name: ws dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index bef95433..781e6077 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -7585,9 +7585,9 @@ "dev": true }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "engines": { "node": ">=10.0.0" From 5299fc2cb13712036ad0345a3ca8890603994f3a Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Tue, 9 Jul 2024 14:15:32 +0800 Subject: [PATCH 14/20] doc: delete the links not in use --- README.md | 2 -- README_zh.md | 1 - 2 files changed, 3 deletions(-) diff --git a/README.md b/README.md index b32b8d6a..bf6d07bb 100644 --- a/README.md +++ b/README.md @@ -47,5 +47,3 @@ Note: Please make sure that Docker is installed. ## Links - [GitHub Pages](https://eclipse.github.io/jifa) -- [Mail List](https://accounts.eclipse.org/mailing-list/jifa-dev) -- [Slack Channel](https://eclipsejifa.slack.com/) diff --git a/README_zh.md b/README_zh.md index 28071009..fc36c241 100644 --- a/README_zh.md +++ b/README_zh.md @@ -48,7 +48,6 @@ curl -fsSL https://raw.githubusercontent.com/eclipse/jifa/main/jifa.sh | bash -s ## 相关链接 - [GitHub Pages](https://eclipse.github.io/jifa/zh/) -- [邮件列表](https://accounts.eclipse.org/mailing-list/jifa-dev) - 钉钉交流群二维码
From 98bb26a769595d75bfab2943c72efa5caf63f376 Mon Sep 17 00:00:00 2001 From: gDreamcatcher <824792611@qq.com> Date: Fri, 12 Jul 2024 09:29:26 +0800 Subject: [PATCH 15/20] feat: add a new tab for env variables in heapdump (#291) --- .../jifa/hda/api/HeapDumpAnalyzer.java | 4 +- .../jifa/hda/impl/HeapDumpAnalyzerImpl.java | 35 +++++--- .../src/components/heapdump/EnvVariables.vue | 85 +++++++++++++++++++ frontend/src/components/heapdump/HeapDump.vue | 4 +- frontend/src/i18n/heapdump/en.ts | 3 +- frontend/src/i18n/heapdump/zh.ts | 3 +- 6 files changed, 118 insertions(+), 16 deletions(-) create mode 100644 frontend/src/components/heapdump/EnvVariables.vue diff --git a/analysis/heap-dump/api/src/main/java/org/eclipse/jifa/hda/api/HeapDumpAnalyzer.java b/analysis/heap-dump/api/src/main/java/org/eclipse/jifa/hda/api/HeapDumpAnalyzer.java index 5ad49148..9a5dfd3f 100644 --- a/analysis/heap-dump/api/src/main/java/org/eclipse/jifa/hda/api/HeapDumpAnalyzer.java +++ b/analysis/heap-dump/api/src/main/java/org/eclipse/jifa/hda/api/HeapDumpAnalyzer.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -34,6 +34,8 @@ public interface HeapDumpAnalyzer { Map getSystemProperties(); + Map getEnvVariables(); + List getBiggestObjects(); @ApiMeta(aliases = "object") diff --git a/analysis/heap-dump/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java b/analysis/heap-dump/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java index c59a2e16..01b6f83e 100644 --- a/analysis/heap-dump/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java +++ b/analysis/heap-dump/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -72,17 +72,7 @@ import java.lang.ref.SoftReference; import java.net.URL; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.StringTokenizer; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; @@ -271,6 +261,27 @@ public Map getSystemProperties() { }); } + @Override + public Map getEnvVariables() { + return $(() -> { + Map env = new HashMap<>(); + Collection classes = context.snapshot.getClassesByName("java.lang.ProcessEnvironment", true); + if(classes == null || classes.isEmpty()){ + return env; + } + IClass systemClass = classes.iterator().next(); + IObject iObject = (IObject) systemClass.resolveValue("theEnvironment"); + IResultTable result = (IResultTable) SnapshotQuery.lookup("hash_entries", context.snapshot) + .setArgument("objects", iObject).execute(new ProgressListenerImpl(NoOpProgressListener)); + int rowCount = result.getRowCount(); + for(int i = 0; i< rowCount; i++){ + Object row = result.getRow(i); + env.put((String) result.getColumnValue(row, 1), (String) result.getColumnValue(row, 2)); + } + return env; + }); + } + @Override public JavaObject getObjectInfo(int objectId) { return $(() -> { diff --git a/frontend/src/components/heapdump/EnvVariables.vue b/frontend/src/components/heapdump/EnvVariables.vue new file mode 100644 index 00000000..12e48c2c --- /dev/null +++ b/frontend/src/components/heapdump/EnvVariables.vue @@ -0,0 +1,85 @@ + + + diff --git a/frontend/src/components/heapdump/HeapDump.vue b/frontend/src/components/heapdump/HeapDump.vue index 16b06bba..568dbeda 100644 --- a/frontend/src/components/heapdump/HeapDump.vue +++ b/frontend/src/components/heapdump/HeapDump.vue @@ -18,6 +18,7 @@ import DominatorTree from '@/components/heapdump/DominatorTree.vue'; import Histogram from '@/components/heapdump/Histogram.vue'; import Threads from '@/components/heapdump/Threads.vue'; import SystemProperties from '@/components/heapdump/SystemProperties.vue'; +import EnvVariables from '@/components/heapdump/EnvVariables.vue'; import Query from '@/components/heapdump/Query.vue'; import GCRoots from '@/components/heapdump/GCRoots.vue'; import UnreachableObjects from '@/components/heapdump/UnreachableObjects.vue'; @@ -56,7 +57,8 @@ const tabs = { DirectByteBuffers, DuplicateClasses, UnreachableObjects, - SystemProperties + SystemProperties, + EnvVariables }; const width = useDebouncedRef(window.innerWidth); diff --git a/frontend/src/i18n/heapdump/en.ts b/frontend/src/i18n/heapdump/en.ts index f5a5226e..d41e425d 100644 --- a/frontend/src/i18n/heapdump/en.ts +++ b/frontend/src/i18n/heapdump/en.ts @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -40,6 +40,7 @@ export default { threads: 'Threads', unreachableObjects: 'Unreachable Objects', systemProperties: 'System Properties', + envVariables: 'Environment Variables', directByteBuffers: 'Direct Byte Buffers', classLoaders: 'Class Loaders', duplicateClasses: 'Duplicated Classes', diff --git a/frontend/src/i18n/heapdump/zh.ts b/frontend/src/i18n/heapdump/zh.ts index 58e011ee..215d24ec 100644 --- a/frontend/src/i18n/heapdump/zh.ts +++ b/frontend/src/i18n/heapdump/zh.ts @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -40,6 +40,7 @@ export default { threads: '线程', unreachableObjects: '不可达对象', systemProperties: '系统属性', + envVariables: '环境变量', directByteBuffers: '堆外内存', classLoaders: '类加载器', duplicateClasses: '重复类', From ce5a9a34e9ba42575bd19b42ea3dccd5d83692a3 Mon Sep 17 00:00:00 2001 From: "yifeng.jyf" Date: Mon, 22 Jul 2024 17:17:43 +0800 Subject: [PATCH 16/20] fix: gc event promotion when there is humongous --- .../src/main/java/org/eclipse/jifa/gclog/model/GCModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java index 92bcd6a4..1cc5ad1b 100644 --- a/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java +++ b/analysis/gc-log/src/main/java/org/eclipse/jifa/gclog/model/GCModel.java @@ -659,7 +659,7 @@ private void calculateEventsMemoryInfo() { if (youngReduction != Constant.UNKNOWN_INT && totalReduction != Constant.UNKNOWN_INT) { long promotion = youngReduction - totalReduction; if (humongous != null && humongous.getMemoryReduction() != Constant.UNKNOWN_INT) { - promotion -= humongous.getMemoryReduction(); + promotion += humongous.getMemoryReduction(); } event.setPromotion(zeroIfNegative(promotion)); } From 97e72c0e4e2c1508e1b002578fcb675baf7b57ee Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Sat, 31 Aug 2024 09:34:04 +0800 Subject: [PATCH 17/20] feat: show jvm options in heap dump overview --- .../java/org/eclipse/jifa/hda/api/Model.java | 13 ++--- .../jifa/hda/impl/HeapDumpAnalyzerImpl.java | 54 ++++++++++++++++--- frontend/src/components/heapdump/Overview.vue | 28 +++++----- frontend/src/i18n/heapdump/en.ts | 1 + frontend/src/i18n/heapdump/zh.ts | 1 + 5 files changed, 70 insertions(+), 27 deletions(-) diff --git a/analysis/heap-dump/api/src/main/java/org/eclipse/jifa/hda/api/Model.java b/analysis/heap-dump/api/src/main/java/org/eclipse/jifa/hda/api/Model.java index 63bcfb19..5d91c330 100644 --- a/analysis/heap-dump/api/src/main/java/org/eclipse/jifa/hda/api/Model.java +++ b/analysis/heap-dump/api/src/main/java/org/eclipse/jifa/hda/api/Model.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -754,8 +754,6 @@ public BigObject(String label, int objectId, double value, String description) { @Data class Details { - public String jvmInfo; - public int identifierSize; public long creationDate; @@ -770,13 +768,12 @@ class Details { public long usedHeapSize; - public boolean generationInfoAvailable; + public List jvmOptions; - public Details(String jvmInfo, int identifierSize, long creationDate, int numberOfObjects, + public Details(int identifierSize, long creationDate, int numberOfObjects, int numberOfGCRoots, int numberOfClasses, int numberOfClassLoaders, long usedHeapSize, - boolean generationInfoAvailable) { - this.jvmInfo = jvmInfo; + List jvmOptions) { this.identifierSize = identifierSize; this.creationDate = creationDate; this.numberOfObjects = numberOfObjects; @@ -784,7 +781,7 @@ public Details(String jvmInfo, int identifierSize, long creationDate, int number this.numberOfClasses = numberOfClasses; this.numberOfClassLoaders = numberOfClassLoaders; this.usedHeapSize = usedHeapSize; - this.generationInfoAvailable = generationInfoAvailable; + this.jvmOptions = jvmOptions; } } } diff --git a/analysis/heap-dump/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java b/analysis/heap-dump/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java index 01b6f83e..fb383583 100644 --- a/analysis/heap-dump/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java +++ b/analysis/heap-dump/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java @@ -72,7 +72,18 @@ import java.lang.ref.SoftReference; import java.net.URL; import java.nio.file.Path; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.StringTokenizer; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; @@ -194,6 +205,14 @@ private static Map> convert(AnalysisContext context, } } + private static V $(RV rv, V def) { + try { + return rv.run(); + } catch (Throwable t) { + return def; + } + } + private static void $(R e) { $(() -> { e.run(); @@ -210,15 +229,38 @@ public void dispose() { public Overview.Details getDetails() { return $(() -> { SnapshotInfo snapshotInfo = context.snapshot.getSnapshotInfo(); - return new Overview.Details(snapshotInfo.getJvmInfo(), snapshotInfo.getIdentifierSize(), - snapshotInfo.getCreationDate().getTime(), snapshotInfo.getNumberOfObjects(), - snapshotInfo.getNumberOfGCRoots(), snapshotInfo.getNumberOfClasses(), - snapshotInfo.getNumberOfClassLoaders(), snapshotInfo.getUsedHeapSize(), - false); + return new Overview.Details(snapshotInfo.getIdentifierSize(), + snapshotInfo.getCreationDate().getTime(), + snapshotInfo.getNumberOfObjects(), + snapshotInfo.getNumberOfGCRoots(), + snapshotInfo.getNumberOfClasses(), + snapshotInfo.getNumberOfClassLoaders(), + snapshotInfo.getUsedHeapSize(), + getJVMOptions()); } ); } + private List getJVMOptions() { + return $(() -> { + List result = new ArrayList<>(); + IResult oqlResult = getOQLResult(context, "select v.vmArgs.list.a.@objectId from sun.management.VMManagementImpl v"); + if (oqlResult instanceof IResultTable t && t.getRowCount() == 1) { + Object row = t.getRow(0); + Integer id = (Integer) t.getColumnValue(row, 0); + IObjectArray array = (IObjectArray) context.snapshot.getObject(id); + long[] refs = array.getReferenceArray(); + for (long address : refs) { + if (address != 0) { + IObject object = context.snapshot.getObject(context.snapshot.mapAddressToId(address)); + result.add(object.getClassSpecificName()); + } + } + } + return result; + }, Collections.emptyList()); + } + private Res queryByCommand(AnalysisContext context, String command) throws SnapshotException { return queryByCommand(context, command, null, NoOpProgressListener); diff --git a/frontend/src/components/heapdump/Overview.vue b/frontend/src/components/heapdump/Overview.vue index b0b11e24..bd729363 100644 --- a/frontend/src/components/heapdump/Overview.vue +++ b/frontend/src/components/heapdump/Overview.vue @@ -1,5 +1,5 @@