GithubHelp home page GithubHelp logo

mkevac / debugcharts Goto Github PK

View Code? Open in Web Editor NEW
511.0 13.0 56.0 3.84 MB

Very simple charts with some debug data for Go programs

License: MIT License

Makefile 1.26% Go 64.98% HTML 5.22% JavaScript 28.55%

debugcharts's Introduction

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.

debugcharts's People

Contributors

0x5010 avatar anton-povarov avatar mintzhao avatar mkevac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

debugcharts's Issues

calls to log.Fatal() make me nervous

Errors happen all the time at scale. I'm hesitant to deploy a service to production built with this knowing that log.Fatal() might be called and my application would exit. I think log.Println/return pair would be sufficient in most of the cases.

Alternatively have it configurable with a package-level variable.

http.ServeMux

Hi, remove init() and create func that will returned http.ServeMux server with all necessary handlers to allow developers to choose addr and port.
And hide Assert funcs
(if you have not many time let me do this)

data race

=============================
WARNING: DATA RACE
Write at 0x000002c31d28 by goroutine
25:
aithub.com/mkevac/debuacharts. (*server) gatherData0
/go/pkg/mod/github.com/mkevac/[email protected]/debugcharts.go:125+0x472
github.com/mkevac/debugcharts.init.o•dwrap•1()
/go/pkg/mod/github.com/mkevac/[email protected]/debugcharts.go:193+0x39
Previous read at 0x000002c31d28 by goroutine 962:
[failed to restore the stack]
Goroutine 25 (running) created at:
github.com/mkevac/debugcharts.init.0(
/go/pkg/mod/github.com/mkevac/[email protected]/debugcharts.go:193+0x507

date/time is wrong with the chart

hi,
very useful chart package. However, the chart is show date/time starting Jan 17, 9:52am. Have not investigated why.

thanks,
eddie

run error

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x7ad1a0]

goroutine 19 [running]:
github.com/mkevac/debugcharts.(*server).gatherData(0xa9bc60)
        C:/golang/gowork/src/github.com/mkevac/debugcharts/debugcharts.go:112 +0x210
created by github.com/mkevac/debugcharts.init.1
        C:/golang/gowork/src/github.com/mkevac/debugcharts/debugcharts.go:158 +0x2f9
exit status 2

no charts, errors in console

when accessing charts i see only one empty chart and a bunch of errors in console:

Uncaught TypeError: Cannot read property 'length' of null
    at new m (plotly-latest.min.js:7)
    at m (plotly-latest.min.js:7)
    at Object.plot (plotly-latest.min.js:7)
    at d (plotly-latest.min.js:7)
    at Object.r.plot (plotly-latest.min.js:7)
    at r.drawData (plotly-latest.min.js:7)
    at Object.l.syncOrAsync (plotly-latest.min.js:7)
    at Object.r.plot (plotly-latest.min.js:7)
    at Object.r.newPlot (plotly-latest.min.js:7)
    at Object.success (main.js:26)
m @ plotly-latest.min.js:7
m @ plotly-latest.min.js:7
plot @ plotly-latest.min.js:7
d @ plotly-latest.min.js:7
r.plot @ plotly-latest.min.js:7
r.drawData @ plotly-latest.min.js:7
l.syncOrAsync @ plotly-latest.min.js:7
r.plot @ plotly-latest.min.js:7
r.newPlot @ plotly-latest.min.js:7
(anonymous) @ main.js:26
j @ jquery-2.1.4.min.js:2
fireWith @ jquery-2.1.4.min.js:2
x @ jquery-2.1.4.min.js:4
(anonymous) @ jquery-2.1.4.min.js:4
load (async)
send @ jquery-2.1.4.min.js:4
ajax @ jquery-2.1.4.min.js:4
n.(anonymous function) @ jquery-2.1.4.min.js:4
getJSON @ jquery-2.1.4.min.js:4
(anonymous) @ main.js:17
j @ jquery-2.1.4.min.js:2
fireWith @ jquery-2.1.4.min.js:2
ready @ jquery-2.1.4.min.js:2
I @ jquery-2.1.4.min.js:2
4plotly-latest.min.js:7 Uncaught Error: gd.data must be an array
    at plotly-latest.min.js:7
    at I (plotly-latest.min.js:7)
    at Object.t [as extendTraces] (plotly-latest.min.js:7)
    at WebSocket.ws.onmessage (main.js:117)

may be chart lib was updated?

set default log Flag?

when use this
found default log Prefix not exists, like

log.Println("xxxx")

2017/09/04 13:25:10 xxxx
2017/09/04 13:25:10 xxxx

to

xxxx
xxxx

add expvars support

That will be great.

Or how to add expvar to this?
Can you read expvar automatically via enumerate exporing variables or smth like this?

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.