hashmonitor
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "hashmonitor", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "Matt Pizzimenti", | ||
@@ -5,0 +5,0 @@ "description": "Turn logs into metrics like a boss", |
@@ -6,8 +6,24 @@ # HashMonitor: Turn Logs Into Metrics Like A Boss | ||
**Log like this...** | ||
log("something #weird happened") | ||
log("something #weird with #networking took #load_seconds=3") | ||
log("something #weird with #networking took #load_seconds=2") | ||
**You'll get metrics like this...** | ||
{ | ||
weird: { count: 3 }, | ||
networking: { count: 2 }, | ||
seconds: { count: 2, mean: 2.5, median: 3, ... }, | ||
} | ||
## How does it work? | ||
By default, HashMonitor **reads text lines from stdin**, and every 30 seconds | ||
**writes JSON statistics to stdout**. You can pipe this JSON output into your | ||
favorite stats dashboard (tinyfeedback, statsd, etc) for easy visualization. | ||
**writes JSON statistics to stdout**. You can pipe this JSON output into: | ||
* your favorite stats dashboard (tinyfeedback, statsd, graphite, etc) | ||
* your favorite alerting tool (pagerduty, nagios, etc) | ||
### Example: counting warning events | ||
@@ -18,3 +34,3 @@ | ||
log("something weird happened #warn") | ||
log("something bad happened #warn") | ||
log("something odd happened #warn") | ||
@@ -93,2 +109,33 @@ log("something strange happened #warn") | ||
There ya go Boss! | ||
There ya go Boss! | ||
## How can I use HashMonitor to monitor my logs in {my favorite language}? | ||
The easiest way to pipe logfile over stdin into HashMonitor. Simple example: | ||
tail -F /var/log/my-service.log | hashmonitor | ||
...this will output JSON statistics about your hashtags every 30 seconds. | ||
## How can I use HashMonitor to monitor browser-side Javascript? | ||
HashMonitor has built-in HTTP access log parsing. You can slam logs into | ||
your favorite server (nginx, lighty, express, etc) with some simple Javascript: | ||
function myLogger(message) { | ||
(new Image).src = | ||
'//log.example.com/?hashmonitor=' + | ||
encodeURIComponent(message) | ||
} | ||
...hashmonitor will parse the "hashmonitor" query argument automatically: | ||
tail -F access.log | hashmonitor --parse-http-access | ||
...and you'll still see JSON statistics output for your hashtags every 30 | ||
seconds :) | ||
## References | ||
* original [blog post](http://www.olark.com/spw/2012/03/dont-break-the-internet-with-your-javascript/) | ||
* JSConf [slides](http://speakerdeck.com/u/mjpizz/p/monitor-like-a-boss) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
139
16348
11
0
3