-
Notifications
You must be signed in to change notification settings - Fork 0
/
pullModelMetrics.py
31 lines (26 loc) · 1.24 KB
/
pullModelMetrics.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from diagrams import Diagram, Cluster, Edge
from diagrams.onprem.client import Users
from diagrams.onprem.compute import Server
from diagrams.onprem.network import Nginx
from diagrams.onprem.database import MySQL
from diagrams.onprem.queue import RabbitMQ
from diagrams.onprem.inmemory import Redis
from diagrams.onprem.network import Etcd
# Create a custom shape for etcd and ZooKeeper
with Diagram("Pull Metrics", show=False):
metricsCollector = Server("Metrics Collector")
with Cluster("Metrics Sources"):
web_servers = Nginx("Web Servers")
db_clusters = MySQL("DB Clusters")
queue_clusters = RabbitMQ("Queue Clusters")
cache_clusters = Redis("Cache Clusters")
Edge(label="Pull Metrics") << web_servers << metricsCollector
Edge(label="Pull Metrics") << db_clusters << metricsCollector
Edge(label="Pull Metrics") << queue_clusters << metricsCollector
Edge(label="Pull Metrics") << cache_clusters << metricsCollector
with Cluster("Service Discovery"):
service_directory = Etcd("Service Directory")
zookeeper = Server("ZooKeeper")
# Metrics Collector Service sending a message to the Service Directory Service
metricsCollector >> service_directory
metricsCollector >> zookeeper