컴퓨터/JAVA
-
Spring boot: Github Action CI에 JaCoCo + CodeCov컴퓨터/JAVA 2023. 12. 3. 18:32
할 것: Github Action을 이용하여 JaCoCo 테스트 커버리지 결과를 CodeCov 하는 과정 CI를 만들 것이다. 필요: Codecov - The Leading Code Coverage Solution Code coverage reporting solution for any test suite — Codecov gives developers actionable insights to deploy reliable code with confidence. about.codecov.io 위 사이트에 로그인해서 레포지토리를 선택한다. 그리고 CODECOV 토큰을 받아서 Github 설정 secret에 넣어준다. Github Action CI 최상위 폴더에서 java라는 폴더에 스프링 부트 프로젝트가 있..
-
Spring boot: 실시간 로그 수집하기 (Logstash, ELK)컴퓨터/JAVA 2023. 10. 31. 21:38
Logstash Kibana를 제외하고 ELK를 셋업 할 것이다. ElasticSearch는 어딘가 실행되고 있다고 가정하고 Logstash를 Docker에서 돌려서 Spring Boot 로그를 수집할 것이다. Logstash 셋업 Logstash 도커 파일을 만든다. version: '3.8' services: logstash: container_name: logstash image: docker.elastic.co/logstash/logstash:8.10.4 ports: - "5044:5044" - "5000:5000/tcp" - "5000:5000/udp" - "9600:9600" volumes: - ./logstash/config:/usr/share/logstash/config - ./logsta..
-
Java: spring boot AWS opensearch 연동하기컴퓨터/JAVA 2023. 10. 9. 18:38
@코드로 참고하기 우선 AWS 보안 자격 증명에서 IAM을 하나 만든다. https://us-east-1.console.aws.amazon.com/iamv2/home#/security_credentials us-east-1.console.aws.amazon.com dependencies spring boot v3.1 + gradle 기준; 버전이 까다로울 수 있다. 각각 패키지를 검색하면 elastic은 무슨 버전까지 지원하고 그런 표가 다 있으니 확인하면 편한다. dependencies { ... implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-aws', version: '2.2.6.RELEASE' // AWS..
-
Spring boot: ChatGPT API 사용하기컴퓨터/JAVA 2023. 10. 2. 19:15
GitHub - flashvayne/chatgpt-spring-boot-starter: a chatgpt starter based on Openai Official Apis. a chatgpt starter based on Openai Official Apis. Contribute to flashvayne/chatgpt-spring-boot-starter development by creating an account on GitHub. github.com gradle 기준, 라이브러리를 추가한다. implementation 'io.github.flashvayne:chatgpt-spring-boot-starter:1.0.4' src/resouses.yml 에 아래와 같은 설정을 추가한다. (gpt-3.5-..
-
Java: Z Garbage Collection (ZGC)컴퓨터/JAVA 2023. 1. 15. 15:14
ZGC Main - Main - OpenJDK Wiki wiki.openjdk.org 오늘은 Z Garbage Collection에 대하여 공부한 대로 글을 써본다. Java 11 부터 실험적으로 추가되어 Java 15에서는 어느새 Production Ready (PR) 상태까지 온 미래 GC 후보라고 볼 수 있다. (Z의 의미는 아무 뜻도 없다고 한다.) 목차는 다음과 같다. Introduction (소개) Basics of ZGC (ZGC 기본 지식) ZGC phases (ZGC 단계) Concurrent reference processing in ZGC (concurrent 레퍼런스 처리 in ZGC) Advanced Topics (심화 주제) Conclusion (결론) ◆ Introduction..
-
JAVA: Spring Boot REST Api 서버 만들어보기컴퓨터/JAVA 2021. 1. 28. 23:21
Spring Boot Spring 첫 사용기 TIL 풀소스 링크 @Github Spring makes Java simple. Level up your Java code and explore what Spring can do for you. spring.io 1. Spring Boot 소개 Spring은 엔터프라이즈 레벨의 개발을 할 때 유용한, 다양한 도구를 제공해주는 프레임워크이다. (주로 configuration) Spring Boot은 기본 Spring에서 수많은 구성들로 인해 개발을 시작하기도 전에 에러가 발생하는 상황을 해결할 수 있었다. 특징 구성들 추상화 허용 (미리 구성된 템플릿을 얻을 수 있음) 구성들이 숨겨졌지만 여전히 수정할 수 있음 2. 프로젝트 만들기 start.spring.io ..
-
파이썬, 자바 Trie[트라이] 비교컴퓨터/JAVA 2020. 10. 16. 16:10
Trie [트라이] 또는 디지털 트리, suffix/prefix (접두/접미) 트리 1. 소개 Trie는 탐색 트리의 일종이며 주로 문자열로 이루어진 트리 자료 구조이다. Boggle Board 같은 알고리즘에서 원하는 단어를 얻어낼 때 유용하다. 이 글 Trie 구조는 아래 words(String[]) 배열을 결과물처럼 만들 것이다. endSymbol = asterisk(*)로 지정해서 *까지 도달하면 그 문자열은 찾은 걸로 표시한다. (full word) words = [ "안녕하세요", "안녕", "하세요", "반갑습니다", "트라이", "트라이앵글", ] # 결과물 {'안': {'녕': {'하': {'세': {'요': {'*': '안녕하세요'}}}, '*': '안녕'}}, '하': {'세': {'..
-
Java: Missing number in array컴퓨터/JAVA 2020. 10. 11. 13:28
GeekforGeeks Practice Missing number in array | Practice Given an array C of size N-1 and given that there are numbers from 1 to N with one element missing, the missing number is to be found. practice.geeksforgeeks.org 0. Basic 문제 입력: int T (테스트케이스 숫자) int N (배열 크기) (배열은 1~N까지 정렬된 배열로 가정) int[] A (ex. 1 2 3 5) 출력: 빠진 element 예제 입력 1) 2 5 1 2 3 5 10 1 2 3 4 5 6 7 8 10 예제 출력 1) 4 9 1. Java 8+ next..