Skip to content
OnlyProjects
BCA · Cloud ComputingFor educational purposes only
Code included

Uptime Monitoring & Alerting for a Small Java Web Service (Servlets + MySQL + JMeter)

A poller, a rule engine and a dashboard that catch outages before customers do

Mapped to your syllabusUniversity of Madras CBCS 2023-24 · 320S61 Mini Project (Professional Competency Skill) · Semester 6

Overview

1 min read

Uptime Monitoring & Alerting System (UMAS) is an operations tool that watches small web services and tells their owners something is wrong before a customer phones in. It is built entirely on the University of Madras BCA stack — Java (220C4A), RDBMS (320C5B) and Web Technology (320C5C) — running as servlets/JSP on Apache Tomcat with MySQL, and measured under load with Apache JMeter.

A poller built on Java's ScheduledExecutorService checks each registered service every 30 seconds, records the HTTP status and response time into MySQL, and feeds a rule engine: two consecutive failures open an incident, a response slower than a configured threshold raises a latency warning, and recovery auto-closes the incident. Alerts go out by email (JavaMail) and appear in an acknowledgement queue on a JSP dashboard that shows 24-hour uptime percentages, response-time charts (Chart.js) and the full incident history with who acknowledged what and when.

The bundle ships with a deliberately small target service — an order-status API for a Chennai bakery, written with the same servlet stack — so the monitor has something real to watch, and a JMeter load-test harness that measures p95 response times before and after a connection-pool fix. That measured before/after comparison, with real numbers in the report, is what lifts this mini project from "another CRUD app" to an advanced, viva-defensible systems project.

Relevant for
Tamil Nadu
Level
Advanced · 6 weeks · team of 2
Common at
University of Madras, Bengaluru City University, Bharathiar University
Updated
Nov 2026

Syllabus alignment

University of Madras · CBCS 2023-24

320S61 · Mini Project (Professional Competency Skill) · Semester 6 · 2 credits · 40 + 60

Subjects this project applies
  • Java Programming (220C4A)
  • RDBMS (320C5B)
  • Web Technology (320C5C)
  • Data Structures (220C3A)
How it is evaluated

See your department's project guidelines.

Also fits: BCU SEP 2024, Bharathiar University 2023-24.

What's in the box

11 parts · 5 free · 2 previewed · 4 unlock for ₹2,000

Problem & synopsis

5 min read

Problem statement

Small services on low-cost hosting fail quietly: the process dies, the disk fills, or the database slows to a crawl at peak hours, and the first report comes from a customer. For Sweet Basket's order-status service there is no uptime history, no alert channel and no performance data — so outages last hours instead of minutes, the hosting provider cannot be shown evidence of recurring faults, and nobody knows whether recent code changes made the service faster or slower.

What is needed is a self-hosted monitoring layer that (1) probes the service continuously and records every check, (2) applies clear rules — consecutive failures and latency thresholds — to open, escalate and auto-close incidents, (3) notifies the owner by email immediately, (4) presents uptime and response-time history on a web dashboard, and (5) is backed by a repeatable JMeter load-test harness that turns "it feels slow" into measured p95 numbers before and after a fix.

Synopsis

Abstract

When a small business's web service goes down, the owner usually finds out from an angry customer, because nobody is watching the service. This project builds a self-hosted uptime monitoring and alerting system in Java: a poller probes registered HTTP endpoints on a schedule, stores every check in MySQL, a rule engine converts failed checks into incidents and latency warnings, and a JSP dashboard reports uptime percentages and response-time trends while email alerts reach the right person. A JMeter load-test harness supplies measured performance evidence.

Introduction

The scenario: Sweet Basket, a two-outlet bakery in Chennai, runs a small order-status service ("is my cake order ready?") that the counter staff and an Instagram-redirected link depend on. The service was built by a freelance developer and runs on one low-cost VM; there is no monitoring, so an out-of-memory crash in the past meant silent downtime for half a day. The bakery wants a watcher it can self-host, understand and extend — which is exactly this project.

