├── server ├── settings.gradle ├── .gitattributes ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── test │ │ └── java │ │ │ └── ygo │ │ │ └── traffic_hunter │ │ │ ├── AbstractTestConfiguration.java │ │ │ ├── persistence │ │ │ ├── jooq │ │ │ │ └── JooqQueryTest.java │ │ │ ├── mapper │ │ │ │ └── RowMapSupportTest.java │ │ │ └── impl │ │ │ │ └── TimeSeriesRepositoryTest.java │ │ │ ├── core │ │ │ ├── collector │ │ │ │ └── MetricCollectorTest.java │ │ │ └── assembler │ │ │ │ └── span │ │ │ │ └── SpanAssemblerTest.java │ │ │ ├── common │ │ │ └── web │ │ │ │ └── interceptor │ │ │ │ └── RequestPatternTest.java │ │ │ └── config │ │ │ └── cache │ │ │ └── CacheConfigTest.java │ ├── main │ │ ├── java │ │ │ └── ygo │ │ │ │ └── traffic_hunter │ │ │ │ ├── core │ │ │ │ ├── identification │ │ │ │ │ ├── SessionIdentification.java │ │ │ │ │ ├── Identification.java │ │ │ │ │ └── login │ │ │ │ │ │ └── LoginHandler.java │ │ │ │ ├── webhook │ │ │ │ │ ├── Webhook.java │ │ │ │ │ └── property │ │ │ │ │ │ └── WebHookProperties.java │ │ │ │ ├── alarm │ │ │ │ │ ├── Alarm.java │ │ │ │ │ ├── loss │ │ │ │ │ │ └── LossPreventionHooker.java │ │ │ │ │ ├── message │ │ │ │ │ │ └── SseMessage.java │ │ │ │ │ └── WebHookAlarm.java │ │ │ │ ├── send │ │ │ │ │ ├── AsyncSender.java │ │ │ │ │ └── ViewSender.java │ │ │ │ ├── dto │ │ │ │ │ ├── request │ │ │ │ │ │ ├── metadata │ │ │ │ │ │ │ ├── MetadataWrapper.java │ │ │ │ │ │ │ ├── AgentStatus.java │ │ │ │ │ │ │ └── AgentMetadata.java │ │ │ │ │ │ ├── systeminfo │ │ │ │ │ │ │ ├── cpu │ │ │ │ │ │ │ │ └── CpuStatusInfo.java │ │ │ │ │ │ │ ├── gc │ │ │ │ │ │ │ │ ├── collections │ │ │ │ │ │ │ │ │ └── GarbageCollectionTime.java │ │ │ │ │ │ │ │ └── GarbageCollectionStatusInfo.java │ │ │ │ │ │ │ ├── thread │ │ │ │ │ │ │ │ └── ThreadStatusInfo.java │ │ │ │ │ │ │ ├── runtime │ │ │ │ │ │ │ │ └── RuntimeStatusInfo.java │ │ │ │ │ │ │ ├── web │ │ │ │ │ │ │ │ └── tomcat │ │ │ │ │ │ │ │ │ ├── thread │ │ │ │ │ │ │ │ │ └── TomcatThreadPoolInfo.java │ │ │ │ │ │ │ │ │ ├── request │ │ │ │ │ │ │ │ │ └── TomcatRequestInfo.java │ │ │ │ │ │ │ │ │ └── TomcatWebServerInfo.java │ │ │ │ │ │ │ └── memory │ │ │ │ │ │ │ │ └── MemoryStatusInfo.java │ │ │ │ │ │ ├── statistics │ │ │ │ │ │ │ └── StatisticsRequest.java │ │ │ │ │ │ ├── transaction │ │ │ │ │ │ │ └── TransactionInfo.java │ │ │ │ │ │ ├── alarm │ │ │ │ │ │ │ └── AlarmThreshold.java │ │ │ │ │ │ └── member │ │ │ │ │ │ │ ├── SignIn.java │ │ │ │ │ │ │ ├── SignUp.java │ │ │ │ │ │ │ └── UpdateMember.java │ │ │ │ │ └── response │ │ │ │ │ │ ├── alarm │ │ │ │ │ │ ├── ActivationWebhook.java │ │ │ │ │ │ ├── DeadLetterResponse.java │ │ │ │ │ │ ├── AlarmResponse.java │ │ │ │ │ │ └── ThresholdResponse.java │ │ │ │ │ │ └── metric │ │ │ │ │ │ ├── MemoryMetricMeasurementResponse.java │ │ │ │ │ │ ├── CpuMetricMeasurementResponse.java │ │ │ │ │ │ ├── MemoryMetricUsageResponse.java │ │ │ │ │ │ ├── ThreadMetricMeasurementResponse.java │ │ │ │ │ │ ├── TomcatWebServerThreadPoolMeasurementResponse.java │ │ │ │ │ │ ├── TomcatWebServerRequestMeasurementResponse.java │ │ │ │ │ │ ├── TomcatWebServerMeasurementResponse.java │ │ │ │ │ │ └── MetricDataResponse.java │ │ │ │ ├── assembler │ │ │ │ │ └── Assembler.java │ │ │ │ ├── event │ │ │ │ │ └── channel │ │ │ │ │ │ ├── LogEvent.java │ │ │ │ │ │ ├── AlarmEvent.java │ │ │ │ │ │ ├── TransactionMetricEvent.java │ │ │ │ │ │ └── SystemInfoMetricEvent.java │ │ │ │ └── annotation │ │ │ │ │ ├── Member.java │ │ │ │ │ ├── Collector.java │ │ │ │ │ ├── Processor.java │ │ │ │ │ └── Validator.java │ │ │ │ ├── TrafficHunterApplication.java │ │ │ │ ├── common │ │ │ │ ├── util │ │ │ │ │ └── LoginUtils.java │ │ │ │ ├── aop │ │ │ │ │ └── lock │ │ │ │ │ │ ├── method │ │ │ │ │ │ └── LockMode.java │ │ │ │ │ │ └── Lock.java │ │ │ │ ├── exception │ │ │ │ │ └── UnauthorizedException.java │ │ │ │ └── map │ │ │ │ │ ├── AgentMapper.java │ │ │ │ │ └── LogMapper.java │ │ │ │ ├── domain │ │ │ │ ├── entity │ │ │ │ │ ├── user │ │ │ │ │ │ └── Role.java │ │ │ │ │ ├── alarm │ │ │ │ │ │ └── Alarm.java │ │ │ │ │ ├── LogMeasurement.java │ │ │ │ │ ├── MetricMeasurement.java │ │ │ │ │ └── TransactionMeasurement.java │ │ │ │ └── metric │ │ │ │ │ ├── gc │ │ │ │ │ ├── time │ │ │ │ │ │ └── GCMetricCollectionTime.java │ │ │ │ │ └── GCMetricMeasurement.java │ │ │ │ │ ├── cpu │ │ │ │ │ └── CpuMetricMeasurement.java │ │ │ │ │ ├── memory │ │ │ │ │ ├── usage │ │ │ │ │ │ └── MemoryMetricUsage.java │ │ │ │ │ └── MemoryMetricMeasurement.java │ │ │ │ │ ├── thread │ │ │ │ │ └── ThreadMetricMeasurement.java │ │ │ │ │ ├── web │ │ │ │ │ └── tomcat │ │ │ │ │ │ ├── thread │ │ │ │ │ │ └── TomcatWebServerThreadPoolMeasurement.java │ │ │ │ │ │ └── request │ │ │ │ │ │ └── TomcatWebServerRequestMeasurement.java │ │ │ │ │ └── runtime │ │ │ │ │ └── RuntimeMetricMeasurement.java │ │ │ │ └── config │ │ │ │ └── web │ │ │ │ └── webhook │ │ │ │ └── WebHookConfig.java │ │ └── resources │ │ │ └── application.yml │ └── docs │ │ └── asciidoc │ │ ├── api-guide.adoc │ │ ├── sse.adoc │ │ ├── alarm.adoc │ │ ├── statistics.adoc │ │ └── member.adoc ├── .gitignore └── Dockerfile ├── test-app ├── settings.gradle ├── src │ ├── main │ │ ├── java │ │ │ └── ygo │ │ │ │ └── testapp │ │ │ │ ├── dto │ │ │ │ └── TestDto.java │ │ │ │ ├── TestAppApplication.java │ │ │ │ ├── repository │ │ │ │ └── TestRepository.java │ │ │ │ ├── entity │ │ │ │ └── TestEntity.java │ │ │ │ └── controller │ │ │ │ └── TestControllerAdvice.java │ │ └── resources │ │ │ └── application.yml │ └── test │ │ └── java │ │ └── ygo │ │ └── testapp │ │ ├── TestAppApplicationTests.java │ │ └── service │ │ └── TestCallServiceTest.java ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore └── build.gradle ├── test-app2 ├── settings.gradle ├── .gitattributes ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── main │ │ ├── java │ │ │ └── ygo │ │ │ │ └── testapp2 │ │ │ │ ├── dto │ │ │ │ └── TestDto.java │ │ │ │ ├── TestApp2Application.java │ │ │ │ ├── repository │ │ │ │ └── TestRepository.java │ │ │ │ └── entity │ │ │ │ └── TestEntity.java │ │ └── resources │ │ │ └── application.yml │ └── test │ │ └── java │ │ └── ygo │ │ └── testapp2 │ │ └── TestApp2ApplicationTests.java ├── .gitignore └── build.gradle ├── java-apm-agent ├── versions.gradle.kts ├── plugin │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── servlet │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── org.traffichunter.javaagent.extension.AbstractPluginInstrumentation │ │ └── build.gradle.kts │ ├── jdbc │ │ ├── src │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ └── org │ │ │ │ │ │ └── traffichunter │ │ │ │ │ │ └── javaagent │ │ │ │ │ │ └── plugin │ │ │ │ │ │ └── jdbc │ │ │ │ │ │ └── util │ │ │ │ │ │ └── JdbcUtil.java │ │ │ │ └── resources │ │ │ │ │ └── META-INF │ │ │ │ │ └── services │ │ │ │ │ └── org.traffichunter.javaagent.extension.AbstractPluginInstrumentation │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── traffichunter │ │ │ │ └── javaagent │ │ │ │ └── plugin │ │ │ │ └── jdbc │ │ │ │ └── helper │ │ │ │ └── JdbcInformationParserTest.java │ │ └── build.gradle.kts │ ├── http-client │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── org.traffichunter.javaagent.extension.AbstractPluginInstrumentation │ │ └── build.gradle.kts │ ├── logback │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── org.traffichunter.javaagent.extension.AbstractPluginInstrumentation │ │ └── build.gradle.kts │ ├── logger │ │ ├── javaagent │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── resources │ │ │ │ │ └── META-INF │ │ │ │ │ └── services │ │ │ │ │ └── org.traffichunter.javaagent.extension.AbstractPluginInstrumentation │ │ │ └── build.gradle.kts │ │ ├── build.gradle.kts │ │ └── shaded-logging-module │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── traffichunter │ │ │ └── java │ │ │ └── util │ │ │ └── logging │ │ │ └── Logger.java │ ├── http-url-connection │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── org.traffichunter.javaagent.extension.AbstractPluginInstrumentation │ │ └── build.gradle.kts │ ├── spring-webmvc │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── org.traffichunter.javaagent.extension.AbstractPluginInstrumentation │ │ └── build.gradle.kts │ ├── spring-business │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── org.traffichunter.javaagent.extension.AbstractPluginInstrumentation │ │ └── build.gradle.kts │ ├── spring-auto-configure │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── spring │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── build.gradle.kts │ ├── hibernate │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── org.traffichunter.javaagent.extension.AbstractPluginInstrumentation │ └── build.gradle.kts ├── java-agent-jmx │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── traffichunter │ │ └── javaagent │ │ └── jmx │ │ └── metric │ │ ├── systeminfo │ │ ├── cpu │ │ │ └── CpuStatusInfo.java │ │ ├── thread │ │ │ └── ThreadStatusInfo.java │ │ ├── runtime │ │ │ └── RuntimeStatusInfo.java │ │ ├── memory │ │ │ └── MemoryStatusInfo.java │ │ └── gc │ │ │ └── GarbageCollectionStatusInfo.java │ │ └── web │ │ └── tomcat │ │ ├── thread │ │ └── TomcatThreadPoolInfo.java │ │ ├── request │ │ └── TomcatRequestInfo.java │ │ └── TomcatWebServerInfo.java ├── java-agent-event │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── traffichunter │ │ └── javaagent │ │ └── event │ │ └── listener │ │ └── AgentStateEventListener.java ├── java-agent-retry │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── traffichunter │ │ └── javaagent │ │ └── retry │ │ └── backoff │ │ └── policy │ │ └── FixedBackOffPolicy.java ├── java-agent-bootstrap │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle.kts │ └── src │ │ ├── test │ │ └── java │ │ │ └── org │ │ │ └── traffichunter │ │ │ └── javaagent │ │ │ └── bootstrap │ │ │ ├── ConfigurationsTest.java │ │ │ └── BootstrapLoggerTest.java │ │ └── main │ │ └── java │ │ └── org │ │ └── traffichunter │ │ └── javaagent │ │ └── bootstrap │ │ └── TrafficHunterAgentStarter.java ├── java-agent-commons │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── traffichunter │ │ └── javaagent │ │ └── commons │ │ ├── type │ │ └── MetricType.java │ │ └── status │ │ └── AgentStatus.java ├── java-agent-websocket │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── traffichunter │ │ └── javaagent │ │ └── websocket │ │ ├── property │ │ └── WebSocketRetryProperty.java │ │ └── metadata │ │ └── Metadata.java ├── build.gradle.kts ├── plugin-sdk │ ├── build.gradle.kts │ └── src │ │ ├── test │ │ └── java │ │ │ └── org │ │ │ └── traffichunter │ │ │ └── javaagent │ │ │ └── plugin │ │ │ └── sdk │ │ │ ├── instumentation │ │ │ └── SpanScopeTest.java │ │ │ └── CallDepthTest.java │ │ └── main │ │ └── java │ │ └── org │ │ └── traffichunter │ │ └── javaagent │ │ └── plugin │ │ └── sdk │ │ ├── constant │ │ └── GlobalTracerName.java │ │ └── instumentation │ │ └── SpanScope.java └── java-agent-extension │ ├── src │ └── main │ │ ├── resources │ │ └── agent-banner.txt │ │ └── java │ │ └── org │ │ └── traffichunter │ │ └── javaagent │ │ └── extension │ │ ├── loader │ │ └── PluginLoader.java │ │ └── metadata │ │ └── MetadataWrapper.java │ └── build.gradle.kts ├── doc └── image │ ├── log.png │ └── trace.jpeg ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .github ├── ISSUE_TEMPLATE │ ├── -fix--.md │ ├── -question-.md │ ├── -feat--issue.md │ └── -bug--issue.md ├── pull_request_template.md └── release-drafter-config.yml ├── .gitignore ├── .all-contributorsrc ├── LICENSE └── settings.gradle /server/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'server' -------------------------------------------------------------------------------- /test-app/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'test-app' 2 | -------------------------------------------------------------------------------- /test-app2/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'test-app2' 2 | -------------------------------------------------------------------------------- /java-apm-agent/versions.gradle.kts: -------------------------------------------------------------------------------- 1 | ext { 2 | AgentReleaseVersion = 'v1.1.0' 3 | } -------------------------------------------------------------------------------- /server/.gitattributes: -------------------------------------------------------------------------------- 1 | /gradlew text eol=lf 2 | *.bat text eol=crlf 3 | *.jar binary 4 | -------------------------------------------------------------------------------- /test-app2/.gitattributes: -------------------------------------------------------------------------------- 1 | /gradlew text eol=lf 2 | *.bat text eol=crlf 3 | *.jar binary 4 | -------------------------------------------------------------------------------- /doc/image/log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/doc/image/log.png -------------------------------------------------------------------------------- /doc/image/trace.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/doc/image/trace.jpeg -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /server/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/server/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /test-app/src/main/java/ygo/testapp/dto/TestDto.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp.dto; 2 | 3 | public record TestDto(String name, String email) { 4 | } 5 | -------------------------------------------------------------------------------- /test-app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/test-app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /test-app2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/test-app2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /test-app2/src/main/java/ygo/testapp2/dto/TestDto.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp2.dto; 2 | 3 | public record TestDto(String name, String email) { 4 | } 5 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/plugin/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/java-agent-jmx/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/plugin/servlet/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/plugin/servlet/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/java-agent-event/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/java-agent-event/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/java-agent-retry/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/java-agent-retry/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/plugin/jdbc/src/main/java/org/traffichunter/javaagent/plugin/jdbc/util/JdbcUtil.java: -------------------------------------------------------------------------------- 1 | package org.traffichunter.javaagent.plugin.jdbc.util; 2 | 3 | public class JdbcUtil { 4 | } 5 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-bootstrap/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/java-agent-bootstrap/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/java-agent-commons/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/java-agent-commons/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/java-agent-websocket/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/java-agent-websocket/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/plugin/http-client/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/plugin/http-client/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/plugin/logback/src/main/resources/META-INF/services/org.traffichunter.javaagent.extension.AbstractPluginInstrumentation: -------------------------------------------------------------------------------- 1 | org.traffichunter.javaagent.plugin.logback.LogbackPluginInstrumentation -------------------------------------------------------------------------------- /java-apm-agent/plugin/servlet/src/main/resources/META-INF/services/org.traffichunter.javaagent.extension.AbstractPluginInstrumentation: -------------------------------------------------------------------------------- 1 | org.traffichunter.javaagent.plugin.servlet.ServletPluginInstrumentation -------------------------------------------------------------------------------- /java-apm-agent/plugin/logger/javaagent/src/main/resources/META-INF/services/org.traffichunter.javaagent.extension.AbstractPluginInstrumentation: -------------------------------------------------------------------------------- 1 | org.traffichunter.javaagent.plugin.logger.LoggerPluginInstrumentation -------------------------------------------------------------------------------- /java-apm-agent/plugin/http-url-connection/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/traffic-hunter/traffic_hunter/HEAD/java-apm-agent/plugin/http-url-connection/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-apm-agent/plugin/spring-webmvc/src/main/resources/META-INF/services/org.traffichunter.javaagent.extension.AbstractPluginInstrumentation: -------------------------------------------------------------------------------- 1 | org.traffichunter.javaagent.plugin.spring.webmvc.SpringWebMvcInstrumentation -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/-fix--.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "[FIX] " 3 | about: fix bug. 4 | title: "[FIX]" 5 | labels: '' 6 | assignees: gusdn3477, GyeongHyeonKim, JuSeong1130, yungwangoh 7 | 8 | --- 9 | 10 | ## Description 11 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/http-url-connection/src/main/resources/META-INF/services/org.traffichunter.javaagent.extension.AbstractPluginInstrumentation: -------------------------------------------------------------------------------- 1 | org.traffichunter.javaagent.plugin.http.HttpUrlConnectionPluginInstrumentation -------------------------------------------------------------------------------- /java-apm-agent/plugin/spring-business/src/main/resources/META-INF/services/org.traffichunter.javaagent.extension.AbstractPluginInstrumentation: -------------------------------------------------------------------------------- 1 | org.traffichunter.javaagent.plugin.spring.business.SpringBusinessServiceInstrumentation -------------------------------------------------------------------------------- /java-apm-agent/plugin/spring-auto-configure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | org.traffichunter.plugin.spring.autoconfigure.rest.SpringWebInstrumentationAutoConfiguration -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/-question-.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "[QUESTION]" 3 | about: What question?? 4 | title: "[QUESTION]" 5 | labels: question 6 | assignees: gusdn3477, GyeongHyeonKim, JuSeong1130, yungwangoh 7 | 8 | --- 9 | 10 | ## Desription. 11 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/http-client/src/main/resources/META-INF/services/org.traffichunter.javaagent.extension.AbstractPluginInstrumentation: -------------------------------------------------------------------------------- 1 | org.traffichunter.javaagent.plugin.http.HttpClientPluginInstrumentation 2 | org.traffichunter.javaagent.plugin.http.HttpHeadersPluginInstrumentation -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/http-client/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | } 14 | 15 | tasks.test { 16 | useJUnitPlatform() 17 | } -------------------------------------------------------------------------------- /java-apm-agent/plugin/jdbc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin.jdbc" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | } 14 | 15 | tasks.test { 16 | useJUnitPlatform() 17 | } -------------------------------------------------------------------------------- /java-apm-agent/plugin/logger/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin" 6 | version = "0.0.1-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | } 14 | 15 | tasks.test { 16 | useJUnitPlatform() 17 | } -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jan 05 14:41:31 WIT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-retry/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jan 03 17:44:57 WIT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/servlet/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Mar 21 21:01:40 WIT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /server/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-bootstrap/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jan 04 15:36:22 WIT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-commons/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jan 04 15:00:11 WIT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-event/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jan 04 15:38:48 WIT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-websocket/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jan 03 18:36:40 WIT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/http-client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Mar 20 14:49:20 WIT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/http-url-connection/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | } 14 | 15 | tasks.test { 16 | useJUnitPlatform() 17 | } -------------------------------------------------------------------------------- /test-app/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /test-app/src/test/java/ygo/testapp/TestAppApplicationTests.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class TestAppApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test-app2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/-feat--issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "[FEAT] ISSUE" 3 | about: New feature issue. 4 | title: "[FEAT]" 5 | labels: enhancement 6 | assignees: gusdn3477, GyeongHyeonKim, JuSeong1130, yungwangoh 7 | 8 | --- 9 | 10 | ## Description. 11 | 12 | ## To do. 13 | 14 | - [ ] 15 | - [ ] 16 | 17 | ## Opinion list. 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/-bug--issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "[BUG] ISSUE" 3 | about: Bug issue. 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: gusdn3477, GyeongHyeonKim, JuSeong1130, yungwangoh 7 | 8 | --- 9 | 10 | ## Description 11 | 12 | ## Reason. 13 | - [ ] 14 | 15 | ## Trouble shooting. 16 | - [ ] 17 | 18 | ## Opinion. 19 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/http-url-connection/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Mar 19 16:09:24 WIT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/logger/shaded-logging-module/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin" 6 | version = "0.0.1-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | } 14 | 15 | tasks.test { 16 | useJUnitPlatform() 17 | } -------------------------------------------------------------------------------- /java-apm-agent/plugin/spring-business/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin.spring.business" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | } 14 | 15 | tasks.test { 16 | useJUnitPlatform() 17 | } -------------------------------------------------------------------------------- /test-app2/src/test/java/ygo/testapp2/TestApp2ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp2; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class TestApp2ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java-apm-agent/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent" 6 | version = "0.0.1-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | } 14 | 15 | tasks.jar { 16 | enabled = false 17 | } 18 | 19 | tasks.test { 20 | useJUnitPlatform() 21 | } -------------------------------------------------------------------------------- /server/src/test/java/ygo/traffic_hunter/AbstractTestConfiguration.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter; 2 | 3 | import org.junit.jupiter.api.DisplayNameGeneration; 4 | import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; 5 | 6 | @DisplayNameGeneration(ReplaceUnderscores.class) 7 | public abstract class AbstractTestConfiguration { 8 | } 9 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/logback/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin" 6 | version = "0.0.1-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | compileOnly("ch.qos.logback:logback-classic:1.5.0") 14 | } 15 | 16 | tasks.test { 17 | useJUnitPlatform() 18 | } -------------------------------------------------------------------------------- /java-apm-agent/plugin/servlet/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | compileOnly("jakarta.servlet:jakarta.servlet-api:6.0.0") 14 | } 15 | 16 | tasks.test { 17 | useJUnitPlatform() 18 | } -------------------------------------------------------------------------------- /java-apm-agent/plugin/hibernate/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin.hibernate" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | compileOnly("org.hibernate.orm:hibernate-core:6.0.0.Final") 14 | } 15 | 16 | tasks.test { 17 | useJUnitPlatform() 18 | } -------------------------------------------------------------------------------- /java-apm-agent/plugin/logger/javaagent/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin" 6 | version = "0.0.1-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | compileOnly(project(":java-apm-agent:plugin:logger:shaded-logging-module")) 14 | } 15 | 16 | tasks.test { 17 | useJUnitPlatform() 18 | } -------------------------------------------------------------------------------- /test-app/src/main/java/ygo/testapp/TestAppApplication.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TestAppApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TestAppApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/jdbc/src/main/resources/META-INF/services/org.traffichunter.javaagent.extension.AbstractPluginInstrumentation: -------------------------------------------------------------------------------- 1 | org.traffichunter.javaagent.plugin.jdbc.StatementPluginInstrumentation 2 | org.traffichunter.javaagent.plugin.jdbc.ConnectionPluginInstrumentation 3 | org.traffichunter.javaagent.plugin.jdbc.PrepareStatementPluginInstrumentation 4 | org.traffichunter.javaagent.plugin.jdbc.DriverPluginInstrumentation -------------------------------------------------------------------------------- /test-app2/src/main/java/ygo/testapp2/TestApp2Application.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp2; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TestApp2Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TestApp2Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-commons/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.commons" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testImplementation(platform("org.junit:junit-bom:5.10.0")) 14 | testImplementation("org.junit.jupiter:junit-jupiter") 15 | } 16 | 17 | tasks.test { 18 | useJUnitPlatform() 19 | } -------------------------------------------------------------------------------- /test-app/src/main/java/ygo/testapp/repository/TestRepository.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp.repository; 2 | 3 | import java.util.Optional; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import ygo.testapp.entity.TestEntity; 6 | 7 | public interface TestRepository extends JpaRepository { 8 | 9 | Optional findByName(String name); 10 | Optional findByEmail(String email); 11 | } 12 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/hibernate/src/main/resources/META-INF/services/org.traffichunter.javaagent.extension.AbstractPluginInstrumentation: -------------------------------------------------------------------------------- 1 | org.traffichunter.javaagent.plugin.hibernate.HibernateQueryInstrumentation 2 | org.traffichunter.javaagent.plugin.hibernate.HibernateSessionFactoryInstrumentation 3 | org.traffichunter.javaagent.plugin.hibernate.HibernateSessionInstrumentation 4 | org.traffichunter.javaagent.plugin.hibernate.HibernateTransactionInstrumentation -------------------------------------------------------------------------------- /java-apm-agent/plugin/spring-webmvc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin.spring-webmvc" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | compileOnly("org.springframework:spring-webmvc:6.2.0") 14 | compileOnly("jakarta.servlet:jakarta.servlet-api:6.0.0") 15 | } 16 | 17 | tasks.test { 18 | useJUnitPlatform() 19 | } -------------------------------------------------------------------------------- /test-app2/src/main/java/ygo/testapp2/repository/TestRepository.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp2.repository; 2 | 3 | import java.util.Optional; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import ygo.testapp2.entity.TestEntity; 6 | 7 | public interface TestRepository extends JpaRepository { 8 | 9 | Optional findByName(String name); 10 | Optional findByEmail(String email); 11 | } 12 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/identification/SessionIdentification.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.core.identification; 2 | 3 | /** 4 | * @author JuSeong 5 | * @version 1.1.0 6 | */ 7 | 8 | public class SessionIdentification extends Identification { 9 | 10 | public SessionIdentification() { 11 | super(); 12 | } 13 | 14 | public SessionIdentification(final String id) { 15 | super(id); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /test-app/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoints: 3 | jmx: 4 | exposure: 5 | include: "*" 6 | 7 | server: 8 | tomcat: 9 | mbeanregistry: 10 | enabled: true 11 | 12 | spring: 13 | datasource: 14 | hikari: 15 | register-mbeans: true 16 | url: jdbc:h2:mem:test 17 | driver-class-name: org.h2.Driver 18 | username: sa 19 | password: 20 | tomcat: 21 | jmx-enabled: true 22 | 23 | jmx: 24 | unique-names: true 25 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-commons/src/main/java/org/traffichunter/javaagent/commons/type/MetricType.java: -------------------------------------------------------------------------------- 1 | package org.traffichunter.javaagent.commons.type; 2 | 3 | public enum MetricType { 4 | SYSTEM_METRIC((byte) 1), 5 | TRANSACTION_METRIC((byte) 2), 6 | LOG_METRIC((byte) 3), 7 | ; 8 | 9 | private final byte value; 10 | 11 | MetricType(final byte value) { 12 | this.value = value; 13 | } 14 | 15 | public byte getValue() { 16 | return value; 17 | } 18 | } -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.jmx" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testImplementation(platform("org.junit:junit-bom:5.10.0")) 14 | testImplementation("org.junit.jupiter:junit-jupiter") 15 | 16 | implementation(project(":java-apm-agent:java-agent-commons")) 17 | } 18 | 19 | tasks.test { 20 | useJUnitPlatform() 21 | } -------------------------------------------------------------------------------- /java-apm-agent/java-agent-bootstrap/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.bootstrap" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testImplementation(platform("org.junit:junit-bom:5.10.0")) 14 | testImplementation("org.junit.jupiter:junit-jupiter") 15 | 16 | implementation(project(":java-apm-agent:plugin-sdk")) 17 | } 18 | 19 | tasks.test { 20 | useJUnitPlatform() 21 | } -------------------------------------------------------------------------------- /java-apm-agent/java-agent-event/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.event" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testImplementation(platform("org.junit:junit-bom:5.10.0")) 14 | testImplementation("org.junit.jupiter:junit-jupiter") 15 | 16 | implementation(project(":java-apm-agent:java-agent-commons")) 17 | } 18 | 19 | tasks.test { 20 | useJUnitPlatform() 21 | } -------------------------------------------------------------------------------- /java-apm-agent/java-agent-retry/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.retry" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testImplementation(platform("org.junit:junit-bom:5.10.0")) 14 | testImplementation("org.junit.jupiter:junit-jupiter") 15 | 16 | implementation("io.github.resilience4j:resilience4j-retry:2.2.0") 17 | } 18 | 19 | tasks.test { 20 | useJUnitPlatform() 21 | } -------------------------------------------------------------------------------- /server/src/docs/asciidoc/api-guide.adoc: -------------------------------------------------------------------------------- 1 | ifndef::snippets[] 2 | :snippets: ../../../build/generated-snippets 3 | endif::[] 4 | :doctype: book 5 | :icons: font 6 | :source-highlighter: highlightjs 7 | :toc: left 8 | :toclevels: 2 9 | :sectlinks: 10 | :operation-http-request-title: Request 11 | :operation-http-response-title: Response 12 | 13 | [[Traffic-hunter-API]] 14 | = Traffic-hunter-API docs 15 | 16 | include::statistics.adoc[] 17 | include::sse.adoc[] 18 | include::member.adoc[] 19 | include::alarm.adoc[] 20 | 21 | -------------------------------------------------------------------------------- /test-app2/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoints: 3 | jmx: 4 | exposure: 5 | include: "*" 6 | 7 | server: 8 | tomcat: 9 | mbeanregistry: 10 | enabled: true 11 | port: 8081 12 | 13 | spring: 14 | datasource: 15 | hikari: 16 | register-mbeans: true 17 | url: jdbc:h2:mem:test 18 | driver-class-name: org.h2.Driver 19 | username: sa 20 | password: 21 | tomcat: 22 | jmx-enabled: true 23 | 24 | jmx: 25 | unique-names: true 26 | -------------------------------------------------------------------------------- /server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9100 3 | 4 | spring: 5 | datasource: 6 | driver-class-name: org.postgresql.Driver 7 | username: ${USER_NAME} 8 | password: ${PASSWORD} 9 | url: jdbc:postgresql://${DB_IP}/${DB_NAME} 10 | 11 | sql: 12 | init: 13 | mode: always 14 | schema-locations: classpath:schema.sql 15 | separator: ;; 16 | 17 | jooq: 18 | sql-dialect: postgres 19 | 20 | webhook: 21 | discord-url: ${DISCORD_WEB_HOOK_URL:} 22 | slack-url: ${SLACK_WEB_HOOK_URL:} 23 | 24 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-bootstrap/src/test/java/org/traffichunter/javaagent/bootstrap/ConfigurationsTest.java: -------------------------------------------------------------------------------- 1 | package org.traffichunter.javaagent.bootstrap; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertFalse; 4 | 5 | import org.junit.jupiter.api.Test; 6 | import org.traffichunter.javaagent.bootstrap.Configurations.ConfigProperty; 7 | 8 | class ConfigurationsTest { 9 | 10 | @Test 11 | void banner_mode_no_property() { 12 | 13 | boolean banner = Configurations.banner(ConfigProperty.BANNER_MODE); 14 | 15 | assertFalse(banner); 16 | } 17 | } -------------------------------------------------------------------------------- /java-apm-agent/plugin-sdk/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin.plugin-sdk" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testImplementation(platform("org.junit:junit-bom:5.10.0")) 14 | testImplementation("org.junit.jupiter:junit-jupiter") 15 | 16 | implementation("io.opentelemetry:opentelemetry-api:1.45.0") 17 | implementation("io.opentelemetry:opentelemetry-api-incubator:1.45.0-alpha") 18 | } 19 | 20 | tasks.test { 21 | useJUnitPlatform() 22 | } -------------------------------------------------------------------------------- /server/src/docs/asciidoc/sse.adoc: -------------------------------------------------------------------------------- 1 | [[ServerSentEvent-API]] 2 | = ServerSentEvent-API 3 | 4 | [[success]] 5 | == Success 6 | 7 | === GET /metrics/subscribe 8 | 9 | operation::metrics-subscribe[snippets='http-request,http-response'] 10 | 11 | === POST /metrics/broadcast/{interval} 12 | 13 | operation::metrics-broadcast[snippets='http-request,query-parameters,path-parameters,http-response,response-fields'] 14 | 15 | [[failed]] 16 | == Failed 17 | 18 | === POST /metrics/broadcast/{interval} 19 | 20 | operation::400-error-service-transaction[snippets='curl-request,http-request,http-response'] 21 | 22 | -------------------------------------------------------------------------------- /server/src/test/java/ygo/traffic_hunter/persistence/jooq/JooqQueryTest.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.persistence.jooq; 2 | 3 | import org.jooq.DSLContext; 4 | import org.junit.jupiter.api.Test; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import ygo.traffic_hunter.AbstractTestConfiguration; 8 | 9 | @SpringBootTest 10 | class JooqQueryTest extends AbstractTestConfiguration { 11 | 12 | @Autowired 13 | private DSLContext dsl; 14 | 15 | @Test 16 | void jooq_query_test() { 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Overview. 2 | 3 | 4 | 5 | ## Pull Request Convention. 6 | 7 | - [ ] New feature. (feat) 8 | - [ ] Fix bug. (fix) 9 | - [ ] Changes that do not affect the code (correct typos, change tab size, change variable names) (style) 10 | - [ ] Refactor code (refactor) 11 | - [ ] Add and edit comments (style) 12 | - [ ] Edit docs (docs) 13 | - [ ] Add and refactor tests (test) 14 | - [ ] Edit the build part or package manager (chore) 15 | - [ ] Rename file or directory (rename) 16 | - [ ] Remove file or directory (remove) 17 | 18 | ## Opinion. -------------------------------------------------------------------------------- /java-apm-agent/java-agent-bootstrap/src/test/java/org/traffichunter/javaagent/bootstrap/BootstrapLoggerTest.java: -------------------------------------------------------------------------------- 1 | package org.traffichunter.javaagent.bootstrap; 2 | 3 | import org.junit.jupiter.api.DisplayNameGeneration; 4 | import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; 5 | import org.junit.jupiter.api.Test; 6 | 7 | @DisplayNameGeneration(ReplaceUnderscores.class) 8 | class BootstrapLoggerTest { 9 | 10 | @Test 11 | void bootstrap_logger_print() { 12 | 13 | BootstrapLogger log = BootstrapLogger.getLogger(BootstrapLogger.class); 14 | 15 | log.info("info {}"); 16 | } 17 | } -------------------------------------------------------------------------------- /server/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | bin/ 17 | !**/src/main/**/bin/ 18 | !**/src/test/**/bin/ 19 | 20 | ### IntelliJ IDEA ### 21 | .idea 22 | *.iws 23 | *.iml 24 | *.ipr 25 | out/ 26 | !**/src/main/**/out/ 27 | !**/src/test/**/out/ 28 | 29 | ### NetBeans ### 30 | /nbproject/private/ 31 | /nbbuild/ 32 | /dist/ 33 | /nbdist/ 34 | /.nb-gradle/ 35 | 36 | ### VS Code ### 37 | .vscode/ 38 | -------------------------------------------------------------------------------- /test-app/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | bin/ 17 | !**/src/main/**/bin/ 18 | !**/src/test/**/bin/ 19 | 20 | ### IntelliJ IDEA ### 21 | .idea 22 | *.iws 23 | *.iml 24 | *.ipr 25 | out/ 26 | !**/src/main/**/out/ 27 | !**/src/test/**/out/ 28 | 29 | ### NetBeans ### 30 | /nbproject/private/ 31 | /nbbuild/ 32 | /dist/ 33 | /nbdist/ 34 | /.nb-gradle/ 35 | 36 | ### VS Code ### 37 | .vscode/ 38 | -------------------------------------------------------------------------------- /test-app2/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | bin/ 17 | !**/src/main/**/bin/ 18 | !**/src/test/**/bin/ 19 | 20 | ### IntelliJ IDEA ### 21 | .idea 22 | *.iws 23 | *.iml 24 | *.ipr 25 | out/ 26 | !**/src/main/**/out/ 27 | !**/src/test/**/out/ 28 | 29 | ### NetBeans ### 30 | /nbproject/private/ 31 | /nbbuild/ 32 | /dist/ 33 | /nbdist/ 34 | /.nb-gradle/ 35 | 36 | ### VS Code ### 37 | .vscode/ 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | bin/ 17 | !**/src/main/**/bin/ 18 | !**/src/test/**/bin/ 19 | 20 | ### IntelliJ IDEA ### 21 | .idea 22 | *.iws 23 | *.iml 24 | *.ipr 25 | out/ 26 | !**/src/main/**/out/ 27 | !**/src/test/**/out/ 28 | 29 | ### NetBeans ### 30 | /nbproject/private/ 31 | /nbbuild/ 32 | /dist/ 33 | /nbdist/ 34 | /.nb-gradle/ 35 | 36 | ### VS Code ### 37 | .vscode/ 38 | gradle.properties 39 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/TrafficHunterApplication.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.context.properties.ConfigurationPropertiesScan; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | @EnableScheduling 9 | @SpringBootApplication 10 | @ConfigurationPropertiesScan 11 | public class TrafficHunterApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(TrafficHunterApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /.github/release-drafter-config.yml: -------------------------------------------------------------------------------- 1 | name-template: 'v$RESOLVED_VERSION' 2 | tag-template: 'v$RESOLVED_VERSION' 3 | categories: 4 | - title: 'Features' 5 | label: 'enhancement' 6 | - title: 'Fixes' 7 | label: 'bug' 8 | - title: 'Etcetera' 9 | label: 'documentation' 10 | change-template: '- $TITLE #$NUMBER @$AUTHOR ' 11 | template: | 12 | ## The changes in this version are as follows. 13 | --- 14 | $CHANGES 15 | no-changes-template: 'No changes' 16 | version-resolver: 17 | major: 18 | labels: 19 | - '✨ major' 20 | minor: 21 | labels: 22 | - '✨ minor' 23 | patch: 24 | labels: 25 | - '✨ patch' 26 | default: patch 27 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-extension/src/main/resources/agent-banner.txt: -------------------------------------------------------------------------------- 1 | _____ ___________________ ______ _____ 2 | __ /_____________ ___ __/__ __/__(_)______ ___ /_____ __________ /_____________ 3 | _ __/_ ___/ __ `/_ /_ __ /_ __ /_ ___/ __ __ \ / / /_ __ \ __/ _ \_ ___/ 4 | / /_ _ / / /_/ /_ __/ _ __/ _ / / /__ _ / / / /_/ /_ / / / /_ / __/ / 5 | \__/ /_/ \__,_/ /_/ /_/ /_/ \___/ /_/ /_/\__,_/ /_/ /_/\__/ \___//_/ 6 | 7 | :: Traffic Hunter ${version} Ver :: 8 | :: Made by traffic-hunter :: 9 | :: Running on Java ${java.version} :: 10 | :: JDK Information ${jdk} ${java.specification} :: 11 | :: Started on ${time} :: -------------------------------------------------------------------------------- /java-apm-agent/plugin/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | subprojects { 13 | apply(plugin = "java") 14 | 15 | dependencies { 16 | testImplementation(platform("org.junit:junit-bom:5.10.0")) 17 | testImplementation("org.junit.jupiter:junit-jupiter") 18 | 19 | implementation(project(":java-apm-agent:java-agent-extension")) 20 | compileOnly(project(":java-apm-agent:plugin-sdk")) 21 | 22 | compileOnly("net.bytebuddy:byte-buddy:1.15.5") 23 | compileOnly("io.opentelemetry:opentelemetry-api:1.45.0") 24 | } 25 | } 26 | 27 | tasks.test { 28 | useJUnitPlatform() 29 | } -------------------------------------------------------------------------------- /test-app/src/main/java/ygo/testapp/entity/TestEntity.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp.entity; 2 | 3 | import jakarta.persistence.Column; 4 | import jakarta.persistence.Entity; 5 | import jakarta.persistence.GeneratedValue; 6 | import jakarta.persistence.Id; 7 | import lombok.AccessLevel; 8 | import lombok.Getter; 9 | import lombok.NoArgsConstructor; 10 | 11 | @Entity 12 | @NoArgsConstructor(access = AccessLevel.PROTECTED) 13 | @Getter 14 | public class TestEntity { 15 | 16 | @Id @GeneratedValue 17 | private Long id; 18 | 19 | @Column(name = "name") 20 | private String name; 21 | 22 | @Column(name = "email") 23 | private String email; 24 | 25 | public TestEntity(final String name, final String email) { 26 | this.name = name; 27 | this.email = email; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test-app2/src/main/java/ygo/testapp2/entity/TestEntity.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp2.entity; 2 | 3 | import jakarta.persistence.Column; 4 | import jakarta.persistence.Entity; 5 | import jakarta.persistence.GeneratedValue; 6 | import jakarta.persistence.Id; 7 | import lombok.AccessLevel; 8 | import lombok.Getter; 9 | import lombok.NoArgsConstructor; 10 | 11 | @Entity 12 | @NoArgsConstructor(access = AccessLevel.PROTECTED) 13 | @Getter 14 | public class TestEntity { 15 | 16 | @Id @GeneratedValue 17 | private Long id; 18 | 19 | @Column(name = "name") 20 | private String name; 21 | 22 | @Column(name = "email") 23 | private String email; 24 | 25 | public TestEntity(final String name, final String email) { 26 | this.name = name; 27 | this.email = email; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test-app/src/test/java/ygo/testapp/service/TestCallServiceTest.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp.service; 2 | 3 | import static org.junit.jupiter.api.Assertions.*; 4 | 5 | import java.util.List; 6 | import org.junit.jupiter.api.Test; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | import org.springframework.http.ResponseEntity; 10 | import ygo.testapp.service.TestCallService.Dto; 11 | 12 | /** 13 | * @author yungwang-o 14 | * @version 1.1.0 15 | */ 16 | @SpringBootTest 17 | class TestCallServiceTest { 18 | 19 | @Autowired 20 | private TestCallService testCallService; 21 | 22 | @Test 23 | void test() { 24 | ResponseEntity> test = testCallService.test(); 25 | 26 | System.out.println(test.getBody()); 27 | } 28 | } -------------------------------------------------------------------------------- /server/src/test/java/ygo/traffic_hunter/core/collector/MetricCollectorTest.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.core.collector; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import java.util.Set; 6 | import org.junit.jupiter.api.Test; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | import ygo.traffic_hunter.AbstractTestConfiguration; 10 | import ygo.traffic_hunter.core.collector.channel.MetricChannel; 11 | 12 | /** 13 | * @author yungwang-o 14 | * @version 1.1.0 15 | */ 16 | @SpringBootTest 17 | class MetricCollectorTest extends AbstractTestConfiguration { 18 | 19 | @Autowired 20 | private Set metricChannels; 21 | 22 | @Test 23 | void 채널의_개수를_확인한다_metric_trace_log() { 24 | 25 | assertThat(metricChannels).hasSize(3); 26 | } 27 | } -------------------------------------------------------------------------------- /java-apm-agent/java-agent-websocket/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.websocket" 6 | version = "1.0-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testImplementation(platform("org.junit:junit-bom:5.10.0")) 14 | testImplementation("org.junit.jupiter:junit-jupiter") 15 | 16 | implementation(project(":java-apm-agent:java-agent-retry")) 17 | implementation(project(":java-apm-agent:java-agent-commons")) 18 | 19 | implementation("org.java-websocket:Java-WebSocket:1.5.7") 20 | implementation("com.fasterxml.jackson.core:jackson-databind:2.18.0") 21 | implementation("com.fasterxml.jackson.core:jackson-core:2.18.0") 22 | implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.0") 23 | } 24 | 25 | tasks.test { 26 | useJUnitPlatform() 27 | } -------------------------------------------------------------------------------- /server/Dockerfile: -------------------------------------------------------------------------------- 1 | # Base image for building 2 | FROM bellsoft/liberica-openjdk-alpine:21.0.4 AS build 3 | 4 | # Set the working directory 5 | WORKDIR /app 6 | 7 | # Copy the Gradle wrapper and settings files 8 | COPY gradlew settings.gradle build.gradle ./ 9 | COPY gradle ./gradle 10 | 11 | # Copy the source code 12 | COPY src ./src 13 | 14 | # Grant execution permissions for the Gradle wrapper 15 | RUN chmod +x ./gradlew 16 | 17 | # Run the build 18 | RUN ./gradlew build --exclude-task test 19 | 20 | # Base image for running 21 | FROM bellsoft/liberica-openjdk-alpine:21.0.4 22 | 23 | # Copy the built JAR from the build stage 24 | COPY --from=build /app/build/libs/*.jar /app/server.jar 25 | 26 | # Author label 27 | LABEL authors="Traffic-Hunter" 28 | 29 | # Expose the port the app runs on 30 | EXPOSE 9100 31 | 32 | # Command to run the application 33 | ENTRYPOINT ["java", "-jar", "/app/server.jar"] -------------------------------------------------------------------------------- /test-app/src/main/java/ygo/testapp/controller/TestControllerAdvice.java: -------------------------------------------------------------------------------- 1 | package ygo.testapp.controller; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.ErrorResponse; 5 | import org.springframework.web.bind.annotation.ExceptionHandler; 6 | import org.springframework.web.bind.annotation.ResponseStatus; 7 | import org.springframework.web.bind.annotation.RestController; 8 | import org.springframework.web.bind.annotation.RestControllerAdvice; 9 | import org.springframework.web.server.ServerErrorException; 10 | 11 | @RestControllerAdvice(annotations = RestController.class) 12 | public class TestControllerAdvice { 13 | 14 | @ExceptionHandler(RuntimeException.class) 15 | @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) 16 | public ErrorResponse handleRuntimeException(RuntimeException e) { 17 | return new ServerErrorException(e.getMessage(), e); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/identification/Identification.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.core.identification; 2 | 3 | import java.util.Objects; 4 | import java.util.UUID; 5 | import lombok.Getter; 6 | 7 | @Getter 8 | public class Identification { 9 | 10 | private final String id; 11 | 12 | protected Identification() { 13 | this.id = UUID.randomUUID().toString(); 14 | } 15 | 16 | protected Identification(final String id) { 17 | this.id = id; 18 | } 19 | 20 | @Override 21 | public boolean equals(final Object o) { 22 | if (this == o) { 23 | return true; 24 | } 25 | if (!(o instanceof Identification that)) { 26 | return false; 27 | } 28 | return Objects.equals(id, that.id); 29 | } 30 | 31 | @Override 32 | public int hashCode() { 33 | return Objects.hashCode(id); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java-apm-agent/plugin-sdk/src/test/java/org/traffichunter/javaagent/plugin/sdk/instumentation/SpanScopeTest.java: -------------------------------------------------------------------------------- 1 | package org.traffichunter.javaagent.plugin.sdk.instumentation; 2 | 3 | import static org.junit.jupiter.api.Assertions.*; 4 | 5 | import io.opentelemetry.api.trace.Span; 6 | import io.opentelemetry.context.Scope; 7 | import org.junit.jupiter.api.Assertions; 8 | import org.junit.jupiter.api.DisplayNameGeneration; 9 | import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; 10 | import org.junit.jupiter.api.Test; 11 | 12 | /** 13 | * @author yungwang-o 14 | * @version 1.1.0 15 | */ 16 | @DisplayNameGeneration(ReplaceUnderscores.class) 17 | class SpanScopeTest { 18 | 19 | @Test 20 | void is_check_span_scope_equal_span_scope_noop() { 21 | 22 | SpanScope noop = SpanScope.NOOP; 23 | SpanScope spanScope = SpanScope.create(Span.current(), Scope.noop()); 24 | 25 | Assertions.assertEquals(noop, spanScope); 26 | } 27 | } -------------------------------------------------------------------------------- /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "commitType": "docs", 8 | "commitConvention": "angular", 9 | "contributors": [ 10 | { 11 | "login": "JuSeong1130", 12 | "name": "JuSeong1130", 13 | "avatar_url": "https://avatars.githubusercontent.com/u/53209324?v=4", 14 | "profile": "https://github.com/JuSeong1130", 15 | "contributions": [ 16 | "code" 17 | ] 18 | }, 19 | { 20 | "login": "yungwangoh", 21 | "name": "윤광오", 22 | "avatar_url": "https://avatars.githubusercontent.com/u/37898720?v=4", 23 | "profile": "https://velog.io/@swager253", 24 | "contributions": [ 25 | "code", 26 | "infra", 27 | "doc" 28 | ] 29 | } 30 | ], 31 | "contributorsPerLine": 7, 32 | "skipCi": true, 33 | "repoType": "github", 34 | "repoHost": "https://github.com", 35 | "projectName": "traffic_hunter", 36 | "projectOwner": "traffic-hunter" 37 | } 38 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/spring-auto-configure/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.plugin.spring" 6 | version = "0.0.1-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | val springBootVersion = "3.2.0" 13 | 14 | dependencies { 15 | compileOnly("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion") 16 | annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor:$springBootVersion") 17 | annotationProcessor("org.springframework.boot:spring-boot-configuration-processor:$springBootVersion") 18 | 19 | compileOnly("org.springframework:spring-webmvc:6.2.0") 20 | 21 | testImplementation("org.springframework.boot:spring-boot-starter-test:$springBootVersion") 22 | testImplementation("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion") 23 | testImplementation("org.springframework:spring-webmvc:6.2.0") 24 | } 25 | 26 | tasks.test { 27 | useJUnitPlatform() 28 | } -------------------------------------------------------------------------------- /test-app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'org.springframework.boot' version '3.3.4' 4 | id 'io.spring.dependency-management' version '1.1.6' 5 | } 6 | 7 | group = 'ygo' 8 | version = '0.0.1-SNAPSHOT' 9 | 10 | java { 11 | toolchain { 12 | languageVersion = JavaLanguageVersion.of(21) 13 | } 14 | } 15 | 16 | repositories { 17 | mavenCentral() 18 | } 19 | 20 | dependencies { 21 | implementation 'org.springframework.boot:spring-boot-starter' 22 | implementation 'org.springframework.boot:spring-boot-starter-web' 23 | implementation 'org.springframework.boot:spring-boot-starter-actuator' 24 | implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 25 | implementation 'org.projectlombok:lombok' 26 | annotationProcessor 'org.projectlombok:lombok' 27 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 28 | runtimeOnly 'com.h2database:h2' 29 | testRuntimeOnly 'org.junit.platform:junit-platform-launcher' 30 | } 31 | 32 | tasks.named('test') { 33 | useJUnitPlatform() 34 | } 35 | -------------------------------------------------------------------------------- /test-app2/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'org.springframework.boot' version '3.3.6' 4 | id 'io.spring.dependency-management' version '1.1.6' 5 | } 6 | 7 | group = 'ygo' 8 | version = '0.0.1-SNAPSHOT' 9 | 10 | java { 11 | toolchain { 12 | languageVersion = JavaLanguageVersion.of(21) 13 | } 14 | } 15 | 16 | repositories { 17 | mavenCentral() 18 | } 19 | 20 | dependencies { 21 | implementation 'org.springframework.boot:spring-boot-starter' 22 | implementation 'org.springframework.boot:spring-boot-starter-web' 23 | implementation 'org.springframework.boot:spring-boot-starter-actuator' 24 | implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 25 | implementation 'org.projectlombok:lombok' 26 | annotationProcessor 'org.projectlombok:lombok' 27 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 28 | runtimeOnly 'com.h2database:h2' 29 | testRuntimeOnly 'org.junit.platform:junit-platform-launcher' 30 | } 31 | 32 | tasks.named('test') { 33 | useJUnitPlatform() 34 | } 35 | -------------------------------------------------------------------------------- /server/src/docs/asciidoc/alarm.adoc: -------------------------------------------------------------------------------- 1 | [[Alarm-API]] 2 | = Alarm API 3 | 4 | [[Success]] 5 | == Success 6 | 7 | === GET /alarms/threshold 8 | 9 | operation::alarm/get-threshold[snippets='curl-request,http-request,http-response,response-body,response-fields'] 10 | 11 | === PUT /alarms/threshold 12 | 13 | operation::alarm/update-threshold[snippets='curl-request,http-request,http-response,request-body,request-fields'] 14 | 15 | === GET /alarms/webhook/activation 16 | 17 | operation::alarm/get-webhook[snippets='curl-request,http-request,http-response,response-body,response-fields'] 18 | 19 | === GET /alarms/webhook/{webhook}/enable 20 | 21 | operation::alarm/webhook-enable[snippets='curl-request,http-request,http-response,path-parameters'] 22 | 23 | === GET /alarms/webhook/{webhook}/disable 24 | 25 | operation::alarm/webhook-disable[snippets='curl-request,http-request,http-response,path-parameters'] 26 | 27 | [[Failed]] 28 | == Failed 29 | 30 | === PUT /alarms/threshold 31 | 32 | operation::alarm/failed-update-threshold[snippets='curl-request,http-request,http-response,request-body,response-body'] -------------------------------------------------------------------------------- /server/src/test/java/ygo/traffic_hunter/common/web/interceptor/RequestPatternTest.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.common.web.interceptor; 2 | 3 | import org.assertj.core.api.Assertions; 4 | import org.junit.jupiter.api.Test; 5 | import org.springframework.http.HttpMethod; 6 | import ygo.traffic_hunter.AbstractTestConfiguration; 7 | 8 | /** 9 | * @author JuSeong 10 | * @version 1.1.0 11 | */ 12 | class RequestPatternTest extends AbstractTestConfiguration { 13 | 14 | @Test 15 | void 요청_주소가_일치한다면_True() { 16 | 17 | // given 18 | RequestPattern requestPattern = new RequestPattern("/members/**", HttpMethod.POST); 19 | 20 | //when & then 21 | Assertions.assertThat(requestPattern.match("/members/check", HttpMethod.POST)).isTrue(); 22 | } 23 | 24 | @Test 25 | void 요청_주소가_일치하지않으면_False() { 26 | 27 | // given 28 | RequestPattern requestPattern = new RequestPattern("/members/**", HttpMethod.POST); 29 | 30 | //when & then 31 | Assertions.assertThat(requestPattern.match("/metrics/check", HttpMethod.POST)).isFalse(); 32 | } 33 | } -------------------------------------------------------------------------------- /server/src/test/java/ygo/traffic_hunter/persistence/mapper/RowMapSupportTest.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.persistence.mapper; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import com.fasterxml.jackson.core.JsonProcessingException; 6 | import com.fasterxml.jackson.databind.ObjectMapper; 7 | import java.util.List; 8 | import org.junit.jupiter.api.Test; 9 | import ygo.traffic_hunter.AbstractTestConfiguration; 10 | 11 | class RowMapSupportTest extends AbstractTestConfiguration { 12 | 13 | @Test 14 | void 역직렬화를_테스트한다() throws JsonProcessingException { 15 | 16 | ObjectMapper objectMapper = new ObjectMapper(); 17 | 18 | RowMapSupport support = new RowMapSupport<>(objectMapper); 19 | 20 | List strings = List.of("banana", "apple", "orange"); 21 | 22 | String json = objectMapper.writeValueAsString(strings); 23 | 24 | List result = support.deserializeList(json, String.class); 25 | 26 | for (int i = 0; i < strings.size(); i++) { 27 | assertThat(strings.get(i)).isEqualTo(result.get(i)); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2024 yungwang-o 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'traffic_hunter' 2 | 3 | // agent 4 | include(':java-apm-agent') 5 | include(':java-apm-agent:java-agent') 6 | include(':java-apm-agent:plugin') 7 | include(':java-apm-agent:plugin:logger:javaagent') 8 | include(':java-apm-agent:plugin:logger:shaded-logging-module') 9 | include(':java-apm-agent:plugin:logback') 10 | include(':java-apm-agent:plugin-sdk') 11 | include(':java-apm-agent:plugin:http-client') 12 | include(':java-apm-agent:plugin:http-url-connection') 13 | include(':java-apm-agent:plugin:spring-auto-configure') 14 | include(':java-apm-agent:plugin:spring-webmvc') 15 | include(':java-apm-agent:plugin:spring-business') 16 | include(':java-apm-agent:plugin:hibernate') 17 | include(':java-apm-agent:plugin:servlet') 18 | include(':java-apm-agent:plugin:jdbc') 19 | include(':java-apm-agent:java-agent-extension') 20 | include(':java-apm-agent:java-agent-retry') 21 | include(':java-apm-agent:java-agent-websocket') 22 | include(':java-apm-agent:java-agent-commons') 23 | include(':java-apm-agent:java-agent-bootstrap') 24 | include(':java-apm-agent:java-agent-event') 25 | include(':java-apm-agent:java-agent-jmx') 26 | 27 | // server 28 | include(':server') 29 | 30 | -------------------------------------------------------------------------------- /server/src/test/java/ygo/traffic_hunter/config/cache/CacheConfigTest.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.config.cache; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import com.github.benmanes.caffeine.cache.Cache; 6 | import com.github.benmanes.caffeine.cache.Caffeine; 7 | import java.util.concurrent.TimeUnit; 8 | import org.junit.jupiter.api.DisplayNameGeneration; 9 | import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; 10 | import org.junit.jupiter.api.Test; 11 | 12 | @DisplayNameGeneration(ReplaceUnderscores.class) 13 | class CacheConfigTest { 14 | 15 | @Test 16 | void caffeine_cache_expire_test_no_schedule() throws InterruptedException { 17 | 18 | String key = "k"; 19 | String value = "v"; 20 | 21 | Cache cache = Caffeine.newBuilder() 22 | .expireAfterWrite(1, TimeUnit.SECONDS) 23 | .build(); 24 | 25 | for(int i = 1; i <= 100; i++) { 26 | cache.put(key + i, value); 27 | } 28 | 29 | assertThat(cache.estimatedSize()).isEqualTo(100); 30 | Thread.sleep(2000); 31 | assertThat(cache.estimatedSize()).isEqualTo(100); 32 | } 33 | } -------------------------------------------------------------------------------- /server/src/docs/asciidoc/statistics.adoc: -------------------------------------------------------------------------------- 1 | [[Statstics-API]] 2 | = Statistics-API 3 | 4 | [[success]] 5 | == Success 6 | 7 | === GET /statistics/transaction 8 | 9 | operation::service-transaction[snippets='curl-request,http-request,query-parameters,request-fields,http-response,response-fields'] 10 | 11 | === GET /statistics/transaction/{traceId} 12 | 13 | operation::service-transaction-detail[] 14 | 15 | === GET /statistics/metric/max 16 | 17 | operation::retrieve-max-metric[snippets='curl-request,http-request,path-parameters,request-body,http-response,response-fields,response-body'] 18 | 19 | === GET /statistics/metric/avg 20 | 21 | operation::retrieve-avg-metric[snippets='curl-request,http-request,path-parameters,request-body,http-response,response-fields,response-body'] 22 | 23 | [[failed]] 24 | == Failed 25 | 26 | === GET /statistics/transaction 27 | 28 | operation::400-error-service-transaction[snippets='curl-request,http-request,http-response'] 29 | 30 | === GET /statistics/metric/max 31 | 32 | operation::400-error-retrieve-max-metric[snippets='curl-request,http-request,http-response'] 33 | 34 | === GET /statistics/metric/avg 35 | 36 | operation::400-error-retrieve-avg-metric[snippets='curl-request,http-request,http-response'] -------------------------------------------------------------------------------- /java-apm-agent/java-agent-extension/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | } 4 | 5 | group = "org.traffichunter.javaagent.extension" 6 | version = "0.0.1-SNAPSHOT" 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testImplementation(platform("org.junit:junit-bom:5.10.0")) 14 | testImplementation("org.junit.jupiter:junit-jupiter") 15 | 16 | implementation(project(":java-apm-agent:java-agent-retry")) 17 | implementation(project(":java-apm-agent:java-agent-bootstrap")) 18 | implementation(project(":java-apm-agent:java-agent-websocket")) 19 | implementation(project(":java-apm-agent:java-agent-event")) 20 | implementation(project(":java-apm-agent:java-agent-commons")) 21 | implementation(project(":java-apm-agent:java-agent-jmx")) 22 | 23 | compileOnly(project(":java-apm-agent:plugin-sdk")) 24 | 25 | compileOnly("io.opentelemetry:opentelemetry-api:1.45.0") 26 | implementation("io.opentelemetry:opentelemetry-sdk:1.45.0") 27 | implementation("io.opentelemetry:opentelemetry-exporter-zipkin:1.45.0") 28 | implementation("org.yaml:snakeyaml:2.3") 29 | implementation("net.bytebuddy:byte-buddy:1.15.5") 30 | } 31 | 32 | tasks.test { 33 | useJUnitPlatform() 34 | } -------------------------------------------------------------------------------- /java-apm-agent/plugin-sdk/src/test/java/org/traffichunter/javaagent/plugin/sdk/CallDepthTest.java: -------------------------------------------------------------------------------- 1 | package org.traffichunter.javaagent.plugin.sdk; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | /** 8 | * @author yungwang-o 9 | * @version 1.1.0 10 | */ 11 | class CallDepthTest { 12 | 13 | @Test 14 | void same_class_call_depth_inc_test() { 15 | 16 | CallDepth callDepth = CallDepth.forClass(String.class); 17 | callDepth.getAndIncrement(); 18 | 19 | CallDepth callDepth2 = CallDepth.forClass(String.class); 20 | callDepth2.getAndIncrement(); 21 | 22 | assertEquals(callDepth.getDepth(), 2); 23 | } 24 | 25 | @Test 26 | void not_the_same_class_call_depth_inc_test() { 27 | 28 | CallDepth callDepth = CallDepth.forClass(String.class); 29 | callDepth.getAndIncrement(); 30 | 31 | CallDepth callDepth2 = CallDepth.forClass(Integer.class); 32 | callDepth2.getAndIncrement(); 33 | 34 | int sum = callDepth.getDepth() + callDepth2.getDepth(); 35 | assertEquals(sum, 2); 36 | assertEquals(callDepth.getDepth(), 1); 37 | assertEquals(callDepth2.getDepth(), 1); 38 | } 39 | } -------------------------------------------------------------------------------- /server/src/test/java/ygo/traffic_hunter/persistence/impl/TimeSeriesRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.persistence.impl; 2 | 3 | import java.time.Instant; 4 | import java.util.UUID; 5 | import org.junit.jupiter.api.AfterEach; 6 | import org.junit.jupiter.api.Disabled; 7 | import org.junit.jupiter.api.Test; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | import ygo.traffic_hunter.AbstractTestConfiguration; 11 | import ygo.traffic_hunter.domain.entity.Agent; 12 | 13 | @SpringBootTest 14 | @Disabled 15 | class TimeSeriesRepositoryTest extends AbstractTestConfiguration { 16 | 17 | @Autowired 18 | private TimeSeriesRepository timeSeriesRepository; 19 | 20 | @AfterEach 21 | void init() { 22 | timeSeriesRepository.clear(); 23 | } 24 | 25 | @Test 26 | void 에이전트가_DB에_저장되는지_확인한다() { 27 | // given 28 | 29 | String agentId = UUID.randomUUID().toString(); 30 | String agentName = "test"; 31 | String agentVersion = "1.0.0"; 32 | Instant agentBootTime = Instant.now(); 33 | 34 | // when 35 | Agent agent = Agent.create(agentId, agentName, agentVersion, agentBootTime); 36 | 37 | // then 38 | timeSeriesRepository.save(agent); 39 | } 40 | } -------------------------------------------------------------------------------- /server/src/docs/asciidoc/member.adoc: -------------------------------------------------------------------------------- 1 | [[Member-API]] 2 | = Member API 3 | 4 | [[success]] 5 | == Success 6 | 7 | === POST /members 8 | 9 | operation::members/sign-up[snippets='curl-request,http-request,http-response,request-body,request-fields'] 10 | 11 | === GET /members 12 | 13 | operation::members/get-member[snippets='curl-request,http-request,path-parameters,request-body,response-body,response-fields'] 14 | 15 | === GET /members/\{id} 16 | 17 | operation::members/get-members[snippets=''] 18 | 19 | === POST /members/sign-in 20 | 21 | operation::members/sign-in[snippets=''] 22 | 23 | === POST /members/sign-out 24 | 25 | operation::members/sign-out[snippets='curl-request,http-request,http-response'] 26 | 27 | === PUT /members 28 | 29 | operation::members/update[snippets='curl-request,http-request,http-response,request-body,request-fields,request-headers'] 30 | 31 | === DELETE /members 32 | 33 | operation::members/delete[snippets='curl-request,http-request,http-response,request-headers'] 34 | 35 | [[Failed]] 36 | 37 | == Failed 38 | 39 | === GET /members/\{id} 40 | 41 | operation::members/failed-get-member[snippets='curl-request,http-request,http-response,response-body'] 42 | 43 | === POST /members 44 | 45 | operation::members/failed-sign-up[snippets='curl-request,http-request,http-response,request-body,response-body'] 46 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/jdbc/src/test/java/org/traffichunter/javaagent/plugin/jdbc/helper/JdbcInformationParserTest.java: -------------------------------------------------------------------------------- 1 | package org.traffichunter.javaagent.plugin.jdbc.helper; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import java.util.regex.Matcher; 6 | import java.util.regex.Pattern; 7 | import org.junit.jupiter.api.DisplayNameGeneration; 8 | import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; 9 | import org.junit.jupiter.api.Test; 10 | 11 | @DisplayNameGeneration(ReplaceUnderscores.class) 12 | class JdbcInformationParserTest { 13 | 14 | @Test 15 | void jdbc_url을_파싱한다() { 16 | 17 | String jdbcUrl = "jdbc:mysql://localhost:3306/test?user=admin&password=1234&serverTimezone=UTC&useSSL=false";; 18 | 19 | String regex = "jdbc:(\\w+):\\/\\/([^:/]+)(?::(\\d+))?\\/(\\w+)"; 20 | Pattern pattern = Pattern.compile(regex); 21 | Matcher matcher = pattern.matcher(jdbcUrl); 22 | 23 | if(matcher.find()) { 24 | String dbms = matcher.group(1); 25 | String host = matcher.group(2); 26 | String port = matcher.group(3); 27 | String database = matcher.group(4); 28 | 29 | assertEquals(dbms, "mysql"); 30 | assertEquals(host, "localhost"); 31 | assertEquals(port, "3306"); 32 | assertEquals(database, "test"); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/webhook/Webhook.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | *

