Skip to content

Instantly share code, notes, and snippets.

@willtonkin
Created May 15, 2018 09:43
Show Gist options
  • Save willtonkin/6963229276f24632317bd6059ffb23c6 to your computer and use it in GitHub Desktop.
Save willtonkin/6963229276f24632317bd6059ffb23c6 to your computer and use it in GitHub Desktop.
get AEM component render timings on author
#!/bin/bash
RAND="$RANDOM"
server="http://localhost:4502"
#workingPath="/content/wel-demo"
#relPath="/en"
workingPath="/content/ewp-marketing-websites/thomsonreuters/gl/en/about-us"
relPath="/executive-team"
curl -f -u admin:admin -F:operation=copy -F:dest=$workingPath/$RAND $server$workingPath$relPath
#curl -u admin:admin $server$workingPath/$RAND.html | \
#curl -u admin:admin $server/content/geometrixx-outdoors/en.html | \
cat untitled.log | \
awk ' /'\<\!--cq'/ {print $0}' | \
awk -F "," '
{
for (i=0; i<=NF; i++) {
if ($i~/^\"type\"/) {
a=$i
}
if ($i~/^\"path\"/) {
b=$i
}
if ($i~/^\"totalTime\"/) {
c=$i
}
}
print substr(a, 9, length(a) - 9),
substr(b, 9, length(b) - 9),
substr(c, 13) "ms"
}
'
echo $server$workingPath/$RANDOM.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment