From 5d63e3471a8c0f59d409c5bdfd8d351e1025573c Mon Sep 17 00:00:00 2001 From: Rahul Somasunderam Date: Tue, 21 Apr 2015 18:02:56 -0700 Subject: [PATCH] Added script to grep logs. Removed unused groovelet --- logstat.sh | 17 +++++++++++++++++ .../WEB-INF/groovy/datastoreGroovlet.groovy | 19 ------------------- src/main/webapp/WEB-INF/routes.groovy | 10 +++++----- 3 files changed, 22 insertions(+), 24 deletions(-) create mode 100755 logstat.sh delete mode 100644 src/main/webapp/WEB-INF/groovy/datastoreGroovlet.groovy diff --git a/logstat.sh b/logstat.sh new file mode 100755 index 0000000..7b90e29 --- /dev/null +++ b/logstat.sh @@ -0,0 +1,17 @@ +#!/bin/bash +if [ ! -f /tmp/logs.txt ]; then + ~/.gradle/appengine-sdk/appengine-java-sdk-1.9.1/bin/appcfg.sh request_logs build/exploded-app /tmp/logs.txt +fi +cat /tmp/logs.txt \ + | sed -e "s/.*GET//g" | sed -e "s/.*POST//g" \ + | cut -d " " -f 2 | sort \ + | sed -e "s/\/u\/.*/\/u\/hash/g" \ + | sed -e "s/\/r\/.*/\/r\/hash/g" \ + | sed -e "s/\/i\/.*/\/i\/hash/g" \ + | sed -e "s/\/p\/.*/\/p\/hash/g" \ + | sed -e "s/\/m\/.*/\/m\/hash/g" \ + | sed -e "s/\/g\/.*/\/g\/user/g" \ + | sed -e "s/\/g\?.*/\/g\?random/g" \ + | sed -e "s/\/auth\/me.*/\/auth\/me/g" \ + | sed -e "s/\/l\/.*/\/l\/user/g" \ + | uniq -c diff --git a/src/main/webapp/WEB-INF/groovy/datastoreGroovlet.groovy b/src/main/webapp/WEB-INF/groovy/datastoreGroovlet.groovy deleted file mode 100644 index 8184237..0000000 --- a/src/main/webapp/WEB-INF/groovy/datastoreGroovlet.groovy +++ /dev/null @@ -1,19 +0,0 @@ -import com.google.appengine.api.datastore.* - -def k = new KeyFactory.Builder("Person", "GreatGrandpa").getKey() -log.info k.toString() -log.info KeyFactory.keyToString(k) - -def e = new Entity("person") -e.firstname = 'Marco' -e.lastname = 'Vermeulen' -e.save() -log.info e -log.info e.key - -e = new Entity("person") -e.firstname = 'Marco' -e.lastname = 'Rubio' -e.save() -log.info e -log.info e.key \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/routes.groovy b/src/main/webapp/WEB-INF/routes.groovy index adf3bcd..b8fea89 100644 --- a/src/main/webapp/WEB-INF/routes.groovy +++ b/src/main/webapp/WEB-INF/routes.groovy @@ -1,13 +1,13 @@ all "/", forward: "/index.groovy" all "/g", forward: "/random.groovy" -all "/g/@username", forward: "/random.groovy?username=@username" -all "/upload", forward: "/upload.groovy" -post "/save", forward: "/store.groovy" -get "/browse", forward: "/browse.groovy" +all "/g/@username", forward: "/random.groovy?username=@username" +all "/upload", forward: "/upload.groovy" +post "/save", forward: "/store.groovy" +get "/browse", forward: "/browse.groovy" all "/i/@hash", forward: "/load.groovy?hash=@hash" all "/u/@hash", forward: "/upvote.groovy?hash=@hash" all "/m/@hash", forward: "/mylist.groovy?hash=@hash" -all "/l/@username", forward: "/userlist.groovy?username=@username" +all "/l/@username", forward: "/userlist.groovy?username=@username" all "/r/@hash", forward: "/report.groovy?hash=@hash" all "/p/@hash", forward: "/picture.groovy?hash=@hash" all "/d/@hash", forward: "/delete.groovy?hash=@hash"