Git Product home page Git Product logo

gin-stats-handler's Introduction

golang-stats-api-handler available for framework "gin"

Install

go get github.com/tkitsunai/gin-stats-handler

or,

If you use "dep" for package manager.

dep ensure -add github.com/tkitsunai/gin-stats-handler

If you use "glide" for package manager.

glide get github.com/tkitsunai/gin-stats-handler

Usage Example

import (
	"net/http"

	"github.com/gin-gonic/gin"
	"github.com/tkitsunai/gin-stats-handler"
)

func main() {
	g := gin.Default()
	g.GET("/stats", gin-stats-handler.Stats())
	g.Run()
}

Response

{
	time: 1533935033459278600,
	go_version: "go1.10.3",
	go_os: "darwin",
	go_arch: "amd64",
	cpu_num: 4,
	goroutine_num: 4,
	gomaxprocs: 4,
	cgo_call_num: 1,
	memory_alloc: 972552,
	memory_total_alloc: 972552,
	memory_sys: 5343480,
	memory_lookups: 6,
	memory_mallocs: 8485,
	memory_frees: 280,
	memory_stack: 360448,
	heap_alloc: 972552,
	heap_sys: 2785280,
	heap_idle: 786432,
	heap_inuse: 1998848,
	heap_released: 0,
	heap_objects: 8205,
	gc_next: 4473924,
	gc_last: 0,
	gc_num: 0,
	gc_per_second: 0,
	gc_pause_per_second: 0,
	gc_pause: [ ]
}

using in framework "gin-gonic"

gin-stats-handler's People

Contributors

takayuki-kitsunai-ub avatar tkitsunai avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.