From f361d4e4e9f1c26801f112cf13a9787b4dac0812 Mon Sep 17 00:00:00 2001 From: Ivan Daniluk Date: Sun, 3 May 2015 22:26:32 +0300 Subject: [PATCH] Update README.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 847b846..ee04519 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,13 @@ Just run expvarmon with -ports="1234" parameter: That's it. +More examples: + + ./expvarmon -ports="80" + ./expvarmon -ports="23000-23010,80" -i=1m + ./expvarmon -ports="80,remoteapp:80" -vars="mem:memstats.Alloc,duration:Response.Mean,Counter" + ./expvarmon -ports="1234-1236" -vars="Goroutines" -self + ## Advanced usage If you need to monitor more (or less) vars, you can specify them with -vars command line flag. @@ -94,6 +101,10 @@ You can also monitor expvarmon itself, using -self flag. ### Vars +Expvarmon doesn't restrict you to monitor only memstats. You can publish you own counters and variables using expvar.Publish() method or using expvar wrappers libraries. Just pass you variables names as they appear in JSON to -var command line flag. + +Notation is dot-separated, for example: **memstats.Alloc** for .MemStats.Alloc field. Quick link to runtime.MemStats documentation: http://golang.org/pkg/runtime/#MemStats + Expvar allows to export only basic types - structs, ints, floats, bools and strings. Ints are used for sparklines, and displayed as is. But you can spefify modifier to make sure it will be rendered properly. Vars are specified as a comma-separated list of var identifiers with (optional) modifiers.