Monday, October 24, 2011

expvar

The expvar let you expose variables via HTTP/JSON protocol. Here at Adconion we call these metrics, and more than once they have been very instrumental in debugging and monitoring services.

We usually combine the metrics with an external monitoring system such as Nagios or OpenNMS. We set some thresholds for alerts and also chart some of them metrics over time.

Below is a small demo on how to use the package.

Thursday, October 20, 2011

Tuesday, October 11, 2011

Number → English

Had some fun converting num2eng.py to Go and making it a web service.

Friday, October 7, 2011

Running Tests In Parallel

As of weekly.2011-10-06, parallel testing is here. In order to have you test run in parallel, add a call to t.Parallel() at the top of your test function. Then run gotest with --parallel N (where N > 1).

Things to notice:
  • A parallel test run in parallel only to other parallel tests. That means your non-parallel tests will run first and then your parallel ones.
  • A maximum of --parallel (a new gotest command line switch) tests will run in parallel. --parallel defaults to runtime.GOMAXPROCS(0) which is 1. This means the if you don't specify --parallel, your parallel tests will run one at a time.
/* MIKI: Analytics */