Existing System

  • Outages are discovered by customers or counter staff phoning the owner.
  • Logs exist only inside the VM and nobody reads them proactively.
  • Response-time problems (slow database queries at 7 pm peak) are invisible until they become full outages.
  • Limitations: no uptime history, no alert channel, no evidence to show the hosting provider when something breaks, and no data on how the service behaves under load.

Proposed System

  • A poller (Java ScheduledExecutorService) checks each service's /health endpoint every 30 seconds with a configurable timeout, recording status code, response time and error text per check.
  • A rule engine: 2 consecutive failures open an incident; latency above a per-service threshold raises a warning; the first healthy check auto-resolves, all with hysteresis so a single blip does not page anyone.
  • Alerting by email through JavaMail with a short retry queue, plus an in-app alert log.
  • A JSP dashboard: uptime % over 24 h / 7 d, response-time chart, incident list with acknowledge/resolve actions, and a service registry with CRUD.
  • A JMeter harness that load-tests the target service and records p95 before/after a connection-pool and index fix — a measured, tabulated comparison.

Feasibility Study

  • Technical: everything is Java + MySQL + Tomcat, exactly the 220C4A/320C5B/320C5C course stack, plus JMeter which is free and runs on any lab machine. The poller is a few hundred lines; no external monitoring SaaS is needed.
  • Economic: self-hosted software on free licences; the alternative (a hosted monitoring plan) costs USD 10–20 per month per service — avoidable for the bakery.
  • Operational: one admin role and one page to register a service; alerts arrive in email the staff already checks. The comparison study gives the owner objective numbers to negotiate with the hosting provider.

Objectives

  1. 01Design a normalised MySQL schema for services, check results, incidents, alerts, contacts and load-test runs.
  2. 02Implement a multi-threaded Java poller using ScheduledExecutorService that probes endpoints with configurable intervals, timeouts and expected status codes.
  3. 03Implement a rule engine that opens incidents after 2 consecutive failures, raises latency warnings and auto-resolves on recovery.
  4. 04Deliver email alerts via JavaMail with a retry queue, and record every notification attempt.
  5. 05Build a JSP/Chart.js dashboard showing uptime percentage, response-time trends and an acknowledge/resolve incident workflow.
  6. 06Load-test the target service with Apache JMeter and document p95 response times before and after a connection-pool and index fix.
  7. 07Apply the Web Technology and RDBMS course concepts — session handling, prepared statements, connection pooling, normalisation — in a systems-operations context.

Scope

In scope

  • One Tomcat web application containing the monitor (dashboard + REST-ish endpoints) and one small target service for the demo.
  • HTTP/HTTPS health checks (status code, timeout, response time); no deep script execution or log scraping.
  • Single-organisation deployment with one admin role and email contacts.
  • Alert rules: consecutive-failure count, latency threshold, auto-resolve; email delivery with retry queue.
  • Uptime % and latency charts for 24-hour and 7-day windows; incident history with acknowledgement audit.
  • JMeter test plan for the target service with a documented before/after comparison.

Out of scope (v1)

  • SMS or WhatsApp alert delivery; phone-call escalation rosters.
  • Multi-tenant SaaS hosting; monitoring of non-HTTP protocols (TCP/ICMP).
  • Automatic remediation (restarting the watched service).
  • Distributed pollers behind a load balancer — one poller instance is assumed.

Methodology

The project follows an iterative-incremental SDLC model compressed into 6 weeks (the 320S61 mini-project window), with one working increment per week and a fixed review at each weekend. Iteration is appropriate because the rule engine's thresholds and the dashboard's usefulness can only be tuned against a running system, so feedback loops must be short.

