All Projects → mcuadros → go-monitor

mcuadros / go-monitor

Licence: MIT license
a simple and extensible way to build monitorizable go process via HTTP.

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to go-monitor

busybox
DEPRECATED - Fork of git://android.git.linaro.org/platform/external/busybox.git
Stars: ✭ 40 (+21.21%)
Mutual labels:  abandoned
tmwa
DEPRECATED: The server running The Mana World Legacy. All new projects should use Hercules instead. See the "evol-hercules" repo.
Stars: ✭ 44 (+33.33%)
Mutual labels:  abandoned
openwrt-brook-tproxy
Abandoned, DO NOT star and fork!
Stars: ✭ 31 (-6.06%)
Mutual labels:  abandoned
oauthorizer
DEPRECATED - Enable easy use of oauth for other addons
Stars: ✭ 26 (-21.21%)
Mutual labels:  abandoned
rescuefox
DEPRECATED - demo game to drive 3D engine creation: rescue your pet space fox!
Stars: ✭ 35 (+6.06%)
Mutual labels:  abandoned
Mozdef
DEPRECATED - MozDef: Mozilla Enterprise Defense Platform
Stars: ✭ 2,164 (+6457.58%)
Mutual labels:  abandoned
django-kb
Simple knowledge base made with django
Stars: ✭ 15 (-54.55%)
Mutual labels:  abandoned
vmw.vco
Python bindings for VMware Orchestrator
Stars: ✭ 13 (-60.61%)
Mutual labels:  abandoned
elmo
DEPRECATED - Elmo ~ https://mozilla.github.io/elmo/
Stars: ✭ 32 (-3.03%)
Mutual labels:  abandoned
Hasal
DEPRECATED - A Framework for testing web performance between different browser
Stars: ✭ 30 (-9.09%)
Mutual labels:  abandoned
page-metadata-service
DEPRECATED - A RESTful service that returns the metadata about a given URL.
Stars: ✭ 18 (-45.45%)
Mutual labels:  abandoned
web-forward
DEPRECATED - Innovation acceleration program from Mozilla Labs
Stars: ✭ 17 (-48.48%)
Mutual labels:  abandoned
gradle-natives
Gradle plugin to aid in managing native libraries associated with Java-based projects.
Stars: ✭ 32 (-3.03%)
Mutual labels:  abandoned
iris
DEPRECATED - A Python 3 automation test tool for desktop applications
Stars: ✭ 18 (-45.45%)
Mutual labels:  abandoned
homeassistant-coronavirus-hessen
[Unmaintained] Home Assistant component to scrape the current SARS-CoV-2 data for the German state of Hessen from the website of the Hessisches Ministerium für Soziales und Integration.
Stars: ✭ 15 (-54.55%)
Mutual labels:  abandoned
iris firefox
DEPRECATED - Test Suite for Firefox using Mozilla Iris
Stars: ✭ 41 (+24.24%)
Mutual labels:  abandoned
Gaia
DEPRECATED - Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see
Stars: ✭ 2,091 (+6236.36%)
Mutual labels:  abandoned
npm-mirror
DEPRECATED - A utility for mirroring a subset of npm packages from another npm registry
Stars: ✭ 38 (+15.15%)
Mutual labels:  abandoned
oldiconutil
A command-line tool to postprocess iconutil-generated .icns files to make them compatible with Mac OS X 10.5
Stars: ✭ 25 (-24.24%)
Mutual labels:  abandoned
html5-settlers-of-catan
🎲 Unfinished HTML5 game based on Catan using node.js and socket.io
Stars: ✭ 23 (-30.3%)
Mutual labels:  abandoned

go-monitor Build Status GoDoc GitHub release

The main goal of go-monitor is provide a simple and extensible way to build monitorizable long term execution processes or daemons via HTTP.

Thanks to the defaults aspects you can monitorize parameters as runtime, memory, etc. for any Go processes and daemons. As well you can create your custom aspects for monitorize custom parameters from your applications.

Installation

The recommended way to install go-monitor

go get gopkg.in/mcuadros/go-monitor.v1

Examples

Default Monitor

Import the package:

import "gopkg.in/mcuadros/go-monitor.v1"

Start the monitor just before of the bootstrap of your code:

m := monitor.NewMonitor(":9000")
m.Start()

Now just try curl http://localhost:9000/

{
  "MemStats": {
    "Alloc": 7716521256,
    "TotalAlloc": 1935822232552,
    "Sys": 46882078488,
    ...
  },
  "Runtime": {
    "GoVersion": "go1.3.3",
    "GoOs": "linux",
    "GoArch": "amd64",
    "CpuNum": 24,
    "GoroutineNum": 21196,
    "Gomaxprocs": 24,
    "CgoCallNum": 111584
  }
}

At the / you can find all the aspects that are loaded by default, you can request other aspects through the URL /<aspect-name>,<aspect-name>

Custom Monitor

Define your custom aspect, in this case just a simple one that count the number of hits on it.

type CustomAspect struct {
  Count int
}

func (a *CustomAspect) GetStats() interface{} {
  a.Count++
  return a.Count
}

func (a *CustomAspect) Name() string {
  return "Custom"
}

func (a *CustomAspect) InRoot() bool {
  return false
}

Now just add the CustomAspect to the monitor and run it.

m := monitor.NewMonitor(":9000")
m.AddAspect(&CustomAspect{})
m.Start()

Hit http://localhost:9000/Custom and obtain:

{
  "Custom": 5
}

License

MIT, see LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].