Skip to content

Instantly share code, notes, and snippets.

@alq666
Created March 5, 2012 20:52
Show Gist options
  • Save alq666/1980998 to your computer and use it in GitHub Desktop.
Save alq666/1980998 to your computer and use it in GitHub Desktop.
aws crawler stats
BEGIN {
skipped = 0;
processed = 0;
}
/Skipped/ {
skipped++;
}
/Saving/ {
if (match($0, /pts for ([^ ]+) /, arr)) {
split(arr[1], metric, /\./);
metrics[metric[2]]++;
suffix=metric[length(metric)];
if (suffix == "min" || suffix == "max" || suffix == "count" || suffix == "sum") {
print "ignoring", arr[1], "in query count";
} else {
processed++;
}
}
if (match($0, /host=([^, ]+)/, arr)) {
hosts[arr[1]]++;
}
}
END {
print "Skipped", skipped;
print "Queried", processed;
print "Total", skipped + processed;
print "Hosts", length(hosts);
print "Metrics";
for (m in metrics) {
print m, metrics[m];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment