This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmp = dat_clean | |
tmp = tmp.groupby(['host','host-type','url']).size().reset_index(name='Count') | |
tmp = tmp.groupby(['host-type']).sum().reset_index() | |
tmp = tmp.sort_values(by=['Count'],ascending=False) | |
plt.pie(tmp['Count'],labels=tmp['host-type'],shadow=False,autopct='%1.1f%%') | |
plt.title('First vs Third Party') | |
plt.axis('equal') | |
plt.tight_layout() | |
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmp = dat_clean | |
tmp = tmp[tmp['host-type'] == 'Third Party'] | |
tmp = tmp[["host", "send","ttfb", "receive"]] | |
tmp = tmp.groupby('host')[ "send", "ttfb", "receive"].mean().reset_index() | |
tmp.plot(x="host", kind="bar", stacked=True,label='Series') | |
plt.title('Third Party Timings') | |
plt.xlabel('Domains') | |
plt.ylabel('Milliseconds') | |
plt.show() | |
del tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colmms = ['url','host','host-type','method','status','ext','cpcode','ttl','server','cdn-cache','cdn-cache-parent','cdn-cache-key','cdn-req-id','vary','appOrigin','content-length','content-length-origin','blocked','dns','ssl','connect','send','ttfb','receive','edgeTime','originTime' | |
] | |
dat_clean = pd.DataFrame(columns=colmms) | |
for r in har['log']['entries']: | |
u = str(r['request']['url']).split('?')[0] | |
host = re.search('://(.+?)/', u, re.IGNORECASE).group(0).replace(':','').replace('/','') | |
cachekey = str(findHeader(r,'response','x-cache-key','eq')) | |
if not cachekey == 'None': | |
cachekey = cachekey.split('/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def findHeader(req,headertype,headername,op = None): | |
value = "None" | |
if headertype == 'response': | |
for h in req['response']['headers']: | |
if op == 'in': | |
if headername in h['name']: | |
value = h['value'] | |
break | |
else: | |
if headername == h['name']: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
akamai_property.myProperty: Still modifying... [id=prp_xxxx, 10s elapsed] | |
Error: Error - Invalid Property Rules | |
Rule validation error: https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required The Normalize Path option on the `Path` match is required. | |
Rule validation error: https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required The Normalize Path option on the `Path` match is required. | |
Rule validation error: https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required The Normalize Path option on the `Path` match is required. | |
Rule validation error: https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required The Normalize Path option on the `Path` match is required. | |
Rule validation error: https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required The Normalize Path option on the `Path` match is required. | |
on property.tf line 20, in resource "akamai_property" "myProperty": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { | |
docker { | |
image 'akamai/property:latest' | |
} | |
} | |
stages { | |
stage('Fetch Template Configuration') { | |
steps { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def purgeCPCODE(CP=None): | |
#Fetch Credentials from Env Variables from AWS | |
AO_ACCESS_TOKEN = os.environ['AO_ACCESS_TOKEN'] | |
AO_CLIENT_SECRET = os.environ['AO_CLIENT_SECRET'] | |
AO_API_HOST = os.environ['AO_API_HOST'] | |
AO_CLIENT_TOKEN = os.environ['AO_CLIENT_TOKEN'] | |
apiRequest = requests.Session() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, os, requests, boto3 | |
# Akamai Open Libs | |
from akamai.netstorage import Netstorage, NetstorageError | |
from akamai.edgegrid import EdgeGridAuth | |
def purgeCPCODE(CP=None): | |
#Fetch Credentials from Env Variables from AWS |
NewerOlder