gRPC microservice that converts a timestamp into a target IANA timezone, matching the Java implementation.
- Node.js 18+
- pnpm 9+ (
corepack enableornpm install -g pnpm) - grpcurl for manual calls and load tests (
brew install grpcurl)
pnpm install
pnpm test
pnpm startServer listens on port 8080 by default (PORT env overrides).
./curl.shStart the server, then in another terminal:
# Light smoke
DURATION_SECONDS=30 CONCURRENCY=8 ./simulate_traffic.sh
# Heavier soak (defaults: 300s, 128 concurrent)
./simulate_traffic.shEnvironment variables: HOST, DURATION_SECONDS, CONCURRENCY, TZ_MODE, TZ_POOL, GRPCURL_MAX_TIME.
Preview traffic shape without hitting the server:
./simulate_traffic_graph.sh| Item | Value |
|---|---|
| Service | timezone.TimeZoneConverter |
| Method | ConvertTime |
| Port | 8080 (plaintext gRPC) |
Example (grpcurl):
grpcurl -plaintext \
-import-path ./proto \
-proto api.proto \
-d '{"timestamp": "2024-12-04T15:00:00Z", "target_timezone": "America/New_York"}' \
localhost:8080 \
timezone.TimeZoneConverter/ConvertTimeGolden example: 2024-12-04T15:00:00Z + America/New_York → 2024-12-04T10:00:00-05:00
proto/api.proto— gRPC contractsrc/timeConverter.ts— conversion logic (Luxon)src/timeZoneConverterService.ts— RPC handlersrc/server.ts— server entrypoint
| Command | Description |
|---|---|
pnpm install |
Install dependencies |
pnpm test |
Run Vitest unit and integration tests |
pnpm start |
Start gRPC server |
./scripts/generate-proto.sh |
Optional static proto codegen |