WeekIncrementActivitiesDeliverable
1Analysis & schemaRequirement checklist with the bakery owner, ER diagram, schema DDL, service-registry wireframesApproved design note
2Poller + registryScheduledExecutorService poller, check recording, service CRUD, /health on target serviceChecks accumulating in MySQL
3Rules & alertsIncident state machine, latency thresholds, JavaMail delivery, retry queue, unit tests for rulesAlerts reaching a real inbox
4DashboardJSP pages, Chart.js graphs, uptime % queries, acknowledge/resolve workflowWorking dashboard
5Load testingJMeter thread groups, p95 baseline, connection-pool + index fix, re-run, comparison tableMeasured before/after study
6Hardening & reportBlack-box test pass, concurrency fixes, documentation, mini-project report and demo prepFinal submission

Member split (team of 2): Member A owns the poller, rule engine and alert delivery; Member B owns the schema, dashboard and JMeter study; the target service and integration tests were built jointly, and each member can demo the whole system.

Testing approach: JUnit tests for the rule engine's state transitions (1 failure, 2 failures, recovery, flapping), integration tests against a test database, black-box cases for every dashboard screen, and the JMeter runs as repeatable performance tests with saved result files.

Architecture & tech stack

4 diagrams · 8 technologies · 2 min read

  • Java
  • Servlets & JSP
  • MySQL
  • Apache Tomcat
  • Apache JMeter
  • Chart.js
  • Bootstrap
  • JavaMail

UMAS deploys as two web applications on one Tomcat server with one MySQL 8 database. The monitor application contains the poller (a daemon thread pool started at context load), the rule engine, the email sender and the JSP dashboard. The target application is the bakery's order-status API exposing /health and /order-status, deliberately kept small because it is the patient, not the doctor. All reads and writes go through a JDBC layer using a connection pool and prepared statements only.

flowchart TD
  SVC[Target service: bakery order API] -->|status and response time| P[Poller threads]
  P -->|every 30 s| REC[Check recorder]
  REC --> DB[(MySQL: checks)]
  REC --> RE[Rule engine]
  RE -->|2 failures or slow response| INC[Incident state machine]
  INC --> DB2[(MySQL: incidents and alerts)]
  INC --> MAIL[JavaMail sender]
  MAIL --> INBOX([Owner inbox])
  ADM([Admin]) -->|acknowledge and resolve| DASH[JSP dashboard]
  DASH --> Q1[Uptime queries]
  Q1 --> DB
  DASH --> Q2[Incident and alert views]
  Q2 --> DB2

ER diagram

