Skip to content

Commit 4f6e534

Browse files
committed
Set to us east, added gitignore, added a couple of other files
1 parent c678cdb commit 4f6e534

5 files changed

+348
-7
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.pyc
2+
.ipynb_checkpoints
3+
.vscode
4+

azureexercizer.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
class AzureExercizer(Exercizer):
77
def __init__(self, env_credentials):
88
Exercizer.__init__(self)
9-
self.blob_service = BlockBlobService(
9+
self.storage_client = BlockBlobService(
1010
os.environ.get(env_credentials['account']),
1111
os.environ.get(env_credentials['secret']))
1212

1313
def UploadObjectsToContainer(self, container_name='blobtester', localDir = '/tmp/smalldir'):
14-
self.blob_service.create_container(container_name)
14+
self.storage_client.create_container(container_name)
1515
dic_uploadData = {}
1616
for root, dirs, files in os.walk(localDir):
1717
for name in files:
1818
filePath = join(root,name)
1919
self.startTimer()
2020
try:
21-
self.blob_service.create_blob_from_path(container_name,
21+
self.storage_client.create_blob_from_path(container_name,
2222
name, filePath)
2323
dic_uploadData[filePath] = (self.endTimer(), getsize(filePath))
2424
except:
@@ -32,7 +32,7 @@ def ListObjectsInContainer(self, container_name = 'blobtester'):
3232
'''
3333
Return generator with the list of blob names
3434
'''
35-
return self.blob_service.list_blobs(container_name)
35+
return self.storage_client.list_blobs(container_name)
3636

3737
def DownloadObjectsFromContainer(self, container_name = 'blobtester', localDir = '/tmp/smalldir'):
3838
dic_downloadData = {}
@@ -42,13 +42,13 @@ def DownloadObjectsFromContainer(self, container_name = 'blobtester', localDir =
4242
for aBlob in blobListGenerator:
4343
self.startTimer()
4444
localPath = join(localDir,aBlob.name)
45-
self.blob_service.get_blob_to_path(container_name, aBlob.name, localPath )
45+
self.storage_client.get_blob_to_path(container_name, aBlob.name, localPath )
4646
dic_downloadData[localPath] = (self.endTimer(), getsize(localPath))
4747
return dic_downloadData
4848

4949
def DeleteContainer(self, container_name='blobtester'):
5050
self.startTimer()
51-
self.blob_service.delete_container(container_name)
51+
self.storage_client.delete_container(container_name)
5252
return {container_name: self.endTimer(), 'operation':'Deleted'}
5353

5454

dirstats.ipynb

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 28,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# Get file size distribution\n",
10+
"import sys\n",
11+
"import os\n",
12+
"import pandas as pd\n",
13+
"\n",
14+
"dictFileStats = {}\n",
15+
"from os.path import join, getsize\n",
16+
"\n",
17+
"if len(sys.argv) == 2:\n",
18+
" rootDir = sys.argv[1]\n",
19+
"else:\n",
20+
" rootDir = '/root/throwaway/linux-4.16.12'\n",
21+
"\n",
22+
"for root, dirs, files in os.walk(rootDir):\n",
23+
" for name in files:\n",
24+
" filePath = join(root,name)\n",
25+
" dictFileStats[filePath] = getsize(filePath)\n",
26+
"\n"
27+
]
28+
},
29+
{
30+
"cell_type": "code",
31+
"execution_count": 29,
32+
"metadata": {},
33+
"outputs": [],
34+
"source": [
35+
"ser_fileSizes = pd.Series(dictFileStats)"
36+
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": 30,
41+
"metadata": {},
42+
"outputs": [
43+
{
44+
"data": {
45+
"text/plain": [
46+
"/root/throwaway/linux-4.16.12/.cocciconfig 59\n",
47+
"/root/throwaway/linux-4.16.12/.get_maintainer.ignore 31\n",
48+
"/root/throwaway/linux-4.16.12/.gitattributes 30\n",
49+
"/root/throwaway/linux-4.16.12/.gitignore 1571\n",
50+
"/root/throwaway/linux-4.16.12/.mailmap 9142\n",
51+
"/root/throwaway/linux-4.16.12/COPYING 18693\n",
52+
"/root/throwaway/linux-4.16.12/CREDITS 98556\n",
53+
"/root/throwaway/linux-4.16.12/Documentation/.gitignore 13\n",
54+
"/root/throwaway/linux-4.16.12/Documentation/00-INDEX 15136\n",
55+
"/root/throwaway/linux-4.16.12/Documentation/ABI/README 3821\n",
56+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-bus-usb 1296\n",
57+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-arvo 2892\n",
58+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-isku 8101\n",
59+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus 8003\n",
60+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-konepure 5616\n",
61+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus 6315\n",
62+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-lua 372\n",
63+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-pyra 6376\n",
64+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-ryos 9380\n",
65+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-savu 4062\n",
66+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-firmware-acpi 384\n",
67+
"/root/throwaway/linux-4.16.12/Documentation/ABI/obsolete/sysfs-gpio 1325\n",
68+
"/root/throwaway/linux-4.16.12/Documentation/ABI/removed/devfs 471\n",
69+
"/root/throwaway/linux-4.16.12/Documentation/ABI/removed/dv1394 664\n",
70+
"/root/throwaway/linux-4.16.12/Documentation/ABI/removed/ip_queue 310\n",
71+
"/root/throwaway/linux-4.16.12/Documentation/ABI/removed/net_dma 339\n",
72+
"/root/throwaway/linux-4.16.12/Documentation/ABI/removed/o2cb 449\n",
73+
"/root/throwaway/linux-4.16.12/Documentation/ABI/removed/raw1394 663\n",
74+
"/root/throwaway/linux-4.16.12/Documentation/ABI/removed/sysfs-class-rfkill 488\n",
75+
"/root/throwaway/linux-4.16.12/Documentation/ABI/removed/video1394 751\n",
76+
" ... \n",
77+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/pmu.c 15373\n",
78+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/psci.c 12107\n",
79+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/trace.h 6258\n",
80+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/trace.h 884\n",
81+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-debug.c 6555\n",
82+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-init.c 13748\n",
83+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-irqfd.c 3310\n",
84+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-its.c 66206\n",
85+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-kvm-device.c 15907\n",
86+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-mmio-v2.c 13364\n",
87+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-mmio-v3.c 25775\n",
88+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-mmio.c 21850\n",
89+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-mmio.h 6982\n",
90+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-v2.c 12489\n",
91+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-v3.c 16662\n",
92+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic-v4.c 10672\n",
93+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic.c 24860\n",
94+
"/root/throwaway/linux-4.16.12/virt/kvm/arm/vgic/vgic.h 9698\n",
95+
"/root/throwaway/linux-4.16.12/virt/kvm/async_pf.c 5968\n",
96+
"/root/throwaway/linux-4.16.12/virt/kvm/async_pf.h 1126\n",
97+
"/root/throwaway/linux-4.16.12/virt/kvm/coalesced_mmio.c 4251\n",
98+
"/root/throwaway/linux-4.16.12/virt/kvm/coalesced_mmio.h 884\n",
99+
"/root/throwaway/linux-4.16.12/virt/kvm/eventfd.c 23043\n",
100+
"/root/throwaway/linux-4.16.12/virt/kvm/irqchip.c 6280\n",
101+
"/root/throwaway/linux-4.16.12/virt/kvm/kvm_main.c 97591\n",
102+
"/root/throwaway/linux-4.16.12/virt/kvm/vfio.c 9110\n",
103+
"/root/throwaway/linux-4.16.12/virt/kvm/vfio.h 289\n",
104+
"/root/throwaway/linux-4.16.12/virt/lib/Kconfig 36\n",
105+
"/root/throwaway/linux-4.16.12/virt/lib/Makefile 48\n",
106+
"/root/throwaway/linux-4.16.12/virt/lib/irqbypass.c 6116\n",
107+
"Length: 62908, dtype: int64"
108+
]
109+
},
110+
"execution_count": 30,
111+
"metadata": {},
112+
"output_type": "execute_result"
113+
}
114+
],
115+
"source": [
116+
"ser_fileSizes"
117+
]
118+
},
119+
{
120+
"cell_type": "code",
121+
"execution_count": 38,
122+
"metadata": {},
123+
"outputs": [
124+
{
125+
"name": "stdout",
126+
"output_type": "stream",
127+
"text": [
128+
"count 6.290800e+04\n",
129+
"mean 1.248228e+04\n",
130+
"std 9.156178e+04\n",
131+
"min 0.000000e+00\n",
132+
"25% 1.382000e+03\n",
133+
"50% 3.973500e+03\n",
134+
"75% 1.122200e+04\n",
135+
"max 1.415147e+07\n",
136+
"dtype: float64\n"
137+
]
138+
}
139+
],
140+
"source": [
141+
"print (ser_fileSizes.describe())"
142+
]
143+
},
144+
{
145+
"cell_type": "code",
146+
"execution_count": 36,
147+
"metadata": {},
148+
"outputs": [],
149+
"source": [
150+
"\n"
151+
]
152+
},
153+
{
154+
"cell_type": "code",
155+
"execution_count": 39,
156+
"metadata": {},
157+
"outputs": [
158+
{
159+
"name": "stdout",
160+
"output_type": "stream",
161+
"text": [
162+
"[62900 3 1 0 2 0 0 0 0 2]\n"
163+
]
164+
}
165+
],
166+
"source": [
167+
"print (count)"
168+
]
169+
},
170+
{
171+
"cell_type": "code",
172+
"execution_count": null,
173+
"metadata": {},
174+
"outputs": [],
175+
"source": []
176+
}
177+
],
178+
"metadata": {
179+
"kernelspec": {
180+
"display_name": "Python 3",
181+
"language": "python",
182+
"name": "python3"
183+
},
184+
"language_info": {
185+
"codemirror_mode": {
186+
"name": "ipython",
187+
"version": 3
188+
},
189+
"file_extension": ".py",
190+
"mimetype": "text/x-python",
191+
"name": "python",
192+
"nbconvert_exporter": "python",
193+
"pygments_lexer": "ipython3",
194+
"version": "3.6.5"
195+
}
196+
},
197+
"nbformat": 4,
198+
"nbformat_minor": 2
199+
}

gcpexercizer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from exercizer import Exercizer
55
from traceback import format_exc
66
class GCPExercizer(Exercizer):
7-
def __init__(self, region_name = 'northamerica-northeast1', storage_class = 'REGIONAL'):
7+
def __init__(self, region_name = 'us-east1', storage_class = 'REGIONAL'):
88
Exercizer.__init__(self)
99
self.storage_client = google.cloud.storage.Client()
1010
self.region_name = region_name

0 commit comments

Comments
 (0)