diff --git a/run-agent.sh b/run-agent.sh index 98a6b337..71199ba5 100755 --- a/run-agent.sh +++ b/run-agent.sh @@ -1,6 +1,6 @@ #!/bin/bash -./gradlew build -p scavenger-agent-java -x test +./gradlew build -p scavenger-agent-java -x test -x integrationTest ./gradlew build -p scavenger-demo -x test java -Dscavenger.configuration=./scavenger-demo/scavenger.conf \ diff --git a/scavenger-agent-java/build.gradle.kts b/scavenger-agent-java/build.gradle.kts index 218b7ca1..3d45b075 100644 --- a/scavenger-agent-java/build.gradle.kts +++ b/scavenger-agent-java/build.gradle.kts @@ -19,8 +19,6 @@ java { withSourcesJar() } -tasks.jar { enabled = false } - tasks.withType { archiveFileName.set("${project.name}-${project.version}.jar") @@ -64,9 +62,9 @@ repositories { dependencies { implementation(project(":scavenger-model")) - implementation("net.bytebuddy:byte-buddy:1.12.23") - implementation("org.ow2.asm:asm:9.4") - implementation("org.ow2.asm:asm-tree:9.4") + implementation("net.bytebuddy:byte-buddy:1.14.3") + implementation("org.ow2.asm:asm:9.5") + implementation("org.ow2.asm:asm-tree:9.5") implementation("com.squareup.okhttp3:okhttp:3.14.9") implementation("com.google.protobuf:protobuf-java-util:${property("protobufVersion")}") implementation("io.grpc:grpc-stub:${property("grpcVersion")}") @@ -100,6 +98,7 @@ val integrationTestRuntimeClasspath = configurations.named("integrationTestRunti tasks.named("integrationTest") { dependsOn(tasks.shadowJar) + mustRunAfter(tasks.jar) shouldRunAfter(tasks.test) useJUnitPlatform() @@ -109,7 +108,7 @@ tasks.named("integrationTest") { systemProperty("integrationTest.scavengerAgent", tasks.shadowJar.get().outputs.files.asPath) systemProperty("integrationTest.classpath", "build/classes/java/integrationTest:$integrationTestRuntimeClasspath") - systemProperty("integrationTest.javaPaths", javaPaths(8, 11, 17)) + systemProperty("integrationTest.javaPaths", javaPaths(8, 11, 17, 21)) } tasks.withType { diff --git a/scavenger-api/build.gradle.kts b/scavenger-api/build.gradle.kts index f9defe09..b26d3cc7 100644 --- a/scavenger-api/build.gradle.kts +++ b/scavenger-api/build.gradle.kts @@ -42,7 +42,7 @@ dependencies { implementation("org.liquibase:liquibase-core") implementation("io.github.microutils:kotlin-logging-jvm:2.1.23") implementation("net.ttddyy:datasource-proxy:1.7") - implementation("com.github.vertical-blank:sql-formatter:1.0.1") + implementation("com.github.vertical-blank:sql-formatter:2.0.4") implementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.9.0") testImplementation("org.springframework.boot:spring-boot-starter-test") } diff --git a/scavenger-api/src/main/kotlin/com/navercorp/scavenger/service/SnapshotNodeService.kt b/scavenger-api/src/main/kotlin/com/navercorp/scavenger/service/SnapshotNodeService.kt index 985dfca4..70d700fb 100644 --- a/scavenger-api/src/main/kotlin/com/navercorp/scavenger/service/SnapshotNodeService.kt +++ b/scavenger-api/src/main/kotlin/com/navercorp/scavenger/service/SnapshotNodeService.kt @@ -24,7 +24,7 @@ class SnapshotNodeService( filteredMethodInvocations.forEach { updateCountGraph( current = root, - elements = splitSignature(it), + elements = splitSignatureWithType(it), isUsed = it.invokedAtMillis > 0 && it.invokedAtMillis >= snapshotEntity.filterInvokedAtMillis, invokedAtMillis = it.invokedAtMillis ) @@ -75,22 +75,23 @@ class SnapshotNodeService( private fun updateCountGraph( current: Node, - elements: List, + elements: List, isUsed: Boolean, invokedAtMillis: Long ) { var node = current elements.forEach { + val signature = it.signature updateCount(node, isUsed, invokedAtMillis) - if (it !in node.signatureChildMap) { - val delimiter = if (node.type == Node.Type.CLASS && !it.contains("(")) "$" else "." - val nextElementName = if (node.signature.isBlank()) it else "${node.signature}$delimiter$it" - node.signatureChildMap[it] = Node( + if (signature !in node.signatureChildMap) { + val delimiter = if (signature.contains("$")) "" else "." + val nextElementName = if (node.signature.isBlank()) signature else "${node.signature}$delimiter$signature" + node.signatureChildMap[signature] = Node( signature = nextElementName, - type = getType(node, nextElementName) + type = it.type ) } - node = node.signatureChildMap.getValue(it) + node = node.signatureChildMap.getValue(signature) } updateCount(node, isUsed, invokedAtMillis) } @@ -112,38 +113,38 @@ class SnapshotNodeService( * "a.b.c.d(e, f)" to ["a", "b", "c", "d(e, f)"] * "a.b.c.D(e, f)" to ["a", "b", "c", "D", "D(e, f)"] */ - private fun splitSignature(methodInvocationEntity: MethodInvocationEntity): List { + private fun splitSignatureWithType(methodInvocationEntity: MethodInvocationEntity): List { val (nameOnlySignature, arguments) = methodInvocationEntity.signature.split("(", limit = 2) - val elements = nameOnlySignature.split(*DELIMITERS) + val elements = nameOnlySignature.split("(?=\\b[.$])".toRegex()) .filterNot { it == "" } + .map { SignatureWithType(it.replace(".", "")) } .toMutableList() if (isConstructor(methodInvocationEntity)) { - elements.add(elements.last()) + val constructorSignature = elements.last().signature + elements.add(SignatureWithType(constructorSignature.replace("$", ""))) } - elements[elements.size - 1] = "${elements.last()}($arguments" + if (arguments.last() != ')') ")" else "" - return elements - } + val lastElement = elements.removeLast() + elements.add(SignatureWithType("${lastElement.signature}($arguments" + if (arguments.last() != ')') ")" else "")) - private fun isConstructor(methodInvocationEntity: MethodInvocationEntity): Boolean { - return methodInvocationEntity.methodName == "" - } - - private fun getType(parent: Node, signature: String): Node.Type { - val isParentTypeClass = parent.type == Node.Type.CLASS - return if (isParentTypeClass && signature.contains("(")) { - Node.Type.METHOD - } else { - val split = signature.split(*DELIMITERS) - val firstOfLast = split.last()[0] - if (firstOfLast.uppercaseChar() == firstOfLast || isParentTypeClass /*Inner Class*/) { + elements.forEachIndexed { index, signatureWithType -> + val signature = signatureWithType.signature + signatureWithType.type = if (signature.contains("(")) { + Node.Type.METHOD + } else if (signature.contains("$") || elements[index + 1].signature.contains("[($]".toRegex())) { Node.Type.CLASS } else { Node.Type.PACKAGE } } + + return elements + } + + private fun isConstructor(methodInvocationEntity: MethodInvocationEntity): Boolean { + return methodInvocationEntity.methodName == "" } private fun serializeGraphAddToNodes( @@ -179,6 +180,12 @@ class SnapshotNodeService( ) } + data class SignatureWithType( + val signature: String, + ) { + lateinit var type: Node.Type + } + data class Node( val signature: String, val type: Type, @@ -194,6 +201,5 @@ class SnapshotNodeService( companion object { private const val BATCH_CHUNK_SIZE = 1000 - private val DELIMITERS = arrayOf(".", "$") } } diff --git a/scavenger-api/src/test/kotlin/com/navercorp/scavenger/repository/ApplicationRepositoryTest.kt b/scavenger-api/src/test/kotlin/com/navercorp/scavenger/repository/ApplicationRepositoryTest.kt index b9d7cbdc..ea9d3b14 100644 --- a/scavenger-api/src/test/kotlin/com/navercorp/scavenger/repository/ApplicationRepositoryTest.kt +++ b/scavenger-api/src/test/kotlin/com/navercorp/scavenger/repository/ApplicationRepositoryTest.kt @@ -12,7 +12,7 @@ class ApplicationRepositoryTest { @Test fun findAllByCustomerId() { - assertThat(sut.findAllByCustomerId(1)).hasSize(1) + assertThat(sut.findAllByCustomerId(1)).hasSize(2) } @Test diff --git a/scavenger-collector/src/main/kotlin/com/navercorp/scavenger/config/ArmeriaConfiguration.kt b/scavenger-collector/src/main/kotlin/com/navercorp/scavenger/config/ArmeriaConfiguration.kt index 915bf3f4..de9e8b50 100644 --- a/scavenger-collector/src/main/kotlin/com/navercorp/scavenger/config/ArmeriaConfiguration.kt +++ b/scavenger-collector/src/main/kotlin/com/navercorp/scavenger/config/ArmeriaConfiguration.kt @@ -43,14 +43,16 @@ class ArmeriaConfiguration( @Bean fun armeriaServiceInitializer(tomcatService: TomcatService): ArmeriaServerConfigurator { return ArmeriaServerConfigurator { serviceBuilder: ServerBuilder -> + val maxMessageSize = maxMessageSize.toBytes().toInt() serviceBuilder.service("prefix:/", tomcatService) .service(GrpcService.builder() .addService(grpcAgentController) .addExceptionMapping(IllegalArgumentException::class.java, Status.INVALID_ARGUMENT) .addExceptionMapping(LicenseKeyNotFoundException::class.java, Status.UNAUTHENTICATED) - .maxRequestMessageLength(maxMessageSize.toBytes().toInt()) + .maxRequestMessageLength(maxMessageSize) .build() ) + .maxRequestLength(maxMessageSize.toLong()) } } } diff --git a/scavenger-collector/src/test/kotlin/com/navercorp/scavenger/service/GarbageCollectServiceTest.kt b/scavenger-collector/src/test/kotlin/com/navercorp/scavenger/service/GarbageCollectServiceTest.kt index bb8c1ace..5229e588 100644 --- a/scavenger-collector/src/test/kotlin/com/navercorp/scavenger/service/GarbageCollectServiceTest.kt +++ b/scavenger-collector/src/test/kotlin/com/navercorp/scavenger/service/GarbageCollectServiceTest.kt @@ -197,14 +197,14 @@ class GarbageCollectServiceTest { sut.sweepMethods(customerId, min!!) assertThat(methodDao.findAllByCustomerId(customerId)) .describedAs("nothing is deleted when the 1 week is not passed since last seen") - .hasSize(5) + .hasSize(34) assertThat(invocationDao.findAllByCustomerId(customerId)) .describedAs("invocations should be same as before") .hasSize(invocations.size) sut.sweepMethods(customerId, min!!.plusSeconds(10)) assertThat(methodDao.findAllByCustomerId(customerId)) .describedAs("marked method is deleted when the more than 1 week is passed after last seen") - .hasSize(3) + .hasSize(32) val invocationsAfter = invocationDao.findAllByCustomerId(customerId) assertThat(invocationsAfter) .describedAs("invocations should be deleted as well") @@ -212,7 +212,7 @@ class GarbageCollectServiceTest { sut.sweepMethods(customerId, Instant.now()) assertThat(methodDao.findAllByCustomerId(customerId)) .describedAs("nothing more is deleted when no marking is done") - .hasSize(3) + .hasSize(32) } @Test @@ -225,14 +225,14 @@ class GarbageCollectServiceTest { sut.sweepMethods(customerId, min!!) assertThat(methodDao.findAllByCustomerId(customerId)) .describedAs("nothing is deleted when the 1 week is not passed since last seen") - .hasSize(5) + .hasSize(34) assertThat(invocationDao.findAllByCustomerId(customerId)) .describedAs("invocations should be same as before") .hasSize(invocations.size) sut.sweepMethods(customerId, min!!.plusSeconds(10)) assertThat(methodDao.findAllByCustomerId(customerId)) .describedAs("marked method is deleted when the more than 1 week is passed after last seen") - .hasSize(3) + .hasSize(32) val invocationsAfter = invocationDao.findAllByCustomerId(customerId) assertThat(invocationsAfter) .describedAs("invocations should be deleted as well") @@ -240,7 +240,7 @@ class GarbageCollectServiceTest { sut.sweepMethods(customerId, Instant.now()) assertThat(methodDao.findAllByCustomerId(customerId)) .describedAs("nothing more is deleted when no marking is done") - .hasSize(3) + .hasSize(32) } } diff --git a/scavenger-demo/src/main/kotlin/com/example/demo/controller/MyController.kt b/scavenger-demo/src/main/kotlin/com/example/demo/controller/MyController.kt index c9a6b6a8..bad4868b 100644 --- a/scavenger-demo/src/main/kotlin/com/example/demo/controller/MyController.kt +++ b/scavenger-demo/src/main/kotlin/com/example/demo/controller/MyController.kt @@ -6,6 +6,7 @@ import com.example.demo.service.BridgeService import com.example.demo.service.CglibProxyService import com.example.demo.service.DynamicProxyService import com.example.demo.service.PojoService +import com.example.demo.service2.TestService import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RestController @@ -14,13 +15,14 @@ class MyController( private val myService: BridgeService, private val dynamicProxyService: DynamicProxyService, private val cglibProxyService: CglibProxyService, - private val asyncService: AsyncService + private val asyncService: AsyncService, + private val testService: TestService ): BaseController() { @GetMapping("") fun hello(): String { dynamicProxyService.aspect() cglibProxyService.aspect() - return "myservice called ${myService.doSth()} / pojoService called ${PojoService().pojoHello()}" + return "myservice called ${myService.doSth()} / pojoService called ${PojoService().pojoHello()} / myService2 called ${testService.call()}" } @GetMapping("/additional") diff --git a/scavenger-demo/src/main/kotlin/com/example/demo/service2/TestService.kt b/scavenger-demo/src/main/kotlin/com/example/demo/service2/TestService.kt new file mode 100644 index 00000000..0a08bd6d --- /dev/null +++ b/scavenger-demo/src/main/kotlin/com/example/demo/service2/TestService.kt @@ -0,0 +1,14 @@ +package com.example.demo.service2 + +import com.example.demo.annotation.ScavengerEnabled +import com.example.demo.service.MyInterface +import com.example.demo.service.MyParentService +import org.springframework.stereotype.Service + +@ScavengerEnabled +@Service +class TestService : MyParentService(), MyInterface { + fun call(): String { + return "test" + } +} diff --git a/scavenger-frontend/src/components/snapshot/SnapshotDetail.vue b/scavenger-frontend/src/components/snapshot/SnapshotDetail.vue index d9cb3782..daa91c31 100644 --- a/scavenger-frontend/src/components/snapshot/SnapshotDetail.vue +++ b/scavenger-frontend/src/components/snapshot/SnapshotDetail.vue @@ -182,7 +182,7 @@ export default { signature = candidate.signature; } else { signature = this.snapshotData.children - .find(child => querySignature.startsWith(child.signature)).signature; + .find(child => this.isStartsWithSignature(querySignature, child.signature)).signature; } await this.updateSnapshotData(signature); } @@ -328,6 +328,17 @@ export default { resizeHorizontal(size) { localStorage.setItem("scavenger.snapshot.horizontal-size", size); }, + isStartsWithSignature(querySignature, signature) { + if (!querySignature.startsWith(signature)) { + return false; + } + + if (querySignature === signature) { + return true; + } + + return querySignature.substring(signature.length).startsWith("."); + }, }, }; diff --git a/scavenger-schema/src/main/resources/db/changelog/db.changelog-master.yaml b/scavenger-schema/src/main/resources/db/changelog/db.changelog-master.yaml index 44457d1b..7c90e94e 100644 --- a/scavenger-schema/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/scavenger-schema/src/main/resources/db/changelog/db.changelog-master.yaml @@ -1,6 +1,11 @@ databaseChangeLog: - include: file: db/changelog/schema.sql + - include: + file: db/changelog/schema-1.1.2.sql - include: file: db/changelog/test-data-set.sql context: local + - include: + file: db/changelog/test-data-set-1.1.2.sql + context: local diff --git a/scavenger-schema/src/main/resources/db/changelog/schema-1.1.2.sql b/scavenger-schema/src/main/resources/db/changelog/schema-1.1.2.sql new file mode 100644 index 00000000..685f273c --- /dev/null +++ b/scavenger-schema/src/main/resources/db/changelog/schema-1.1.2.sql @@ -0,0 +1,3 @@ +--changeset scavenger:3 + +ALTER TABLE snapshot_nodes MODIFY signature TEXT; diff --git a/scavenger-schema/src/main/resources/db/changelog/test-data-set-1.1.2.sql b/scavenger-schema/src/main/resources/db/changelog/test-data-set-1.1.2.sql new file mode 100644 index 00000000..7d705fca --- /dev/null +++ b/scavenger-schema/src/main/resources/db/changelog/test-data-set-1.1.2.sql @@ -0,0 +1,203 @@ +--liquibase formatted sql + +--changeset scavenger:4 + +INSERT INTO agent_state (id, customerid, jvmuuid, createdat, lastpolledat, nextpollexpectedat, timestamp, enabled) +VALUES (2, 1, '9421751b-456f-4c80-a7e3-b6fe0da16090', '2023-11-22 12:34:29.341488', '2023-11-22 12:35:08.775944', '2023-11-22 12:37:08.775944', + '2023-11-22 12:35:08.779066', 1); + +INSERT INTO applications (id, customerid, name, createdat) +VALUES (2, 1, 'demo2', '2023-11-22 12:34:17.745000'); + +INSERT INTO codebase_fingerprints (id, customerid, applicationid, codebasefingerprint, createdat, publishedat) +VALUES (2, 1, 2, 'c8b9f2048be8cf919e563767d5213709f7cef5640d2f775c6a10b9b69d28be13', '2023-11-22 12:34:00.000000', '2023-11-22 12:34:00.000000'); + +INSERT INTO methods (id, customerid, visibility, signature, signaturehash, createdat, lastseenatmillis, declaringtype, + methodname, modifiers, garbage) +VALUES (6, 1, 'public', 'com.example.demo.controller.FeignController.getLocalApiClient()', '1100e1797bf09b292b25be2fc2278c71', + '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.controller.FeignController', 'getLocalApiClient', 'public', 0), + (7, 1, 'public', 'com.example.demo.extmodel.MyExtensionModel.buildModels()', '2123fea886c3a62b00ae6672e810195b', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.extmodel.MyExtensionModel', 'buildModels', 'public final', 0), + (8, 1, 'public', 'com.example.demo.extmodel.MyExtensionModel.getName()', '224a3427344bbb0c1a4900b33d1c2fc9', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.extmodel.MyExtensionModel', 'getName', 'public final', 0), + (9, 1, 'public', 'com.example.demo.extmodel.MyExtensionModel.hashCode()', '2659f4dce4c4b45d9dea4ffd8749d33', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.extmodel.MyExtensionModel', 'hashCode', 'public', 0), + (10, 1, 'public', 'com.example.demo.BenchmarkController.benchmark()', '3078671bfc321a3dffe20434bce9ae84', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.BenchmarkController', 'benchmark', 'public', 0), + (11, 1, 'public', 'com.example.demo.extmodel.MyExtensionModel.component2()', '3bbfc896c8ed885e944774c2e533470c', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.extmodel.MyExtensionModel', 'component2', 'public final', 0), + (12, 1, 'public', 'com.example.demo.extmodel.MyExtensionModel.equals(java.lang.Object)', '3f6839f89b2b442b64eb893d45e6a7f0', + '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.extmodel.MyExtensionModel', 'equals', 'public', 0), + (13, 1, 'public', 'com.example.demo.service.MyParentService.test()', '4f429976e181ebbffd9533fe78ee4737', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.service.MyParentService', 'test', 'public', 0), + (14, 1, 'public', 'com.example.demo.extmodel.MyExtensionModel.component1()', '5076bea0344f39d6a845853b52ce7e0d', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.extmodel.MyExtensionModel', 'component1', 'public final', 0), + (15, 1, 'public', 'com.example.demo.controller.FeignController.runFeignRun()', '6f19e8ea1b061d5df5f49fe1445e2555', + '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.controller.FeignController', 'runFeignRun', 'public', 0), + (16, 1, 'public', 'com.example.demo.extmodel.MyExtensionModel.getId()', '79f2e4c8eecadc37f8f5728860bae743', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.extmodel.MyExtensionModel', 'getId', 'public final', 0), + (17, 1, 'public', 'com.example.demo.BenchmarkController.getBenchmarkService()', '7dddc2b35169a2d066de22de21a88348', + '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.BenchmarkController', 'getBenchmarkService', 'public', 0), + (18, 1, 'public', 'com.example.demo.service2.TestService.call()', '8c79ac2907f40e3d76afc1ea332a2221', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.service2.TestService', 'call', 'public', 0), + (19, 1, 'public', 'com.example.demo.controller.BaseController.base()', '8f2622b0c18154eb598d3ce657176c28', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.controller.BaseController', 'base', 'public final', 0), + (20, 1, 'public', 'com.example.demo.controller.FeignController.testFeign()', '8f5c5f028defb29c6a9b2e246bdf5162', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.controller.FeignController', 'testFeign', 'public', 0), + (21, 1, 'public', 'com.example.demo.controller.MyController$MyTest.nesting()', 'aa86ba4e330eb54aa890566e54ced5c2', + '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.controller.MyController$MyTest', 'nesting', 'public', 0), + (22, 1, 'public', 'com.example.demo.BenchmarkService.doNothing(int)', 'ae9884b16ebcc7e8325479e5a48cc119', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.BenchmarkService', 'doNothing', 'public', 0), + (23, 1, 'public', 'com.example.demo.extmodel.MyExtensionModel.copy(long,java.lang.String)', 'b3e7e118770fe476e0faa67dce7c3143', + '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.extmodel.MyExtensionModel', 'copy', 'public final', 0), + (24, 1, 'public', 'com.example.demo.service.DynamicProxyServiceImpl.aspect()', 'bc59fb9d12a87a9357f42d5e5ea81849', + '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.service.DynamicProxyServiceImpl', 'aspect', 'public', 0), + (25, 1, 'public', 'com.example.demo.controller.ExtensionController.runExtension()', 'bea57f297361ef9dee6817799d770e26', + '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.controller.ExtensionController', 'runExtension', 'public', 0), + (26, 1, 'public', 'com.example.demo.controller.MyController.additional()', 'c48c30b4fd1deff3bfd2deaebf9b9a8c', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.controller.MyController', 'additional', 'public', 0), + (27, 1, 'public', 'com.example.demo.controller.MyController.hello()', 'c92a85f6d5761f8bf64336d604e8edc6', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.controller.MyController', 'hello', 'public', 0), + (28, 1, 'public', 'com.example.demo.service.BridgeService.doSth()', 'c980ffff23245c9e2597f328e23cd865', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.service.BridgeService', 'doSth', 'public', 0), + (29, 1, 'public', 'com.example.demo.service.CglibProxyService.aspect()', 'd4088744fab4e0dbb2348af851b5a403', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.service.CglibProxyService', 'aspect', 'public', 0), + (30, 1, 'public', 'com.example.demo.controller.MyController.async()', 'd58f664b5f55a7e39f1967f2b6320750', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.controller.MyController', 'async', 'public', 0), + (31, 1, 'public', 'com.example.demo.service.AsyncService.asyncJob()', 'd91cd856cd539a7043908484ad57071e', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.service.AsyncService', 'asyncJob', 'public', 0), + (32, 1, 'public', 'com.example.demo.service.BridgeService.getAa()', 'df307489c08632b861aa0823de39e659', '2023-11-22 12:34:00.000000', + 1700624040000, 'com.example.demo.service.BridgeService', 'getAa', 'public', 0), + (33, 1, 'public', + 'com.example.demo.extmodel.MyExtensionModel.copy$default(com.example.demo.extmodel.MyExtensionModel,long,java.lang.String,int,java.lang.Object)', + 'e2441ce64049a2c6fede70110103c5ed', '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.extmodel.MyExtensionModel', 'copy$default', + 'public static', 0), + (34, 1, 'public', 'com.example.demo.additional.AdditionalService$WOW.doSth()', 'fd6ff5ca18bf9907470d4d406108d016', + '2023-11-22 12:34:00.000000', 1700624040000, 'com.example.demo.additional.AdditionalService$WOW', 'doSth', 'public final', 0); + +INSERT INTO invocations (id, customerid, applicationid, environmentid, signaturehash, invokedatmillis, status, + createdat, lastseenatmillis, timestamp) +VALUES (6, 1, 2, 1, '1100e1797bf09b292b25be2fc2278c71', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.437242', 1700624040000, '2023-11-22 12:34:29.437242'), + (7, 1, 2, 1, '1b3fdd577d38e12aca87e111a65c5c47', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.437438', 1700624040000, + '2023-11-22 12:34:48.815199'), + (8, 1, 2, 1, '2123fea886c3a62b00ae6672e810195b', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.437596', 1700624040000, + '2023-11-22 12:34:48.815409'), + (9, 1, 2, 1, '224a3427344bbb0c1a4900b33d1c2fc9', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.437698', 1700624040000, '2023-11-22 12:34:29.437698'), + (10, 1, 2, 1, '2659f4dce4c4b45d9dea4ffd8749d33', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.437796', 1700624040000, '2023-11-22 12:34:29.437796'), + (11, 1, 2, 1, '3078671bfc321a3dffe20434bce9ae84', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.437887', 1700624040000, '2023-11-22 12:34:29.437887'), + (12, 1, 2, 1, '3bbfc896c8ed885e944774c2e533470c', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.437994', 1700624040000, '2023-11-22 12:34:29.437994'), + (13, 1, 2, 1, '3f6839f89b2b442b64eb893d45e6a7f0', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.438086', 1700624040000, '2023-11-22 12:34:29.438086'), + (14, 1, 2, 1, '4f429976e181ebbffd9533fe78ee4737', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.438204', 1700624040000, + '2023-11-22 12:34:48.815524'), + (15, 1, 2, 1, '5076bea0344f39d6a845853b52ce7e0d', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.438323', 1700624040000, '2023-11-22 12:34:29.438323'), + (16, 1, 2, 1, '6f19e8ea1b061d5df5f49fe1445e2555', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.438413', 1700624040000, '2023-11-22 12:34:29.438413'), + (17, 1, 2, 1, '79f2e4c8eecadc37f8f5728860bae743', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.438512', 1700624040000, '2023-11-22 12:34:29.438512'), + (18, 1, 2, 1, '7dddc2b35169a2d066de22de21a88348', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.438616', 1700624040000, '2023-11-22 12:34:29.438616'), + (19, 1, 2, 1, '8c79ac2907f40e3d76afc1ea332a2221', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.438709', 1700624040000, + '2023-11-22 12:34:48.815631'), + (20, 1, 2, 1, '8f2622b0c18154eb598d3ce657176c28', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.438799', 1700624040000, '2023-11-22 12:34:29.438799'), + (21, 1, 2, 1, '8f5c5f028defb29c6a9b2e246bdf5162', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.438885', 1700624040000, '2023-11-22 12:34:29.438885'), + (22, 1, 2, 1, 'aa86ba4e330eb54aa890566e54ced5c2', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.438967', 1700624040000, + '2023-11-22 12:34:48.815737'), + (23, 1, 2, 1, 'ae9884b16ebcc7e8325479e5a48cc119', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.439051', 1700624040000, '2023-11-22 12:34:29.439051'), + (24, 1, 2, 1, 'b3e7e118770fe476e0faa67dce7c3143', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.439225', 1700624040000, '2023-11-22 12:34:29.439225'), + (25, 1, 2, 1, 'bc59fb9d12a87a9357f42d5e5ea81849', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.439316', 1700624040000, + '2023-11-22 12:34:48.815857'), + (26, 1, 2, 1, 'bea57f297361ef9dee6817799d770e26', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.439404', 1700624040000, + '2023-11-22 12:35:08.798885'), + (27, 1, 2, 1, 'c48c30b4fd1deff3bfd2deaebf9b9a8c', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.439514', 1700624040000, + '2023-11-22 12:34:48.815962'), + (28, 1, 2, 1, 'c92a85f6d5761f8bf64336d604e8edc6', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.439609', 1700624040000, + '2023-11-22 12:34:48.816064'), + (29, 1, 2, 1, 'c980ffff23245c9e2597f328e23cd865', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.439706', 1700624040000, + '2023-11-22 12:34:48.816174'), + (30, 1, 2, 1, 'd4088744fab4e0dbb2348af851b5a403', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.439814', 1700624040000, + '2023-11-22 12:34:48.816279'), + (31, 1, 2, 1, 'd58f664b5f55a7e39f1967f2b6320750', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.439900', 1700624040000, '2023-11-22 12:34:29.439900'), + (32, 1, 2, 1, 'd91cd856cd539a7043908484ad57071e', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.439982', 1700624040000, '2023-11-22 12:34:29.439982'), + (33, 1, 2, 1, 'df307489c08632b861aa0823de39e659', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.440069', 1700624040000, + '2023-11-22 12:34:48.816380'), + (34, 1, 2, 1, 'e2441ce64049a2c6fede70110103c5ed', 0, 'NOT_INVOKED', '2023-11-22 12:34:29.440152', 1700624040000, '2023-11-22 12:34:29.440152'), + (35, 1, 2, 1, 'fd6ff5ca18bf9907470d4d406108d016', 1700624040000, 'INVOKED', '2023-11-22 12:34:29.440230', 1700624040000, + '2023-11-22 12:34:48.816497'); + +INSERT INTO jvms (id, customerid, applicationid, applicationversion, environmentid, uuid, codebasefingerprint, + createdat, publishedat, hostname) +VALUES (2, 1, 2, 'unspecified', 1, '9421751b-456f-4c80-a7e3-b6fe0da16090', 'c8b9f2048be8cf919e563767d5213709f7cef5640d2f775c6a10b9b69d28be13', + '2023-11-22 12:34:17.745000', '2023-11-22 12:35:16.379000', 'AL02274006.local'); + +INSERT INTO snapshots (id, createdat, customerid, name, filterinvokedatmillis, packages, status, excludeabstract) +VALUES (3, '2023-11-22 12:35:03.571094', 1, 'demo2', 0, '', null, null); + +INSERT INTO snapshot_application (snapshotid, applicationid, customerid) +VALUES (3, 2, 1); + +INSERT INTO snapshot_environment (snapshotid, environmentid, customerid) +VALUES (3, 1, 1); + +INSERT INTO snapshot_nodes (id, snapshotid, signature, usedcount, unusedcount, parent, customerid, lastinvokedatmillis, + type) +VALUES (31, 3, 'com.example.demo.extmodel.MyExtensionModel.getId()', 0, 1, 'com.example.demo.extmodel.MyExtensionModel', 1, null, 'METHOD'), + (32, 3, 'com.example.demo.extmodel.MyExtensionModel.getName()', 0, 1, 'com.example.demo.extmodel.MyExtensionModel', 1, null, 'METHOD'), + (33, 3, 'com.example.demo.extmodel.MyExtensionModel.copy(long,java.lang.String)', 0, 1, 'com.example.demo.extmodel.MyExtensionModel', 1, null, + 'METHOD'), + (34, 3, 'com.example.demo.extmodel.MyExtensionModel.component2()', 0, 1, 'com.example.demo.extmodel.MyExtensionModel', 1, null, 'METHOD'), + (35, 3, 'com.example.demo.extmodel.MyExtensionModel.component1()', 0, 1, 'com.example.demo.extmodel.MyExtensionModel', 1, null, 'METHOD'), + (36, 3, 'com.example.demo.extmodel.MyExtensionModel.buildModels()', 1, 0, 'com.example.demo.extmodel.MyExtensionModel', 1, 1700624040000, + 'METHOD'), + (37, 3, + 'com.example.demo.extmodel.MyExtensionModel.copy$default(com.example.demo.extmodel.MyExtensionModel,long,java.lang.String,int,java.lang.Object)', + 0, 1, 'com.example.demo.extmodel.MyExtensionModel.copy', 1, null, 'METHOD'), + (38, 3, 'com.example.demo.extmodel.MyExtensionModel.copy', 0, 1, 'com.example.demo.extmodel.MyExtensionModel', 1, null, 'CLASS'), + (39, 3, 'com.example.demo.extmodel.MyExtensionModel.equals(java.lang.Object)', 0, 1, 'com.example.demo.extmodel.MyExtensionModel', 1, null, + 'METHOD'), + (40, 3, 'com.example.demo.extmodel.MyExtensionModel.hashCode()', 0, 1, 'com.example.demo.extmodel.MyExtensionModel', 1, null, 'METHOD'), + (41, 3, 'com.example.demo.extmodel.MyExtensionModel', 1, 8, 'com.example.demo.extmodel', 1, 1700624040000, 'CLASS'), + (42, 3, 'com.example.demo.extmodel', 1, 8, 'com.example.demo', 1, 1700624040000, 'PACKAGE'), + (43, 3, 'com.example.demo.BenchmarkController.getBenchmarkService()', 0, 1, 'com.example.demo.BenchmarkController', 1, null, 'METHOD'), + (44, 3, 'com.example.demo.BenchmarkController.benchmark()', 0, 1, 'com.example.demo.BenchmarkController', 1, null, 'METHOD'), + (45, 3, 'com.example.demo.BenchmarkController', 0, 2, 'com.example.demo', 1, null, 'CLASS'), + (46, 3, 'com.example.demo.controller.BaseController.base()', 0, 1, 'com.example.demo.controller.BaseController', 1, null, 'METHOD'), + (47, 3, 'com.example.demo.controller.BaseController', 0, 1, 'com.example.demo.controller', 1, null, 'CLASS'), + (48, 3, 'com.example.demo.controller.FeignController.getLocalApiClient()', 0, 1, 'com.example.demo.controller.FeignController', 1, null, + 'METHOD'), + (49, 3, 'com.example.demo.controller.FeignController.testFeign()', 0, 1, 'com.example.demo.controller.FeignController', 1, null, 'METHOD'), + (50, 3, 'com.example.demo.controller.FeignController.runFeignRun()', 0, 1, 'com.example.demo.controller.FeignController', 1, null, 'METHOD'), + (51, 3, 'com.example.demo.controller.FeignController', 0, 3, 'com.example.demo.controller', 1, null, 'CLASS'), + (52, 3, 'com.example.demo.controller.ExtensionController.runExtension()', 0, 1, 'com.example.demo.controller.ExtensionController', 1, null, + 'METHOD'), + (53, 3, 'com.example.demo.controller.ExtensionController', 0, 1, 'com.example.demo.controller', 1, null, 'CLASS'), + (54, 3, 'com.example.demo.controller.MyController$MyTest.nesting()', 1, 0, 'com.example.demo.controller.MyController$MyTest', 1, 1700624040000, + 'METHOD'), + (55, 3, 'com.example.demo.controller.MyController$MyTest', 1, 0, 'com.example.demo.controller.MyController', 1, 1700624040000, 'CLASS'), + (56, 3, 'com.example.demo.controller.MyController.hello()', 1, 0, 'com.example.demo.controller.MyController', 1, 1700624040000, 'METHOD'), + (57, 3, 'com.example.demo.controller.MyController.additional()', 1, 0, 'com.example.demo.controller.MyController', 1, 1700624040000, 'METHOD'), + (58, 3, 'com.example.demo.controller.MyController.async()', 0, 1, 'com.example.demo.controller.MyController', 1, null, 'METHOD'), + (59, 3, 'com.example.demo.controller.MyController', 3, 1, 'com.example.demo.controller', 1, 1700624040000, 'CLASS'), + (60, 3, 'com.example.demo.controller', 3, 6, 'com.example.demo', 1, 1700624040000, 'PACKAGE'), + (61, 3, 'com.example.demo.service.BridgeService.getAa()', 1, 0, 'com.example.demo.service.BridgeService', 1, 1700624040000, 'METHOD'), + (62, 3, 'com.example.demo.service.BridgeService.doSth()', 1, 0, 'com.example.demo.service.BridgeService', 1, 1700624040000, 'METHOD'), + (63, 3, 'com.example.demo.service.BridgeService', 2, 0, 'com.example.demo.service', 1, 1700624040000, 'CLASS'), + (64, 3, 'com.example.demo.service.CglibProxyService.aspect()', 1, 0, 'com.example.demo.service.CglibProxyService', 1, 1700624040000, 'METHOD'), + (65, 3, 'com.example.demo.service.CglibProxyService', 1, 0, 'com.example.demo.service', 1, 1700624040000, 'CLASS'), + (66, 3, 'com.example.demo.service.DynamicProxyServiceImpl.aspect()', 1, 0, 'com.example.demo.service.DynamicProxyServiceImpl', 1, + 1700624040000, 'METHOD'), + (67, 3, 'com.example.demo.service.DynamicProxyServiceImpl', 1, 0, 'com.example.demo.service', 1, 1700624040000, 'CLASS'), + (68, 3, 'com.example.demo.service.MyParentService.test()', 1, 0, 'com.example.demo.service.MyParentService', 1, 1700624040000, 'METHOD'), + (69, 3, 'com.example.demo.service.MyParentService', 1, 0, 'com.example.demo.service', 1, 1700624040000, 'CLASS'), + (70, 3, 'com.example.demo.service.AsyncService.asyncJob()', 0, 1, 'com.example.demo.service.AsyncService', 1, null, 'METHOD'), + (71, 3, 'com.example.demo.service.AsyncService', 0, 1, 'com.example.demo.service', 1, null, 'CLASS'), + (72, 3, 'com.example.demo.service', 5, 1, 'com.example.demo', 1, 1700624040000, 'PACKAGE'), + (73, 3, 'com.example.demo.additional.AdditionalService$WOW.doSth()', 1, 0, 'com.example.demo.additional.AdditionalService$WOW', 1, + 1700624040000, 'METHOD'), + (74, 3, 'com.example.demo.additional.AdditionalService$WOW', 1, 0, 'com.example.demo.additional.AdditionalService', 1, 1700624040000, 'CLASS'), + (75, 3, 'com.example.demo.additional.AdditionalService.get()', 1, 0, 'com.example.demo.additional.AdditionalService', 1, 1700624040000, + 'METHOD'), + (76, 3, 'com.example.demo.additional.AdditionalService', 2, 0, 'com.example.demo.additional', 1, 1700624040000, 'CLASS'), + (77, 3, 'com.example.demo.additional', 2, 0, 'com.example.demo', 1, 1700624040000, 'PACKAGE'), + (78, 3, 'com.example.demo.service2.TestService.call()', 1, 0, 'com.example.demo.service2.TestService', 1, 1700624040000, 'METHOD'), + (79, 3, 'com.example.demo.service2.TestService', 1, 0, 'com.example.demo.service2', 1, 1700624040000, 'CLASS'), + (80, 3, 'com.example.demo.service2', 1, 0, 'com.example.demo', 1, 1700624040000, 'PACKAGE'), + (81, 3, 'com.example.demo.BenchmarkService.doNothing(int)', 0, 1, 'com.example.demo.BenchmarkService', 1, null, 'METHOD'), + (82, 3, 'com.example.demo.BenchmarkService', 0, 1, 'com.example.demo', 1, null, 'CLASS'), + (83, 3, 'com.example.demo', 12, 18, '', 1, 1700624040000, 'PACKAGE'); diff --git a/settings.gradle.kts b/settings.gradle.kts index 59504c51..11a35035 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,3 +13,7 @@ include("scavenger-old-model") include("scavenger-demo") include("scavenger-demo-extension") include("scavenger-frontend") + +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version("0.7.0") +}