sequence

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sequence generates protocol sequence diagrams from packet captures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagram

type Diagram struct {
	Events []Event
	Title  string
}

Diagram generates sequence diagrams from events.

func NewDiagram

func NewDiagram(title string) *Diagram

NewDiagram creates a new sequence diagram.

func (*Diagram) AddEvent

func (d *Diagram) AddEvent(e Event)

AddEvent adds an event to the diagram.

func (*Diagram) ToMermaid

func (d *Diagram) ToMermaid() string

ToMermaid generates a Mermaid sequence diagram.

func (*Diagram) ToPlantUML

func (d *Diagram) ToPlantUML() string

ToPlantUML generates a PlantUML sequence diagram.

type Event

type Event struct {
	Timestamp float64 `json:"timestamp"`
	Source    string  `json:"source"`
	Dest      string  `json:"dest"`
	Protocol  string  `json:"protocol"`
	Info      string  `json:"info"`
	Latency   float64 `json:"latency_ms,omitempty"`
}

Event represents a protocol event in a sequence.

type LatencyStats

type LatencyStats struct {
	Min   float64 `json:"min_ms"`
	Max   float64 `json:"max_ms"`
	Avg   float64 `json:"avg_ms"`
	Count int     `json:"count"`
}

LatencyStats computes latency statistics from events.

func ComputeLatency

func ComputeLatency(events []Event) *LatencyStats

ComputeLatency computes request-response latency statistics.

Jump to

Keyboard shortcuts

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