Skip to content

Commit

Permalink
docs(edges): update edges example code
Browse files Browse the repository at this point in the history
  • Loading branch information
mingrammer committed Feb 20, 2021
1 parent bc14aec commit 0c541c6
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions docs/guides/edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from diagrams.onprem.analytics import Spark
from diagrams.onprem.compute import Server
from diagrams.onprem.database import PostgreSQL
from diagrams.onprem.inmemory import Redis
from diagrams.onprem.logging import Fluentd
from diagrams.onprem.aggregator import Fluentd
from diagrams.onprem.monitoring import Grafana, Prometheus
from diagrams.onprem.network import Nginx
from diagrams.onprem.queue import Kafka
Expand All @@ -36,18 +36,34 @@ with Diagram(name="Advanced Web Service with On-Premise (colored)", show=False):

with Cluster("Sessions HA"):
master = Redis("session")
master - Edge(color="brown", style="dashed") - Redis("replica") << Edge(label="collect") << metrics
master \
- Edge(color="brown", style="dashed") \
- Redis("replica") \
<< Edge(label="collect") \
<< metrics
grpcsvc >> Edge(color="brown") >> master

with Cluster("Database HA"):
master = PostgreSQL("users")
master - Edge(color="brown", style="dotted") - PostgreSQL("slave") << Edge(label="collect") << metrics
master \
- Edge(color="brown", style="dotted") \
- PostgreSQL("slave") \
<< Edge(label="collect") \
<< metrics
grpcsvc >> Edge(color="black") >> master

aggregator = Fluentd("logging")
aggregator >> Edge(label="parse") >> Kafka("stream") >> Edge(color="black", style="bold") >> Spark("analytics")
aggregator \
>> Edge(label="parse") \
>> Kafka("stream") \
>> Edge(color="black", style="bold") \
>> Spark("analytics")

ingress >> Edge(color="darkgreen") << grpcsvc >> Edge(color="darkorange") >> aggregator
ingress \
>> Edge(color="darkgreen") \
<< grpcsvc \
>> Edge(color="darkorange") \
>> aggregator
```

![advanced web service with on-premise diagram colored](/img/advanced_web_service_with_on-premise_colored.png)

0 comments on commit 0c541c6

Please sign in to comment.