New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hashmonitor

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hashmonitor - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc