web

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package web renders isutools measurements: a live report, a self-contained downloadable snapshot.html, machine-readable JSON, and a reset endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(p Provider) http.Handler

NewHandler returns the report handler. Mount it under any prefix (e.g. chi's r.Mount("/debug/isutools", ...)); routes are relative: GET /, GET /snapshot.html, GET /json, POST /reset.

Types

type Meta

type Meta struct {
	SchemaVersion int          `json:"schema_version"`
	Time          string       `json:"time"`
	Generation    int64        `json:"generation"`
	Revision      string       `json:"revision"`
	Dirty         bool         `json:"dirty"`
	Host          sysinfo.Info `json:"host"`
}

Meta identifies when, on which host, and from which revision a snapshot was taken. Generation increments on every reset so runs are comparable.

type Provider

type Provider struct {
	SQL *agg.Table
}

Provider supplies the aggregation tables to render. Nil tables are skipped.

type Snapshot

type Snapshot struct {
	Meta Meta        `json:"meta"`
	SQL  []agg.Entry `json:"sql"`
}

Snapshot is the complete state of all measurements at one point in time.

Jump to

Keyboard shortcuts

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