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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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