Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dfaast
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Santhosh Kumar
dfaast
Commits
10c58302
You need to sign in or sign up before continuing.
Commit
10c58302
authored
May 03, 2024
by
SIVAPRASAD S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add graph.py
parent
060229ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
report/graph.py
report/graph.py
+37
-0
No files found.
report/graph.py
0 → 100644
View file @
10c58302
import
matplotlib.pyplot
as
plt
# Given values
cpu_utilization
=
[
10
,
30
,
40
,
50
,
60
,
80
,
90
,
100
]
avg_cpu_utilization
=
[
0.20
,
18.23
,
23.60
,
29.51
,
33.68
,
29.66
,
32.20
,
22.98
,
]
num_of_pods
=
[
1
,
1
,
2
,
2
,
2
,
3
,
3
,
5
]
# Plotting
plt
.
figure
(
figsize
=
(
10
,
6
))
# CPU Utilization on x-axis
plt
.
plot
(
cpu_utilization
,
avg_cpu_utilization
,
label
=
'Avg CPU Utilization'
,
marker
=
'o'
)
# Number of Pods
plt
.
plot
(
cpu_utilization
,
num_of_pods
,
label
=
'Number of Pods'
,
marker
=
'o'
)
plt
.
title
(
'Average CPU Utilization and Number of Pods vs. CPU Utilization'
)
plt
.
xlabel
(
'CPU Utilization Limit(
%
)'
)
plt
.
ylabel
(
'Average CPU Utilization(
%
)'
)
plt
.
legend
()
plt
.
grid
(
True
)
plt
.
text
(
100
,
5
,
'minReplicas: 1
\n
maxReplicas: 5
\n
Max CPU utilization: 40
%
'
,
bbox
=
dict
(
facecolor
=
'lightblue'
,
alpha
=
0.5
))
for
cpu
,
avg_cpu
,
pods
in
zip
(
cpu_utilization
,
avg_cpu_utilization
,
num_of_pods
):
plt
.
text
(
cpu
,
avg_cpu
,
f
'{avg_cpu}'
,
ha
=
'right'
,
va
=
'bottom'
)
plt
.
text
(
cpu
,
pods
,
f
'{pods}'
,
ha
=
'right'
,
va
=
'bottom'
)
plt
.
tight_layout
()
plt
.
show
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment