Skip to content

walterfan/mdd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MDD (Metrics Driven Development)

English | 简体中文

Author: Walter Fan 🤵

Twitter Follow

Overview

Why MDD

  • If you can’t measure it, you can’t manage it
  • If you can’t measure it, you can’t prove it
  • If you can’t measure it, you can’t improve it

What's MDD

A development approach driven by metrics to continuously improve software products and services:

  • Build metrics into design, coding and DevOps from the beginning.
  • Validate the achievement of goals, optimize, enhance and make decision based on metrics.
  • Execute PDCA(Plan, Do, Check, Act) according to metrics.

Metrics Content

USED

  • Usage: Measures how frequently and in what ways users interact with the system, indicating feature engagement and activity levels.
  • Saturation: Reflects how close the system is to its maximum capacity, such as CPU, memory, or network usage.
  • Error: Tracks the occurrence of failures or issues within the system, providing insights into stability and reliability.
  • Delay: Measures the time it takes for the system to respond to requests, reflecting its performance and responsiveness.

Metrics Type

  • Gauge: The instantaneous value of something.
  • Counter: An incrementing and decrementing value.
  • Meter: The average rate of events over a period of time.
  • Histogram: The statistical distribution of values in a stream of data.
  • Timer: A histogram of durations and a meter of calls.

MDD Tutorial

MDD Book

"The Way of Microservices: Metrics-Driven Development" -- Walter Fan, Jian Fu

If you encounter any issues during installation or testing, please submit an issue in this repository, and it will be addressed and resolved as soon as possible.

modules

  1. Account

    Account Service based on Flask in Python

  2. Alertor

    Alertor to check metrics and trigger alert based on ElasticSearch API.

  3. Potato

    Potato service based on Spring boot

    • Consul snapshot:

    Consul Snapshot

    • Web Page:

    Potato Service GUI

    • Web API:

    Potato Service API

  4. Scripts

  • Data Analysis scripts
  • Performance testing scripts
  1. docker

    Commonly used docker files

  2. oss

    The installation and setup guideline of ELKK, TIG, etc.

  3. devops

    The devops scripts

Environments

Take Ubuntu 16 as example

apt install docker
apt install docker-compose

python environment

apt install python3
apt install python3-pip

pip3 install virtualenv

virtualenv -p python3 venv
source venv/bin/activate

pip install fabric3

Java environment

apt install openjdk-8-jdk
apt install maven

Quick start

Please make sure the dependencies are ready. And you can start and debug the service one by one with consul and influxdb.

≈ Make sure that the relevant dependencies are installed, and that Doccompos is used to manage the application and its dependencies. If you want to debug on a service-by-service basis, you can start with just Consour and Inflix Deb

cd potato
docker-compose start consul influxdb

The fabric file (potao/fabfile.py) contains the building and deployment steps, so you can try it firstly, then try every stesp by yourself.

potato service example

Dependencies

  • python3
  • fabric3
  • jdk8
  • maven3

deployment

cd potato
fab redeploy
  • check running status

docker-compose ps
                Name                                   Command                                  State                                   Ports
-------------------------------------------------------------------------------------------------------------------------------------------------------------
consul                                  docker-entrypoint.sh agent ...          Up                                      8300/tcp, 8301/tcp, 8301/udp,
                                                                                                                        8302/tcp, 8302/udp,
                                                                                                                        0.0.0.0:8400->8400/tcp,
                                                                                                                        0.0.0.0:8500->8500/tcp,
                                                                                                                        0.0.0.0:8600->8600/tcp,
                                                                                                                        0.0.0.0:8600->8600/udp
influxdb                                /entrypoint.sh influxd                  Up                                      0.0.0.0:8083->8083/tcp,
                                                                                                                        0.0.0.0:8086->8086/tcp
local-mysql                             docker-entrypoint.sh --ini ...          Up                                      0.0.0.0:3306->3306/tcp, 33060/tcp
potato-scheduler                        java -jar /opt/potato-sche ...          Up                                      0.0.0.0:9002->9002/tcp
potato-server                           java -jar /opt/potato-app.jar           Up                                      0.0.0.0:9003->9003/tcp
potato-web                              java -jar /opt/potato-web.jar           Up                                      0.0.0.0:9005->9005/tcp
potato-zipkin                           /busybox/sh run.sh                      Up                                      9410/tcp, 0.0.0.0:9411->9411/tcp
  • Open the web portal of potato application
open http://localhost:9005

About

metrics driven development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •