Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

jamesharr/timehistogram

Repository files navigation

PROJECT STATUS

This project hasn't bee worked on in a long time. Feel free to reference/use it and/or pieces of it, but know that there are probably better ways to do this now.

Time Histogram generator

build status

A silly little library for generating histograms off of time-ranged events that can overlap

// Data types used (already defined)
type EventList []Event
type Event struct {
    Begin time.Time
    End   time.Time
    Data  int64
}

// Generate a histogram
hist := Histogram(
    myEventList,               // Some list of events
    time.Hour,                 // 1hr resolution on render
    time.Now(),                // Start time
    time.Now().Add(time.Hour), // End time
)

// Marshal to flot-friendly JSON
flotSeries := json.Marshal(hist)

For concrete, see the tests.

About

Histograms from time-ranged events. Flot-friendly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages