Skip to content

Commit

Permalink
fixes on grafana style
Browse files Browse the repository at this point in the history
  • Loading branch information
FloSch62 committed Apr 17, 2024
1 parent a194312 commit 6bbd219
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions clab2drawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ def add_ports(diagram, styles, verbose=True):
style=styles['connector_style']
)

diagram.add_link(source=source_cID, target=midpoint_id, style=styles["link_style"], label='rate', link_id=f"{source_cID}")
diagram.add_link(source=target_cID, target=midpoint_id, style=styles["link_style"], label='rate', link_id=f"{target_cID}")
diagram.add_link(source=source_cID, target=midpoint_id, style=styles["link_style"], label='\u200B', link_id=f"{source_cID}")
diagram.add_link(source=target_cID, target=midpoint_id, style=styles["link_style"], label='\u200B', link_id=f"{target_cID}")


# Create groups for each node and its connectors
Expand Down
2 changes: 1 addition & 1 deletion lib/Grafana.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create_dashboard(self):
"legend_format": 'oper_state:{{source}}:{{interface_name}}',
},
"EgressTraffic2": {
"rule_expr": "rate(port_ethernet_statistics_out_octets[10s])*8",
"rule_expr": "irate(port_ethernet_statistics_out_octets[$__rate_interval])*8",
"legend_format": '{{source}}:{{interface_name}}:out',
},
}
Expand Down
16 changes: 8 additions & 8 deletions lib/templates/traffic_rule_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"decimals": 1,
"gradient": false,
"hidden": false,
"invert": false,
"invert": true,
"mappingType": 1,
"mapsDat": {
"events": {
Expand Down Expand Up @@ -66,7 +66,7 @@
{
"hidden": false,
"pattern": "",
"textOn": "wmd",
"textOn": "wc",
"textPattern": "/.*/",
"textReplace": "content"
}
Expand All @@ -89,20 +89,20 @@
{
"color": "rgba(75, 221, 51, 1)",
"comparator": "ge",
"level": 0,
"value": 500000
"value": 500000,
"level": 0
},
{
"color": "rgba(255, 128, 0, 1)",
"comparator": "gt",
"level": 0,
"value": 2000000
"value": 2000000,
"level": 0
},
{
"color": "rgba(245, 54, 54, 0.9)",
"comparator": "ge",
"level": 0,
"value": 5000000
"value": 5000000,
"level": 0
}
],
"order": 0,
Expand Down
2 changes: 1 addition & 1 deletion styles/grafana_dark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ connector_width: 8
connector_height: 8

# Style for links between nodes
link_style: "rounded=0;orthogonalLoop=1;jettySize=auto;html=1;startSize=6;endArrow=classicThin;endFill=1;endSize=2;fontSize=8;strokeColor=#98A2AE;fontSize=6;fontColor=#FFFFFF;textOpacity=60;labelBackgroundColor=#4D5766;jumpStyle=gap;"
link_style: "rounded=0;orthogonalLoop=1;html=1;startSize=6;endArrow=classicThin;endFill=1;endSize=2;fontSize=10;strokeColor=#98A2AE;fontColor=#FFFFFF;textOpacity=60;labelBackgroundColor=#4D5766;jumpStyle=gap;"

# Styles for labels on the source and target ends of a link
src_label_style: "edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=6;fontColor=#FFFFFF;textOpacity=60;labelBackgroundColor=#4D5766;"
Expand Down

0 comments on commit 6bbd219

Please sign in to comment.