Ocean for developers. Waves are traffic spikes, currents are data flows, depths are legacy layers, storms are incidents.
- JavaScript 100%
| node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 | ||
| src | ||
| tests | ||
| package.json | ||
| README.md | ||
code-ocean
Ocean for developers. Waves are traffic spikes, currents are data flows, depths are legacy layers, storms are incidents.
Usage
const { Ocean, CREATURES, ZONES } = require('./src/ocean');
const ocean = new Ocean('Pacific Production');
// Spawn creatures
ocean.spawnCreature(CREATURES.SHARK, 5); // Aggressive scrapers
ocean.spawnCreature(CREATURES.WHALE, 3); // Large queries
// Deploy monitoring buoys
ocean.deployBuoy('API Sensor', 'twilight');
// Traffic spike!
ocean.spawnWave(8);
// Incident!
ocean.spawnStorm(7);
// Time passes
for (let i = 0; i < 10; i++) ocean.tick();
ocean.advanceDay();
console.log(ocean.oceanView());
console.log(ocean.report());
Depth Zones
- Surface (Live Traffic) — 0m, where requests hit
- Sunlight Zone (App Layer) — 200m, frontend services
- Twilight Zone (API Layer) — 1000m, microservices
- Midnight Zone (DB Layer) — 4000m, databases, cold and dark
- Abyssal Zone (Legacy Layer) — 6000m, ancient code still running
Marine Life
- Whale — Large slow query
- Shark — Aggressive scraper
- Plankton — Health checks
- Jellyfish — Slow drifting queries
- Anglerfish — Hidden bugs luring you in
- Giant Squid — Race condition
- Viperfish — N+1 query problem
- Herring School — Normal traffic