4 | * Copyright (c) 2024 traffic-hunter.org 5 | *

6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | *

11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 12 | * Software. 13 | *

14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 15 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | package ygo.traffic_hunter.core.webhook; 20 | 21 | /** 22 | * @author yungwang-o 23 | * @version 1.1.0 24 | */ 25 | public enum Webhook { 26 | SLACK, 27 | DISCORD 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/common/util/LoginUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.common.util; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.1.0 29 | */ 30 | public enum LoginUtils { 31 | SESSION_ID; 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/alarm/Alarm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.alarm; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.1.0 29 | */ 30 | public interface Alarm { 31 | 32 | boolean isActive(); 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/entity/user/Role.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.entity.user; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.1.0 29 | */ 30 | public enum Role { 31 | ADMIN, 32 | USER; 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/send/AsyncSender.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.send; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.1.0 29 | */ 30 | public interface AsyncSender { 31 | 32 | void asyncSend(T data); 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/metadata/MetadataWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | *

4 | * Copyright (c) 2024 traffic-hunter.org 5 | *

6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | *

11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 12 | * Software. 13 | *

14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 15 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | package ygo.traffic_hunter.core.dto.request.metadata; 20 | 21 | /** 22 | * @author yungwang-o 23 | * @version 1.0.0 24 | */ 25 | public record MetadataWrapper(AgentMetadata metadata, D data) { 26 | } 27 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/assembler/Assembler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.assembler; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.1.0 29 | */ 30 | public interface Assembler { 31 | 32 | RES assemble(REQ request); 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/metadata/AgentStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | *

4 | * Copyright (c) 2024 traffic-hunter.org 5 | *

6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | *

11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 12 | * Software. 13 | *

14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 15 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | package ygo.traffic_hunter.core.dto.request.metadata; 20 | 21 | /** 22 | * @author yungwang-o 23 | * @version 1.0.0 24 | */ 25 | public enum AgentStatus { 26 | INITIALIZED, 27 | RUNNING, 28 | EXIT 29 | } 30 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/common/aop/lock/method/LockMode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.common.aop.lock.method; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public enum LockMode { 31 | WRITE, 32 | READ, 33 | NORMAL 34 | ; 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/alarm/loss/LossPreventionHooker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.alarm.loss; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.1.0 29 | */ 30 | public interface LossPreventionHooker { 31 | 32 | void hook(T lossData); 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/alarm/message/SseMessage.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.core.alarm.message; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import lombok.Builder; 5 | import ygo.traffic_hunter.core.alarm.message.Message.Embed; 6 | 7 | import java.time.Instant; 8 | import java.util.List; 9 | 10 | @Builder 11 | public record SseMessage( 12 | Instant timestamp, 13 | String title, 14 | int color, 15 | String username, 16 | List fields, 17 | @JsonIgnore Message message 18 | ) { 19 | 20 | public static SseMessage from(final Message message) { 21 | 22 | Embed embed = message.embeds().getFirst(); 23 | 24 | return SseMessage.builder() 25 | .timestamp(message.timestamp()) 26 | .title(embed.title()) 27 | .color(embed.color()) 28 | .username(message.username()) 29 | .fields(convertFields(embed.fields())) 30 | .message(message) 31 | .build(); 32 | } 33 | 34 | private static List convertFields(final List fields) { 35 | return fields.stream() 36 | .map(Field::from) 37 | .toList(); 38 | 39 | } 40 | 41 | public record Field(String title, String value) { 42 | 43 | public static Field from(final Message.Field field) { 44 | return new Field(field.name(), field.value()); 45 | } 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-commons/src/main/java/org/traffichunter/javaagent/commons/status/AgentStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.commons.status; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public enum AgentStatus { 31 | INITIALIZED, 32 | RUNNING, 33 | EXIT 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/alarm/ActivationWebhook.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | *

4 | * Copyright (c) 2024 traffic-hunter.org 5 | *

6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | *

11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 12 | * Software. 13 | *

14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 15 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | package ygo.traffic_hunter.core.dto.response.alarm; 20 | 21 | import ygo.traffic_hunter.core.webhook.Webhook; 22 | 23 | /** 24 | * @author yungwang-o 25 | * @version 1.1.0 26 | */ 27 | public record ActivationWebhook(Webhook webhook, boolean isActive) { 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/metric/MemoryMetricMeasurementResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.metric; 25 | 26 | /** 27 | * @author JuSeong 28 | * @version 1.1.0 29 | */ 30 | public record MemoryMetricMeasurementResponse(MemoryMetricUsageResponse heapMemoryUsage) { 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/systeminfo/cpu/CpuStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.systeminfo.cpu; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record CpuStatusInfo(double systemCpuLoad, double processCpuLoad, long availableProcessors) { 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/metric/gc/time/GCMetricCollectionTime.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.metric.gc.time; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record GCMetricCollectionTime( 31 | long getCollectionCount, 32 | long getCollectionTime 33 | ) { 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/alarm/DeadLetterResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.alarm; 25 | 26 | import ygo.traffic_hunter.core.alarm.message.Message; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.1.0 31 | */ 32 | public record DeadLetterResponse(Long id, Message message) { 33 | } 34 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/src/main/java/org/traffichunter/javaagent/jmx/metric/systeminfo/cpu/CpuStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.jmx.metric.systeminfo.cpu; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record CpuStatusInfo(double systemCpuLoad, double processCpuLoad, long availableProcessors) { 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/statistics/StatisticsRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | *

4 | * Copyright (c) 2024 traffic-hunter.org 5 | *

6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | *

11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 12 | * Software. 13 | *

14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 15 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | package ygo.traffic_hunter.core.dto.request.statistics; 20 | 21 | import jakarta.validation.constraints.NotNull; 22 | import java.time.Instant; 23 | 24 | /** 25 | * @author yungwang-o 26 | * @version 1.1.0 27 | */ 28 | public record StatisticsRequest(@NotNull Instant begin, Instant end) { 29 | } 30 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/metric/cpu/CpuMetricMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.metric.cpu; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record CpuMetricMeasurement( 31 | double systemCpuLoad, 32 | double processCpuLoad, 33 | long availableProcessors 34 | ) { 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/common/exception/UnauthorizedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.common.exception; 25 | 26 | /** 27 | * @author JuSeong 28 | * @version 1.1.0 29 | */ 30 | public class UnauthorizedException extends RuntimeException { 31 | 32 | public UnauthorizedException(String message) { 33 | super(message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/systeminfo/gc/collections/GarbageCollectionTime.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.systeminfo.gc.collections; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record GarbageCollectionTime( 31 | long getCollectionCount, 32 | long getCollectionTime 33 | ) { 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/alarm/WebHookAlarm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.alarm; 25 | 26 | import ygo.traffic_hunter.core.webhook.Webhook; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.1.0 31 | */ 32 | public interface WebHookAlarm extends Alarm { 33 | 34 | Webhook getWebhook(); 35 | 36 | void enable(); 37 | 38 | void disable(); 39 | } 40 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/systeminfo/thread/ThreadStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.systeminfo.thread; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record ThreadStatusInfo( 31 | int threadCount, 32 | int getPeekThreadCount, 33 | long getTotalStartThreadCount 34 | ) { 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/metric/CpuMetricMeasurementResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.metric; 25 | 26 | /** 27 | * @author JuSeong 28 | * @version 1.1.0 29 | */ 30 | public record CpuMetricMeasurementResponse( 31 | double systemCpuLoad, 32 | double processCpuLoad, 33 | long availableProcessors 34 | ) { 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/metric/memory/usage/MemoryMetricUsage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.metric.memory.usage; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record MemoryMetricUsage( 31 | 32 | long init, 33 | 34 | long used, 35 | 36 | long committed, 37 | 38 | long max 39 | ) { 40 | } 41 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/metric/MemoryMetricUsageResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.metric; 25 | 26 | /** 27 | * @author JuSeong 28 | * @version 1.1.0 29 | */ 30 | public record MemoryMetricUsageResponse( 31 | long init, 32 | 33 | long used, 34 | 35 | long committed, 36 | 37 | long max 38 | ) { 39 | } 40 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/metric/thread/ThreadMetricMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.metric.thread; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record ThreadMetricMeasurement( 31 | 32 | int threadCount, 33 | 34 | int getPeekThreadCount, 35 | 36 | long getTotalStartThreadCount 37 | ) { 38 | } 39 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/common/map/AgentMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.common.map; 25 | 26 | import ygo.traffic_hunter.core.dto.request.metadata.AgentMetadata; 27 | import ygo.traffic_hunter.domain.entity.Agent; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public interface AgentMapper { 34 | 35 | Agent map(AgentMetadata metadata); 36 | } 37 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/event/channel/LogEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.event.channel; 25 | 26 | import ygo.traffic_hunter.core.dto.request.metadata.MetadataWrapper; 27 | import ygo.traffic_hunter.domain.metric.LogRecord; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.1.0 32 | */ 33 | public record LogEvent(MetadataWrapper logRecord) { 34 | } 35 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-extension/src/main/java/org/traffichunter/javaagent/extension/loader/PluginLoader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.extension.loader; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.1.0 31 | * @param

plugin module. 32 | */ 33 | public interface PluginLoader

{ 34 | 35 | List

loadModules(ClassLoader classLoader); 36 | } 37 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/src/main/java/org/traffichunter/javaagent/jmx/metric/web/tomcat/thread/TomcatThreadPoolInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.jmx.metric.web.tomcat.thread; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record TomcatThreadPoolInfo( 31 | int maxThreads, 32 | int currentThreads, 33 | int currentThreadsBusy 34 | ) { 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/systeminfo/runtime/RuntimeStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.systeminfo.runtime; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record RuntimeStatusInfo( 31 | long getStartTime, 32 | long getUpTime, 33 | String getVmName, 34 | String getVmVersion 35 | ) { 36 | } 37 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/systeminfo/web/tomcat/thread/TomcatThreadPoolInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.systeminfo.web.tomcat.thread; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record TomcatThreadPoolInfo( 31 | int maxThreads, 32 | int currentThreads, 33 | int currentThreadsBusy 34 | ) { 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/metric/ThreadMetricMeasurementResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.metric; 25 | 26 | /** 27 | * @author JuSeong 28 | * @version 1.1.0 29 | */ 30 | public record ThreadMetricMeasurementResponse( 31 | int threadCount, 32 | 33 | int getPeekThreadCount, 34 | 35 | long getTotalStartThreadCount 36 | ) { 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/entity/alarm/Alarm.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.entity.alarm; 25 | 26 | import java.time.Instant; 27 | import ygo.traffic_hunter.core.alarm.message.Message; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.1.0 32 | */ 33 | public record Alarm( 34 | Instant time, 35 | Message message, 36 | Integer agent_id 37 | ) { 38 | } 39 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/metric/gc/GCMetricMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.metric.gc; 25 | 26 | import java.util.List; 27 | import ygo.traffic_hunter.domain.metric.gc.time.GCMetricCollectionTime; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public record GCMetricMeasurement(List gcMetricCollectionTimes) { 34 | } 35 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/src/main/java/org/traffichunter/javaagent/jmx/metric/systeminfo/thread/ThreadStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.jmx.metric.systeminfo.thread; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record ThreadStatusInfo( 31 | int threadCount, 32 | int getPeekThreadCount, 33 | long getTotalStartThreadCount 34 | ) { 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/metric/TomcatWebServerThreadPoolMeasurementResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.metric; 25 | 26 | /** 27 | * @author JuSeong 28 | * @version 1.1.0 29 | */ 30 | public record TomcatWebServerThreadPoolMeasurementResponse( 31 | int maxThreads, 32 | int currentThreads, 33 | int currentThreadsBusy 34 | ) { 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/webhook/property/WebHookProperties.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.webhook.property; 25 | 26 | import org.springframework.boot.context.properties.ConfigurationProperties; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.1.0 31 | */ 32 | @ConfigurationProperties("webhook") 33 | public record WebHookProperties(String discordUrl, String slackUrl) { 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/metric/web/tomcat/thread/TomcatWebServerThreadPoolMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.metric.web.tomcat.thread; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record TomcatWebServerThreadPoolMeasurement( 31 | int maxThreads, 32 | int currentThreads, 33 | int currentThreadsBusy 34 | ) { 35 | } 36 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-websocket/src/main/java/org/traffichunter/javaagent/websocket/property/WebSocketRetryProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.websocket.property; 25 | 26 | import org.traffichunter.javaagent.retry.backoff.BackOffPolicy; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.1.0 31 | */ 32 | public record WebSocketRetryProperty(BackOffPolicy backOffPolicy, int maxAttempt) { 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/event/channel/AlarmEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.event.channel; 25 | 26 | import ygo.traffic_hunter.core.dto.request.metadata.MetadataWrapper; 27 | import ygo.traffic_hunter.core.dto.request.systeminfo.SystemInfo; 28 | 29 | /** 30 | * @author JuSeong 31 | * @version 1.1.0 32 | */ 33 | public record AlarmEvent(MetadataWrapper systemInfo) { 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/metric/runtime/RuntimeMetricMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.metric.runtime; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record RuntimeMetricMeasurement( 31 | 32 | long getStartTime, 33 | 34 | long getUpTime, 35 | 36 | String getVmName, 37 | 38 | String getVmVersion 39 | ) { 40 | } 41 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/src/main/java/org/traffichunter/javaagent/jmx/metric/systeminfo/runtime/RuntimeStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.jmx.metric.systeminfo.runtime; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record RuntimeStatusInfo( 31 | long getStartTime, 32 | long getUpTime, 33 | String getVmName, 34 | String getVmVersion 35 | ) { 36 | } 37 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/metadata/AgentMetadata.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | *

4 | * Copyright (c) 2024 traffic-hunter.org 5 | *

6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | *

11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 12 | * Software. 13 | *

14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 15 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | package ygo.traffic_hunter.core.dto.request.metadata; 20 | 21 | import java.time.Instant; 22 | 23 | /** 24 | * @author yungwang-o 25 | * @version 1.0.0 26 | */ 27 | public record AgentMetadata( 28 | String agentId, 29 | String agentVersion, 30 | String agentName, 31 | Instant startTime, 32 | AgentStatus status 33 | ) { 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/systeminfo/memory/MemoryStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.systeminfo.memory; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record MemoryStatusInfo(MemoryUsage heapMemoryUsage, MemoryUsage nonHeapMemoryUsage) { 31 | 32 | public record MemoryUsage(long init, long used, long committed, long max) {} 33 | } 34 | 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/alarm/AlarmResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.alarm; 25 | 26 | import java.time.Instant; 27 | import ygo.traffic_hunter.core.alarm.message.Message; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.1.0 32 | */ 33 | public record AlarmResponse( 34 | Instant time, 35 | Message message, 36 | String agentName 37 | ) { 38 | } 39 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/event/channel/TransactionMetricEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.event.channel; 25 | 26 | import ygo.traffic_hunter.core.dto.request.metadata.MetadataWrapper; 27 | import ygo.traffic_hunter.domain.metric.TraceInfo; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public record TransactionMetricEvent(MetadataWrapper transactionInfo) { 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/identification/login/LoginHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.identification.login; 25 | 26 | import jakarta.servlet.http.HttpServletRequest; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.1.0 31 | */ 32 | public interface LoginHandler { 33 | 34 | void login(HttpServletRequest request, Integer id); 35 | 36 | void logout(HttpServletRequest request); 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/entity/LogMeasurement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.entity; 25 | 26 | import java.time.Instant; 27 | import ygo.traffic_hunter.domain.metric.LogRecord; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.1.0 32 | */ 33 | public record LogMeasurement( 34 | 35 | Instant time, 36 | 37 | Integer agentId, 38 | 39 | LogRecord logRecord 40 | ) { 41 | } 42 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/event/channel/SystemInfoMetricEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.event.channel; 25 | 26 | import ygo.traffic_hunter.core.dto.request.metadata.MetadataWrapper; 27 | import ygo.traffic_hunter.core.dto.request.systeminfo.SystemInfo; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public record SystemInfoMetricEvent(MetadataWrapper systemInfo) { 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/entity/MetricMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.entity; 25 | 26 | import java.time.Instant; 27 | import ygo.traffic_hunter.domain.metric.MetricData; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public record MetricMeasurement( 34 | 35 | Instant time, 36 | 37 | Integer agentId, 38 | 39 | MetricData metricData 40 | ) { 41 | } 42 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/src/main/java/org/traffichunter/javaagent/jmx/metric/systeminfo/memory/MemoryStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.jmx.metric.systeminfo.memory; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record MemoryStatusInfo(MemoryUsage heapMemoryUsage, MemoryUsage nonHeapMemoryUsage) { 31 | 32 | public record MemoryUsage(long init, long used, long committed, long max) {} 33 | } 34 | -------------------------------------------------------------------------------- /java-apm-agent/plugin-sdk/src/main/java/org/traffichunter/javaagent/plugin/sdk/constant/GlobalTracerName.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.plugin.sdk.constant; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.1.0 29 | */ 30 | public enum GlobalTracerName { 31 | 32 | SPRING_WEB_MVC, 33 | SPRING_BUSINESS, 34 | JDBC, 35 | HIBERNATE, 36 | HTTP_CLIENT, 37 | HTTP_URL_CONNECTION, 38 | SERVLET 39 | ; 40 | } 41 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/metric/memory/MemoryMetricMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.metric.memory; 25 | 26 | import ygo.traffic_hunter.domain.metric.memory.usage.MemoryMetricUsage; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.0.0 31 | */ 32 | public record MemoryMetricMeasurement( 33 | 34 | MemoryMetricUsage heapMemoryUsage, 35 | 36 | MemoryMetricUsage nonHeapMemoryUsage 37 | ) { 38 | } 39 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-bootstrap/src/main/java/org/traffichunter/javaagent/bootstrap/TrafficHunterAgentStarter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.bootstrap; 25 | 26 | import java.lang.instrument.Instrumentation; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.1.0 31 | */ 32 | public interface TrafficHunterAgentStarter { 33 | 34 | void start(Instrumentation inst, String envPath); 35 | 36 | ClassLoader getAgentStartClassLoader(); 37 | } 38 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/src/main/java/org/traffichunter/javaagent/jmx/metric/web/tomcat/request/TomcatRequestInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.jmx.metric.web.tomcat.request; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record TomcatRequestInfo( 31 | long requestCount, 32 | long bytesReceived, 33 | long bytesSent, 34 | long processingTime, 35 | long errorCount 36 | ) { 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/systeminfo/web/tomcat/request/TomcatRequestInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.systeminfo.web.tomcat.request; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record TomcatRequestInfo( 31 | long requestCount, 32 | long bytesReceived, 33 | long bytesSent, 34 | long processingTime, 35 | long errorCount 36 | ) { 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/metric/TomcatWebServerRequestMeasurementResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.metric; 25 | 26 | /** 27 | * @author JuSeong 28 | * @version 1.1.0 29 | */ 30 | public record TomcatWebServerRequestMeasurementResponse( 31 | long requestCount, 32 | long bytesReceived, 33 | long bytesSent, 34 | long processingTime, 35 | long errorCount 36 | ) { 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/systeminfo/gc/GarbageCollectionStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.systeminfo.gc; 25 | 26 | import java.util.List; 27 | import ygo.traffic_hunter.core.dto.request.systeminfo.gc.collections.GarbageCollectionTime; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public record GarbageCollectionStatusInfo(List garbageCollectionTimes) { 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/entity/TransactionMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.entity; 25 | 26 | import java.time.Instant; 27 | import ygo.traffic_hunter.domain.metric.TransactionData; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public record TransactionMeasurement( 34 | 35 | Instant time, 36 | 37 | Integer agentId, 38 | 39 | TransactionData transactionData 40 | ) { 41 | } 42 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/domain/metric/web/tomcat/request/TomcatWebServerRequestMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.domain.metric.web.tomcat.request; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record TomcatWebServerRequestMeasurement( 31 | long requestCount, 32 | long bytesReceived, 33 | long bytesSent, 34 | long processingTime, 35 | long errorCount 36 | ) { 37 | } 38 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-event/src/main/java/org/traffichunter/javaagent/event/listener/AgentStateEventListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.event.listener; 25 | 26 | import java.util.EventListener; 27 | import org.traffichunter.javaagent.event.object.AgentStateEvent; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public interface AgentStateEventListener extends EventListener { 34 | 35 | void onEvent(AgentStateEvent event); 36 | } 37 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-extension/src/main/java/org/traffichunter/javaagent/extension/metadata/MetadataWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.extension.metadata; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.0.0 29 | */ 30 | public record MetadataWrapper(AgentMetadata metadata, D data) { 31 | 32 | public static MetadataWrapper create(AgentMetadata metadata, D data) { 33 | return new MetadataWrapper<>(metadata, data); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-websocket/src/main/java/org/traffichunter/javaagent/websocket/metadata/Metadata.java: -------------------------------------------------------------------------------- 1 | package org.traffichunter.javaagent.websocket.metadata; 2 | 3 | import java.time.Instant; 4 | import org.traffichunter.javaagent.commons.status.AgentStatus; 5 | 6 | public record Metadata( 7 | String agentId, 8 | String agentVersion, 9 | String agentName, 10 | Instant startTime, 11 | AgentStatus status) { 12 | 13 | public static Builder builder() { 14 | return new Builder(); 15 | } 16 | 17 | public static class Builder { 18 | private String agentId; 19 | private String agentVersion; 20 | private String agentName; 21 | private Instant startTime; 22 | private AgentStatus status; 23 | 24 | public Builder agentId(String agentId) { 25 | this.agentId = agentId; 26 | return this; 27 | } 28 | 29 | public Builder agentVersion(String agentVersion) { 30 | this.agentVersion = agentVersion; 31 | return this; 32 | } 33 | 34 | public Builder agentName(String agentName) { 35 | this.agentName = agentName; 36 | return this; 37 | } 38 | 39 | public Builder startTime(Instant startTime) { 40 | this.startTime = startTime; 41 | return this; 42 | } 43 | 44 | public Builder status(AgentStatus status) { 45 | this.status = status; 46 | return this; 47 | } 48 | 49 | public Metadata build() { 50 | return new Metadata(agentId, agentVersion, agentName, startTime, status); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/transaction/TransactionInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.transaction; 25 | 26 | import java.time.Instant; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.0.0 31 | */ 32 | public record TransactionInfo( 33 | String txName, 34 | Instant startTime, 35 | Instant endTime, 36 | long duration, 37 | String errorMessage, 38 | boolean isSuccess 39 | ) {} 40 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/common/map/LogMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.common.map; 25 | 26 | import ygo.traffic_hunter.core.dto.request.metadata.MetadataWrapper; 27 | import ygo.traffic_hunter.domain.entity.LogMeasurement; 28 | import ygo.traffic_hunter.domain.metric.LogRecord; 29 | 30 | /** 31 | * @author yungwang-o 32 | * @version 1.1.0 33 | */ 34 | public interface LogMapper { 35 | 36 | LogMeasurement map(MetadataWrapper logRecord); 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/annotation/Member.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.annotation; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | /** 32 | * @author yungwang-o 33 | * @version 1.1.0 34 | */ 35 | @Retention(RetentionPolicy.RUNTIME) 36 | @Target(ElementType.PARAMETER) 37 | public @interface Member { 38 | } 39 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/alarm/AlarmThreshold.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.alarm; 25 | 26 | /** 27 | * @author JuSeong 28 | * @version 1.1.0 29 | */ 30 | public record AlarmThreshold( 31 | int cpuThreshold, 32 | 33 | int memoryThreshold, 34 | 35 | int threadThreshold, 36 | 37 | int webRequestThreshold, 38 | 39 | int webThreadThreshold, 40 | 41 | int dbcpThreshold 42 | ) { 43 | } 44 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/member/SignIn.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.member; 25 | 26 | import jakarta.validation.constraints.Email; 27 | import jakarta.validation.constraints.NotBlank; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.1.0 32 | */ 33 | public record SignIn( 34 | 35 | @NotBlank 36 | @Email 37 | String email, 38 | 39 | @NotBlank 40 | String password 41 | ) { 42 | } 43 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/member/SignUp.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.member; 25 | 26 | import jakarta.validation.constraints.Email; 27 | import jakarta.validation.constraints.NotBlank; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.1.0 32 | */ 33 | public record SignUp( 34 | 35 | @NotBlank 36 | @Email 37 | String email, 38 | 39 | @NotBlank 40 | String password 41 | ) { 42 | } 43 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/send/ViewSender.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.send; 25 | 26 | import java.util.List; 27 | import ygo.traffic_hunter.domain.entity.user.Member; 28 | 29 | 30 | /** 31 | * The view sender allows data loss. 32 | * @author yungwang-o 33 | * @version 1.1.0 34 | */ 35 | public interface ViewSender { 36 | 37 | void send(T data); 38 | 39 | void send(Member member, T data); 40 | 41 | void send(List data); 42 | 43 | } -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/src/main/java/org/traffichunter/javaagent/jmx/metric/systeminfo/gc/GarbageCollectionStatusInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.jmx.metric.systeminfo.gc; 25 | 26 | import java.util.List; 27 | import org.traffichunter.javaagent.jmx.metric.systeminfo.gc.collections.GarbageCollectionTime; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public record GarbageCollectionStatusInfo(List garbageCollectionTimes) { 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/alarm/ThresholdResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.alarm; 25 | 26 | /** 27 | * @author yungwang-o 28 | * @version 1.1.0 29 | */ 30 | public record ThresholdResponse( 31 | 32 | int cpuThreshold, 33 | 34 | int memoryThreshold, 35 | 36 | int threadThreshold, 37 | 38 | int webRequestThreshold, 39 | 40 | int webThreadThreshold, 41 | 42 | int dbcpThreshold 43 | ) { 44 | } 45 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/config/web/webhook/WebHookConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.config.web.webhook; 25 | 26 | import com.slack.api.Slack; 27 | import org.springframework.context.annotation.Bean; 28 | import org.springframework.context.annotation.Configuration; 29 | 30 | /** 31 | * @author yungwang-o 32 | * @version 1.1.0 33 | */ 34 | @Configuration 35 | public class WebHookConfig { 36 | 37 | @Bean 38 | public Slack slack() { 39 | return Slack.getInstance(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/member/UpdateMember.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.member; 25 | 26 | import jakarta.validation.constraints.Email; 27 | import jakarta.validation.constraints.NotBlank; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.1.0 32 | */ 33 | public record UpdateMember( 34 | 35 | @NotBlank 36 | @Email 37 | String email, 38 | 39 | @NotBlank 40 | String password, 41 | 42 | boolean isAlarm 43 | ) { 44 | } 45 | -------------------------------------------------------------------------------- /server/src/test/java/ygo/traffic_hunter/core/assembler/span/SpanAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package ygo.traffic_hunter.core.assembler.span; 2 | 3 | import java.time.Instant; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Map; 7 | import org.junit.jupiter.api.Test; 8 | import ygo.traffic_hunter.AbstractTestConfiguration; 9 | import ygo.traffic_hunter.core.assembler.Assembler; 10 | import ygo.traffic_hunter.domain.metric.TransactionData; 11 | 12 | class SpanAssemblerTest extends AbstractTestConfiguration { 13 | 14 | @Test 15 | void assembler가_데이터를_잘_출력하는지_확인한다() { 16 | 17 | List datas = new ArrayList<>(); 18 | 19 | datas.add(createTransactionData("0000000000000000", "a")); 20 | datas.add(createTransactionData("a", "b")); 21 | datas.add(createTransactionData("b", "c")); 22 | datas.add(createTransactionData("c", "d")); 23 | 24 | Assembler, SpanTreeNode> assembler = new SpanAssembler(); 25 | 26 | SpanTreeNode spanTreeNode = assembler.assemble(datas); 27 | 28 | System.out.println(spanTreeNode); 29 | } 30 | 31 | private TransactionData createTransactionData(final String parentSpanId, final String spanId) { 32 | return TransactionData.builder() 33 | .parentSpanId(parentSpanId) 34 | .spanId(spanId) 35 | .traceId("traceId") 36 | .ended(true) 37 | .name("test") 38 | .attributesCount(4) 39 | .attributes(Map.of()) 40 | .endTime(Instant.now()) 41 | .startTime(Instant.now()) 42 | .exception("exception") 43 | .duration(30) 44 | .build(); 45 | } 46 | } -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/annotation/Collector.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.annotation; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | import org.springframework.stereotype.Component; 31 | 32 | /** 33 | * @author yungwang-o 34 | * @version 1.0.0 35 | */ 36 | @Target({ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | @Component 39 | public @interface Collector { 40 | } 41 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/annotation/Processor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.annotation; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | import org.springframework.stereotype.Component; 31 | 32 | /** 33 | * @author yungwang-o 34 | * @version 1.0.0 35 | */ 36 | @Target({ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | @Component 39 | public @interface Processor { 40 | } 41 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/annotation/Validator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.annotation; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | import org.springframework.stereotype.Component; 31 | 32 | /** 33 | * @author yungwang-o 34 | * @version 1.0.0 35 | */ 36 | @Target({ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | @Component 39 | public @interface Validator { 40 | } 41 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/metric/TomcatWebServerMeasurementResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.metric; 25 | 26 | /** 27 | * @author JuSeong 28 | * @param tomcatWebServerRequestMeasurement 29 | * @param tomcatWebServerThreadPoolMeasurement 30 | */ 31 | public record TomcatWebServerMeasurementResponse( 32 | TomcatWebServerRequestMeasurementResponse tomcatWebServerRequestMeasurement, 33 | TomcatWebServerThreadPoolMeasurementResponse tomcatWebServerThreadPoolMeasurement 34 | ) { 35 | } 36 | -------------------------------------------------------------------------------- /java-apm-agent/plugin/logger/shaded-logging-module/src/main/java/traffichunter/java/util/logging/Logger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package traffichunter.java.util.logging; 25 | 26 | import java.util.logging.Level; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.1.0 31 | */ 32 | public class Logger { 33 | 34 | public String getName() { 35 | throw new UnsupportedOperationException(); 36 | } 37 | 38 | @SuppressWarnings("unused") 39 | public boolean isLoggable(Level level) { 40 | throw new UnsupportedOperationException(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/response/metric/MetricDataResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.response.metric; 25 | 26 | /** 27 | * @author JuSeong 28 | * @version 1.1.0 29 | */ 30 | public record MetricDataResponse( 31 | CpuMetricMeasurementResponse cpuMetric, 32 | 33 | MemoryMetricMeasurementResponse memoryMetric, 34 | 35 | ThreadMetricMeasurementResponse threadMetric, 36 | 37 | TomcatWebServerMeasurementResponse webServerMetric, 38 | 39 | HikariCPMeasurementResponse dbcpMetric 40 | ) { 41 | 42 | } 43 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-jmx/src/main/java/org/traffichunter/javaagent/jmx/metric/web/tomcat/TomcatWebServerInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.jmx.metric.web.tomcat; 25 | 26 | import org.traffichunter.javaagent.jmx.metric.web.tomcat.request.TomcatRequestInfo; 27 | import org.traffichunter.javaagent.jmx.metric.web.tomcat.thread.TomcatThreadPoolInfo; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public record TomcatWebServerInfo( 34 | TomcatThreadPoolInfo tomcatThreadPoolInfo, 35 | TomcatRequestInfo tomcatRequestInfo 36 | ) { 37 | } 38 | -------------------------------------------------------------------------------- /java-apm-agent/java-agent-retry/src/main/java/org/traffichunter/javaagent/retry/backoff/policy/FixedBackOffPolicy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 yungwang-o 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.retry.backoff.policy; 25 | 26 | import org.traffichunter.javaagent.retry.backoff.BackOffPolicy; 27 | 28 | /** 29 | * @author yungwang-o 30 | * @version 1.0.0 31 | */ 32 | public class FixedBackOffPolicy extends BackOffPolicy { 33 | 34 | public static final FixedBackOffPolicy DEFAULT = new FixedBackOffPolicy(1000); 35 | 36 | public FixedBackOffPolicy(final long intervalMillis) { 37 | super(intervalMillis, 1); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/common/aop/lock/Lock.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.common.aop.lock; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | import ygo.traffic_hunter.common.aop.lock.method.LockMode; 31 | 32 | /** 33 | * @author yungwang-o 34 | * @version 1.0.0 35 | */ 36 | @Retention(RetentionPolicy.RUNTIME) 37 | @Target(ElementType.METHOD) 38 | public @interface Lock { 39 | 40 | LockMode mode() default LockMode.NORMAL; 41 | } 42 | -------------------------------------------------------------------------------- /server/src/main/java/ygo/traffic_hunter/core/dto/request/systeminfo/web/tomcat/TomcatWebServerInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package ygo.traffic_hunter.core.dto.request.systeminfo.web.tomcat; 25 | 26 | import ygo.traffic_hunter.core.dto.request.systeminfo.web.tomcat.request.TomcatRequestInfo; 27 | import ygo.traffic_hunter.core.dto.request.systeminfo.web.tomcat.thread.TomcatThreadPoolInfo; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.0.0 32 | */ 33 | public record TomcatWebServerInfo( 34 | TomcatThreadPoolInfo tomcatThreadPoolInfo, 35 | TomcatRequestInfo tomcatRequestInfo 36 | ) { 37 | } 38 | -------------------------------------------------------------------------------- /java-apm-agent/plugin-sdk/src/main/java/org/traffichunter/javaagent/plugin/sdk/instumentation/SpanScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2024 traffic-hunter.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.traffichunter.javaagent.plugin.sdk.instumentation; 25 | 26 | import io.opentelemetry.api.trace.Span; 27 | import io.opentelemetry.context.Scope; 28 | 29 | /** 30 | * @author yungwang-o 31 | * @version 1.1.0 32 | */ 33 | public record SpanScope(Span span, Scope scope) { 34 | 35 | public static SpanScope NOOP = new SpanScope(Span.current(), Scope.noop()); 36 | 37 | public static SpanScope create(final Span span, final Scope scope) { 38 | return new SpanScope(span, scope); 39 | } 40 | } 41 | --------------------------------------------------------------------------------