debugcharts

package module
v0.0.0-...-69a6ab5 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 13 Imported by: 0

README

debugcharts Build Status

Go memory debug charts.

This package uses Plotly chart library. It is open source and free for use.

Installation

go get -v -u github.com/mkevac/debugcharts

Usage

Just install package and start http server. There is an example program here.

Then go to http://localhost:8080/debug/charts. You should see something like this:

Data is updated every second. We keep data for last day.

User https://github.com/dgryski/ proposed interesing way for turning debugcharts on/off for your project:

You can add tagged file like this in your code

// +build debugcharts

package main

import _ "github.com/mkevac/debugcharts"

If you want to use debugcharts, then build your project with -tags debugcharts

Development

I use bindata to pack binary files into executable. Run make to rebuild.

Documentation

Overview

Simple live charts for memory consumption and GC pauses.

To use debugcharts, link this package into your program:

import _ "github.com/mkevac/debugcharts"

If your application is not already running an http server, you need to start one. Add "net/http" and "log" to your imports and the following code to your main function:

go func() {
	log.Println(http.ListenAndServe("localhost:6060", nil))
}()

Then go look at charts:

http://localhost:6060/debug/charts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUPair

type CPUPair struct {
	Ts   uint64
	User float64
	Sys  float64
}

type DataStorage

type DataStorage struct {
	BytesAllocated []SimplePair
	GcPauses       []SimplePair
	CPUUsage       []CPUPair
	Pprof          []PprofPair
}

type PprofPair

type PprofPair struct {
	Ts           uint64
	Block        int
	Goroutine    int
	Heap         int
	Mutex        int
	Threadcreate int
}

type SimplePair

type SimplePair struct {
	Ts    uint64
	Value uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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