Skip to content

Newlode/gin-stats

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gin's middleware for request stats

Build Status codecov Go Report Card GoDoc

Lightweight Gin's middleware for request metrics

Usage

Start using it

Download and install it:

$ go get github.com/newlode/gin-stats
import "github.com/newlode/gin-stats"

Example usage:

package main

import (
	"fmt"
	"time"

	"github.com/gin-gonic/gin"
	"github.com/newlode/gin-stats"    
)

func main() {
	r := gin.Default()
	r.Use(stats.RequestStats())
    
	r.GET("/stats", func(c *gin.Context) {
		c.JSON(http.StatusOK, stats.Report())
	})

	// Listen and Server in 0.0.0.0:8080
	r.Run(":8080")
}

About

Gin's middleware for request stats

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%