erDiagram
  SERVICE ||--o{ CHECK_RESULT : "receives checks"
  SERVICE ||--o{ INCIDENT : "may have"
  SERVICE ||--o{ ALERT_RULE : "is governed by"
  INCIDENT ||--o{ ALERT : "triggers"
  CONTACT ||--o{ ALERT : "is notified by"
  USER ||--o{ INCIDENT : acknowledges
  LOAD_TEST_RUN }o--|| SERVICE : "measures"

  SERVICE {
    int id PK
    string name
    string healthUrl
    int intervalSeconds
    int timeoutMs
    boolean active
  }
  CHECK_RESULT {
    bigint id PK
    int serviceId FK
    datetime checkedAt
    int httpStatus
    int responseMs
    string errorText
  }
  INCIDENT {
    int id PK
    int serviceId FK
    string kind
    datetime openedAt
    datetime resolvedAt
    string state
  }
  ALERT {
    int id PK
    int incidentId FK
    int contactId FK
    string channel
    string status
  }
  ALERT_RULE {
    int id PK
    int serviceId FK
    int failureThreshold
    int latencyThresholdMs
  }
  CONTACT {
    int id PK
    string name
    string email
  }
  USER {
    int id PK
    string username UK
    string passwordHash
  }
  LOAD_TEST_RUN {
    int id PK
    int serviceId FK
    datetime ranAt
    int threads
    decimal p95Ms
    string notes
  }

DFD — Level 0 (context diagram)

flowchart LR
  TGT([Target service]) -- HTTP response, latency --> SYS((Uptime Monitoring<br/>and Alerting System))
  ADM([Admin]) -- rules, services, acknowledgements --> SYS
  SYS -- uptime and incident dashboards --> ADM
  SYS -- alert emails --> OWN([Owner inbox])
  JM([JMeter harness]) -- load traffic --> TGT

DFD — Level 1

flowchart TD
  TGT([Target service]) --> P1[1.0 Poll health]
  P1 <--> D1[(D1 Check results)]
  P1 --> P2[2.0 Evaluate rules]
  P2 <--> D2[(D2 Alert rules)]
  P2 --> P3[3.0 Manage incidents]
  P3 <--> D3[(D3 Incidents)]
  P3 --> P4[4.0 Send alerts]
  P4 <--> D4[(D4 Alerts and Contacts)]
  P4 --> OWN([Owner inbox])
  ADM([Admin]) --> P5[5.0 Register services and rules]
  P5 <--> D5[(D5 Services)]
  P5 <--> D2
  ADM --> P6[6.0 View reports and acknowledge]
  P6 <--> D1
  P6 <--> D3

Deployment / component note

The poller runs inside the monitor's servlet context and starts with ServletContextListener; the dashboard's uptime queries aggregate CHECK_RESULT with indexed service_id, checked_at columns so a 7-day window stays fast — the very index whose effect the JMeter study quantifies.

Modules

6 modules

  1. Module 01

    Service Registry & Health Checks

    Admin registers services (name, health URL, interval, timeout, expected status) with validation and edit/disable actions. The target bakery service ships pre-registered, and each row stores who changed what, so the configuration of the monitoring layer itself is auditable.

  2. Module 02

    Poller Engine

    A ScheduledExecutorService with a fixed thread pool fires each active service's check at its own interval, measures response time with System.nanoTime, applies the read timeout, and writes status, latency and error text into CHECK_RESULT. Failures to connect are recorded distinctly from HTTP 5xx so the incident reason is precise.

  3. Module 03

    Rule Engine & Incident Manager

    A state machine per service: failure count from the last checks, latency versus the configured threshold, incidents opened after 2 consecutive failures or sustained slowness, auto-resolution on the first healthy check, and a flapping guard that requires a stable window before re-opening. Every transition is timestamped.

  4. Module 04

    Alert Delivery

    JavaMail sends incident and warning emails to configured contacts through SMTP with TLS. Failed sends enter a retry queue with exponential backoff up to three attempts, and every attempt is logged in ALERT with channel and status, so 'the mail never came' can be answered from evidence.

  5. Module 05

    Dashboard & Reports

    JSP pages with session-secured login show 24-hour and 7-day uptime percentages per service, a Chart.js response-time chart with the p95 line, the open-incident queue with acknowledge and resolve actions, and a printable incident history for provider disputes.

  6. Module 06

    JMeter Load-Test Harness

    A saved JMeter test plan with thread groups ramping to 50 concurrent users against the target service, listeners configured for aggregate statistics, and a documented comparison: p95 and error rate before versus after adding a HikariCP connection pool and an index on the order lookup. Two short example .jtl files show the result format; students overwrite them with their own measured runs.

Slides

13 slides · titles free · bullets, notes and the .pptx unlock

  1. Slide 1

    Uptime Monitoring & Alerting System (UMAS)

  2. Slide 2

    The Scenario

  3. Slide 3

    Problem & Objectives

  4. Slide 4

    Technology Stack

  5. Slide 5

    System Architecture

  6. Slide 6

    Database Design

  7. Slide 7

    Rule Engine & Incident Workflow

  8. Slide 8

    Dashboard Demo

  9. Slide 9

    Load-Test Study (JMeter)

  10. Slide 10

    Testing

  11. Slide 11

    Security & Operations Notes

  12. Slide 12

    Limitations & Future Scope

  13. Slide 13

    Conclusion

Bullets, speaker notes and the .pptx · ₹2,000

The titles above are the real outline. The rest is what you present from.

Unlock for ₹2,000

Viva questions & answers

3 of 16 answered free · 13 unlock

Read each answer, close it, and say it in your own words. Your viva will ask. Now you'll know.

  1. 01Concept

    What exactly does "uptime percentage" mean in your system and how is it computed?

    Uptime percentage is the share of scheduled checks in a window that were healthy. For each service I count the checks in the last 24 hours or 7 days where the HTTP status matched the expected code within the timeout, divide by total scheduled checks, and multiply by 100. The SQL groups CHECK_RESULT by service and filters on the indexed checked_at column, and I show that query on the report's dashboard section.

  2. 02Concept

    Why do you report p95 response time instead of the average?

    The average hides the tail: a service can average 120 ms while 5 percent of users wait over 2 seconds, and those are the complaints an owner actually receives. The p95 is the latency below which 95 percent of requests complete, so it reflects the worst experience most users see. JMeter's aggregate report gives it directly, and I record it for every load-test run.

  3. 03Concept

    Why did you use ScheduledExecutorService instead of the older java.util.Timer?

    Timer uses a single thread, so one hung check would delay every other service's probe and the whole monitor would stall together. ScheduledExecutorService runs on a thread pool, survives task exceptions without killing the schedule, and lets me set a fixed delay between successive runs of the same service. It is also the idiomatic concurrency tool taught in modern Java, which made the code easier to unit test.

+13 more questions, with answers

Try the free ones out loud first. Your examiner will not accept “it's in the PPT”.

Source code & how to run

7 steps · complete source code · unlocks with the project

Unlocks with the project · ₹2,000

7 steps · source code zip

Prerequisites, install, seed data and tests, written for demo day. Plus the complete source.

Unlock for ₹2,000

READMEFIRST

299 words · unlocks with the project

What to change before it goes anywhere near a submission. Skipping it is how the demo fails live.

Unlocks with the project · ₹2,000

299 words · ~1 min read

The checklist of things to rename, re-seed and re-think so the project reads as yours.

Unlock for ₹2,000

Instructions

353 words · unlocks with the project

How to study it, adapt it and walk your examiner through it, step by step.

Unlocks with the project · ₹2,000

353 words · ~2 min read

Report structure, formatting rules and the submission checklist your department will grade.

Unlock for ₹2,000

References

8 sources

  1. Apache JMeter — User's Manual
  2. Apache Tomcat 10.1 Documentation
  3. MySQL 8.0 Reference Manual
  4. Google SRE Book — Site Reliability Engineering: How Google Runs Production Systems (free online edition)
  5. OWASP Top 10 — Web Application Security Risks
  6. OWASP SQL Injection Prevention Cheat Sheet
  7. Ian Sommerville, Software Engineering, 10th ed., Pearson
  8. Ramez Elmasri & Shamkant B. Navathe, Fundamentals of Database Systems, 7th ed., Pearson

Cite this bundle

OnlyProjects. (2026). Uptime Monitoring & Alerting for a Small Java Web Service (Servlets + MySQL + JMeter): BCA Cloud Computing project bundle [Educational resource]. https://onlyprojects.online/projects/bca-cloud-uptime-monitor-alerts-java-web-service

Future scope

1 min read

  • SMS and WhatsApp alert channels via a gateway API, with an escalation roster if the first contact does not acknowledge within 10 minutes.
  • Public status page — a read-only URL showing live uptime per service for customers.
  • Agent-based deep checks — a small Java agent on the target host reporting CPU, memory and disk, so resource exhaustion is caught before the health endpoint fails.
  • SLA reports — monthly PDF with uptime %, incident MTTR and alert latency per service.
  • Multi-poller deployment with a queue between pollers and the recorder, so checks scale past a single Tomcat instance.
  • Auto-remediation hooks — an optional webhook that restarts a watched container when a defined incident kind opens.

Keep browsing

Same degree, same syllabus slot, different idea. Pick the one your guide will actually approve.

BCACode included

Web Development

Smart Hostel Management System

Room allocation, complaints and mess billing without the register

  • Next.js
  • TypeScript
  • Node.js
  • +3

intermediate8 wk2 students