Skip to content

Rust microservice for computing array statistics (sum, mean, median, min, max) and optional histograms. Built with Axum, Tokio, and Rayon for fast parallel computation. Provides REST API endpoints and an interactive HTML UI.

Notifications You must be signed in to change notification settings

smart-developer1791/rust-compute-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Compute Microservice

Rust Axum Tokio Rayon Render

Interactive Rust microservice for computing array statistics and histograms

High-performance Rust service using Axum + Tokio + Rayon.
Computes sum, mean, median, min, max, and optional histogram of numeric arrays.


Run Locally

  1. Clone the repository:
git clone https://github.com/smart-developer1791/rust-compute-microservice.git
cd rust-compute-microservice
  1. Build and run:
cargo run --release
  1. Open in your browser:

http://localhost:8080/


Endpoints

Path Method Description
/compute-stats POST Compute statistics and optional histogram
/ GET HTML UI to test and visualize computations
/health GET Plain-text health check
/healthz GET JSON readiness check

Example POST request

JSON body:

{
  "values": [1,2,3,4,5,6,7,8,9,10],
  "bins": 5
}

Curl request:

curl -X POST http://localhost:8080/compute-stats \
  -H "Content-Type: application/json" \
  -d "{\"values\":[1,2,3,4,5,6,7,8,9,10],\"bins\":5}"

Features

  • Compute statistics: sum, mean, median, min, max
  • Optional histogram with configurable bins
  • Parallel computation using Rayon
  • Interactive HTML UI at /
  • Health and readiness endpoints for containerized environments

Technology Stack

  • Rust 1.72 – system programming language
  • Axum 0.7 – web framework for async HTTP services
  • Tokio 1.0 – asynchronous runtime
  • Rayon 1.11 – data parallelism library
  • Serde / Serde JSON – serialization and deserialization
  • Tracy / Tracing-subscriber – structured logging

Deploy in 10 seconds

Deploy to Render

About

Rust microservice for computing array statistics (sum, mean, median, min, max) and optional histograms. Built with Axum, Tokio, and Rayon for fast parallel computation. Provides REST API endpoints and an interactive HTML UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages