Skip to content

[Phase3] Issue #4: TokenBucketService 구현 #4

Description

@724thomas

Phase 목표: Token Bucket 알고리즘 구현

목표: 첫 번째 Rate Limiter 알고리즘 구현 및 검증

작업 내용

  • TokenBucketService 클래스 구현
  • @Service("tokenBucket") 어노테이션 적용
  • 토큰 버킷 로직 구현 (토큰 보충, 소모)
  • Thread-Safe 동시성 처리
  • 단위 테스트 작성 (기본 기능, 경계 조건, 동시성)

완료 기준

  • RateLimiterService 인터페이스 구현
  • 토큰 보충/소모 알고리즘 정확성
  • 동시성 환경에서 안전한 동작
  • 테스트 커버리지 80% 이상

핵심 로직

  • 시간 경과에 따른 토큰 보충
  • 요청당 토큰 소모
  • 버킷 용량 초과 방지
  • 음수 토큰 방지

파일 위치

  • src/main/java/com/example/demo/ratelimiter/service/TokenBucketService.java
  • src/test/java/com/example/demo/ratelimiter/service/TokenBucketServiceTest.java

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions