stati

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 8 Imported by: 0

README

Stati

stati-logo
Realtime monitoring for Go Runtime

Installation

go get -u github.com/ksckaan1/stati

Features

  • Run/Stop fetching new monitoring data,
  • Show stats in table or line graph mode,
  • Simple and elegant theme,
  • Show/hide labels in line graph,
  • Show min, max, avarage and last values of stats on table mode.

Usage

package main

import (
	"log"
	"time"

	"github.com/ksckaan1/stati"
)

func main() {
	s := stati.New().
		WithAddr(":3000").
		WithChartBuffer(100).
		WithInterval(time.Second).
		WithTitle("Stati")

	err := s.Start()
	if err != nil {
		log.Fatalln(err)
	}
}

or use concurrent

package main

import (
	"log"
	"time"

	"github.com/ksckaan1/stati"
)

func main() {
	s := stati.New().
		WithAddr(":3000").
		WithChartBuffer(100).
		WithInterval(time.Second).
		WithTitle("Stati")

	go func(){
		err := s.Start()
		if err != nil {
			log.Fatalln(err)
		}
	}()

	// other processes ...
}

Open http://localhost:3000/stati on your browser.

Dependencies

Screenshot

ss

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name          string        `json:"name"`
	FetchInterval time.Duration `json:"fetch_interval"`
}

type Stati

type Stati struct {
	// contains filtered or unexported fields
}

func New

func New() *Stati

func (*Stati) Start

func (s *Stati) Start() error

func (*Stati) StatsPage

func (s *Stati) StatsPage(w http.ResponseWriter, r *http.Request)

func (*Stati) WithAddr

func (s *Stati) WithAddr(addr string) *Stati

func (*Stati) WithChartBuffer

func (s *Stati) WithChartBuffer(buffer int) *Stati

func (*Stati) WithInterval

func (s *Stati) WithInterval(interval time.Duration) *Stati

func (*Stati) WithTitle

func (s *Stati) WithTitle(title string) *Stati

Directories

Path Synopsis
templ: version: v0.2.707
templ: version: v0.2.707

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL