Skip to content

Commit

Permalink
benchmarks
Browse files Browse the repository at this point in the history
Signed-off-by: Parul Singh <parsingh@redhat.com>
  • Loading branch information
husky-parul committed Sep 5, 2024
1 parent f64a221 commit 1de3894
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 0 deletions.
84 changes: 84 additions & 0 deletions benchmarks/kepler-power/benchmarks.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import csv\n",
"with open('eggs.csv', 'w', newline='') as csvfile:\n",
" spamwriter = csv.writer(csvfile, delimiter=' ',\n",
" quotechar='|', quoting=csv.QUOTE_MINIMAL)\n",
" spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n",
" spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"stress-ng --cpu 2--cpu-method int64 -t 60s\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"stress-ng: unrecognized option '--cpu-method int64'\n"
]
},
{
"data": {
"text/plain": [
"\"Try 'stress-ng --help' for more information.\\n\""
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import csv\n",
"import subprocess\n",
"with open('kepler-data.csv', 'w', newline='') as csvfile:\n",
" wr = csv.writer(csvfile, delimiter=',',quotechar=' ', quoting=csv.QUOTE_MINIMAL)\n",
" wr.writerow(['Package Power From Kepler', 'Number of CPUs'])\n",
"\n",
"cpu_num = 2\n",
"time=60\n",
"cmd = \"stress-ng --cpu \"+str(cpu_num)+\"--cpu-method int64 -t \"+str(time)+\"s\"\n",
"print(cmd)\n",
"process1=subprocess.run([\"stress-ng\",\"--cpu\",str(cpu_num),\" --cpu-method int64\",\"-t\",str(time)+\"s\"], stdout=subprocess.PIPE, text=True) \n",
"process1.stdout\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
2 changes: 2 additions & 0 deletions benchmarks/kepler-power/eggs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Spam Spam Spam Spam Spam |Baked Beans|
Spam |Lovely Spam| |Wonderful Spam|
1 change: 1 addition & 0 deletions benchmarks/kepler-power/kepler-data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package Power From Kepler , Number of CPUs
32 changes: 32 additions & 0 deletions benchmarks/peaks_deployment/stressng.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: stress-ng
spec:
replicas: 1
selector:
matchLabels:
app: stress-ng
template:
metadata:
labels:
app: stress-ng
spec:
containers:
- name: stress-ng
image: quay.io/sustainability/stress-ng:0.16.02
imagePullPolicy: IfNotPresent
env:
- name: TIMEOUT
value: "30"
securityContext:
privileged: true
resources:
limits:
cpu: "1" # Set the CPU limit (in CPU units)
command: ["stress-ng"]
args:
- "--cpu"
- "1" # Number of workers stressing the CPU
- "--cpu-load"
- "30" # CPU load percentage

0 comments on commit 1de3894

Please sign in to comment.