Usage bash test.sh "<url>" <no_samples>
url
- sample URL to test.no_samples
- no of samples to run. Default: 10
#!/bin/bash | |
# | |
# Ashutosh Agrawal | |
# http://blog.theprogrammer.in | |
# | |
# | |
# This bash script simply fetches the log for that hour from Amazon RDS, | |
# parse and genarlise it using mysql_slow_log_parser (https://gist.github.com/theprogrammerin/e3206a4ec7a7a4086ac2) | |
# and then push the parsed log to elastic search using logstash (slowquery.conf)(https://gist.github.com/theprogrammerin/034a3efd849112d166ea) | |
# For analysis on analytic tool like kibana. |
# | |
# | |
# Ashutosh Agrawal | |
# http://blog.theprogrammer.in | |
# | |
# 2014-11-20 v1.0 | |
# | |
# This is logstash [http://logstash.net/] config for parsing the data out of the | |
# modified slow query generated from | |
# https://gist.github.com/theprogrammerin/e3206a4ec7a7a4086ac2 |
#!/usr/bin/perl | |
# | |
# Ashutosh Agrawal | |
# http://blog.theprogrammer.in | |
# | |
# 2014-11-20 v1.0 | |
# | |
# This script is modified version of SQL parser written by | |
# | |
# Nathanial Hendler |
<?php | |
function linkify($string) | |
{ | |
$reg_exUrl = "@(https://|http://|www)[^<>[:space:]]+[[:alnum:]/]@"; | |
$links = array(); | |
preg_match_all($reg_exUrl, $string, $urls); | |
foreach ($urls[0] as $url) { | |
$string = str_replace($url, "[[:link:".(count($links)).":]]" , $string); | |
$force_http = ""; |
function loadDev(){ | |
var jq = document.createElement("script"); | |
jq.setAttribute("src","http://code.jquery.com/jquery-2.1.0.js") | |
document.head.appendChild(jq); | |
var us = document.createElement("script"); | |
us.setAttribute("src","http://underscorejs.org/underscore.js") | |
document.head.appendChild(us); | |
console.log("Loaded Jquery and Underscore") | |
} | |
loadDev() |