Skip to content

buffer-sim — A Go simulation of a fixed-size buffer system with goroutines, channels and performance metrics.

Notifications You must be signed in to change notification settings

CBYeuler/buffer-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

buffer-sim — Concurrent Buffer Simulation in Go

Go Version Build License Docker Issues Stars Last Commit Code Style

buffer-sim is a Go-based simulation of a fixed-size buffer system, designed to demonstrate concurrency patterns (goroutines, channels), performance metrics, and modular software architecture.
It’s a portfolio-ready project, real enough to show engineering skills, focused enough to finish.


Features

  • Simulates a fixed-size buffer/queue with producers & consumers.
  • Implements concurrency using Go’s goroutines and channels.
  • Captures performance metrics (throughput, latency, drops).
  • Modular structure: separate packages for core logic, metrics, CLI.
  • CLI interface to configure buffer size, producer/consumer counts, runtime.
  • Easily extensible for experiments (different buffer types, scheduler policies).
  • Built with testing in mind: unit tests for core logic.

Tech Stack

  • Language: Go
  • Concurrency primitives: goroutines, channels, select statements
  • Metrics & logging: standard library (or optional external)
  • CLI interface: built-in flag package (or Cobra optional)
  • Project structure: idiomatic Go modules, clear layering

Quickstart

1) Clone & Install

git clone https://github.com/CBYeuler/buffer-sim.git
cd buffer-sim
go mod tidy

Build & Run

go build -o buffer-sim ./cmd/buffer-sim
./buffer-sim --buffer-size=100 --producers=5 --consumers=3 --duration=60s

Sample output

Buffer size: 100
Producers: 5, Consumers: 3
Elapsed time: 60s
Total items produced: 123456
Total items consumed: 123450
Dropped items: 6
Avg latency: 2.34ms
Throughput: 2065 items/s

Development Roadmap

  • Add support for multiple buffer types (ring buffer, lock-free queue)
  • Add CLI flags for tuning producer/consumer behavior
  • Add real-time visualization (web dashboard or terminal UI)
  • Add data export (CSV, JSON) for analysis
  • Add advanced metrics (percentile latency, histograms)
  • Add stress test mode for load generation
  • Add benchmarking suite (go test -bench)
  • Add unit tests for buffer logic
  • Add concurrency race detection (go vet, -race)
  • Add configurable logging levels
  • Add CI pipeline (lint, build, test)
  • Add Dockerfile + containerized runner

License (MIT)

MIT © 2025 Cem Batuhan Yaman

About

buffer-sim — A Go simulation of a fixed-size buffer system with goroutines, channels and performance metrics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published