statsviz icon indicating copy to clipboard operation
statsviz copied to clipboard

statsviz.TimeSeries.GetValue is called multiple times per second

Open mzzsfy opened this issue 6 months ago • 3 comments

Open 2 or more pages and you will see the phenomenon

code like this:

statsviz.NewServer(statsviz.TimeseriesPlot(func() statsviz.TimeSeriesPlot {
        plot, _ := statsviz.TimeSeriesPlotConfig{
            Name:  "testCall",
            Title: "testCall",
            Type:  statsviz.Scatter,
            Series: []statsviz.TimeSeries{{
                Name:     "call",
                GetValue: func() float64 {
                    println("call",time.Now().Format(time.DateTime))
                    return float64(0)
                },
            }},
        }.Build()
        return plot
    }()))

Here's the log with 3 pages opened image

mzzsfy avatar Dec 21 '23 10:12 mzzsfy