Help us shape the future of Go! Take the 2026 Go Developer Survey

flow

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package flow is a live diagram of what moves through a system: edges between its parts with rate, errors and latency, read as PromQL from the project's metrics component, or simulated for a demo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(p *sdk.Plugin)

Types

type Config

type Config struct {
	// Simulate makes the numbers up (every row says so), for a demo without metrics.
	Simulate bool `json:"simulate"`
	// Source is the metrics component to query (default the first).
	Source string `json:"source"`
	Nodes  []Node `json:"nodes"`
	Edges  []Edge `json:"edges"`
	Types  []Type `json:"types"`
	// Warn and Err are the error percentages an edge turns warn and err at (default 1 and 5).
	Warn float64 `json:"warn"`
	Err  float64 `json:"err"`
}

type Edge

type Edge struct {
	From    string  `json:"from"`
	To      string  `json:"to"`
	Label   string  `json:"label"`
	Rate    string  `json:"rate"`
	Errors  string  `json:"errors"`
	Latency string  `json:"latency"`
	Sim     float64 `json:"sim"`
}

Edge's rate (per second), errors (per second) and latency (ms) are PromQL; Sim is the rate a simulation centres on.

type Node

type Node struct {
	Name  string `json:"name"`
	Label string `json:"label"`
}

type Row

type Row struct {
	From      string  `json:"from"`
	To        string  `json:"to"`
	Node      string  `json:"node"`
	Label     string  `json:"label"`
	Value     float64 `json:"value" unit:"/s"`
	Errors    float64 `json:"errors" unit:"%"`
	Latency   float64 `json:"latency" unit:"ms"`
	Status    string  `json:"status"`
	Simulated bool    `json:"simulated"`
}

Row is an edge (from, to) or a node (node) of flow.graph.

type Summary

type Summary struct {
	Type      string  `json:"type"`
	Count     float64 `json:"count"`
	Success   float64 `json:"success" unit:"%"`
	P95       float64 `json:"p95" unit:"ms"`
	Status    string  `json:"status"`
	Simulated bool    `json:"simulated"`
}

type Type

type Type struct {
	Name    string  `json:"name"`
	Label   string  `json:"label"`
	Count   string  `json:"count"`
	Errors  string  `json:"errors"`
	Latency string  `json:"latency"`
	Share   float64 `json:"share"`
}

Type is a transaction type for the summary: count today, errors today and p95 latency (ms) as PromQL.

Jump to

Keyboard shortcuts

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