tui

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdHelp           = "help"
	CmdConnect        = "connect"
	CmdQuit           = "quit"
	CmdFlamegraph     = "flamegraph"
	CmdExplain        = "explain"
	CmdFrom           = "from"
	CmdTo             = "to"
	CmdRange          = "range"
	CmdCluster        = "cluster"
	CmdHeatmap        = "heatmap"
	CmdCategory       = "categoryType"
	CmdMetric         = "heatmapMetric"
	CmdScale          = "scale"
	CmdProfileEvents  = "profile_events"
	CmdMetricLog      = "metric_log"
	CmdAsyncMetricLog = "asynchronous_metric_log"
	CmdLogs           = "logs"
	CmdMemory         = "memory"
	CmdAudit          = "audit"
)

Available commands

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	CLI *types.CLI
	// contains filtered or unexported fields
}

func NewApp

func NewApp(cfg *config.Config, version string) *App

func (*App) ApplyCLIParameters

func (a *App) ApplyCLIParameters(c *types.CLI, commandName string)

func (*App) ApplyPredefinedRange

func (a *App) ApplyPredefinedRange(rangeOption string)

func (*App) ExecuteAndProcessSparklineQuery

func (a *App) ExecuteAndProcessSparklineQuery(query string, prefix string, fields []string, filteredTable *widgets.FilteredTable, row *int) error

func (*App) GenerateSparkline

func (a *App) GenerateSparkline(values []float64) string

func (*App) GetContextList

func (a *App) GetContextList() string

func (*App) Run

func (a *App) Run() error

func (*App) SetCategory

func (a *App) SetCategory(category string)

func (*App) SetCluster

func (a *App) SetCluster(cluster string)

func (*App) SetConnectByName

func (a *App) SetConnectByName(contextName string) bool

func (*App) SetFromTime

func (a *App) SetFromTime(t time.Time)

func (*App) SetMetric

func (a *App) SetMetric(metric string)

func (*App) SetToTime

func (a *App) SetToTime(t time.Time)

func (*App) ShowAsynchronousMetricLog

func (a *App) ShowAsynchronousMetricLog(fromTime, toTime time.Time, cluster string)

func (*App) ShowAudit

func (a *App) ShowAudit()

ShowAudit displays the audit interface

func (*App) ShowDescription

func (a *App) ShowDescription(name, description string)

func (*App) ShowExplain added in v0.0.2

func (a *App) ShowExplain(categoryType CategoryType, categoryValue string, fromTime, toTime time.Time, cluster string)

ShowExplain is the entry point for the explain flow. If categoryType == CategoryQueryHash (called from heatmap) we'll pre-fill the normalized hash. Otherwise, the selection form will be shown.

func (*App) ShowExplainQuerySelectionForm added in v0.0.2

func (a *App) ShowExplainQuerySelectionForm(fromTime, toTime time.Time, cluster string)

ShowExplainQuerySelectionForm shows the form allowing to filter queries by normalized hash, tables and query_kind.

func (*App) ShowExplainQuerySelectionFormWithPrefill added in v0.0.2

func (a *App) ShowExplainQuerySelectionFormWithPrefill(prefillHash string, fromTime, toTime time.Time, cluster string)

ShowExplainQuerySelectionFormWithPrefill shows the same form but with an optional prefilled normalized_query_hash.

func (*App) ShowFlamegraphForm

func (a *App) ShowFlamegraphForm(params ...FlamegraphParams)

func (*App) ShowHeatmap

func (a *App) ShowHeatmap()

ShowHeatmap displays the heatmap visualization

func (*App) ShowMemory added in v0.0.2

func (a *App) ShowMemory()

ShowMemory displays memory usage aggregated from various system tables across the selected cluster. It builds a single UNION ALL SQL query using cluster('<cluster>','system','table') and adds hostName() as the first column. The resulting table has columns: Host, Group, Name, Value. The widget supports filtering by pressing '/' (handled by widgets.FilteredTable).

func (*App) ShowMetricLog

func (a *App) ShowMetricLog(fromTime, toTime time.Time, cluster string)

func (*App) ShowProfileEvents

func (a *App) ShowProfileEvents(categoryType CategoryType, categoryValue string, fromTime, toTime time.Time, cluster string)

func (*App) SwitchToMainPage

func (a *App) SwitchToMainPage(mainMsg string)

type AuditPanel

type AuditPanel struct {
	// contains filtered or unexported fields
}

AuditPanel manages the audit interface

type AuditResult

type AuditResult struct {
	ID       string
	Host     string
	Object   string
	Severity string
	Details  string
	Values   map[string]float64
}

AuditResult represents a single audit finding

type CategoryType

type CategoryType string

CategoryType Category types for heatmap

const (
	CategoryQueryHash CategoryType = "normalized_query_hash"
	CategoryTable     CategoryType = "tables"
	CategoryHost      CategoryType = "hosts"
	CategoryError     CategoryType = "errors"
)

type FlamegraphParams

type FlamegraphParams struct {
	CategoryType  CategoryType
	CategoryValue string
	TraceType     TraceType
	FromTime      time.Time
	ToTime        time.Time
	SourcePage    string // Tracks where the flamegraph was called from
}

FlamegraphParams Structure for storing flamegraph parameters

type HeatmapMetric

type HeatmapMetric string

HeatmapMetric Heatmap metric types

const (
	MetricCount          HeatmapMetric = "count"
	MetricMemoryUsage    HeatmapMetric = "memoryUsage"
	MetricCPUUsage       HeatmapMetric = "cpuUsage"
	MetricNetworkSent    HeatmapMetric = "networkSent"
	MetricNetworkReceive HeatmapMetric = "networkReceive"
	MetricReadRows       HeatmapMetric = "readRows"
	MetricWrittenRows    HeatmapMetric = "writtenRows"
	MetricReadBytes      HeatmapMetric = "readBytes"
	MetricWrittenBytes   HeatmapMetric = "writtenBytes"
)

type LogEntry

type LogEntry struct {
	Time      time.Time
	TimeMs    time.Time
	Date      string
	Level     string
	Message   string
	AllFields map[string]interface{} // Stores all fields not in the main display
}

type LogFilter

type LogFilter struct {
	Field    string
	Operator string
	Value    string
}

type LogPanel

type LogPanel struct {
	// contains filtered or unexported fields
}

func (*LogPanel) Show

func (lp *LogPanel) Show()

type ScaleType

type ScaleType string

ScaleType represents the type of scaling to apply to heatmap values

const (
	ScaleLinear ScaleType = "linear"
	ScaleLog2   ScaleType = "log2"
	ScaleLog10  ScaleType = "log10"
)

type TraceType

type TraceType string
const (
	TraceMemory       TraceType = "Memory"
	TraceCPU          TraceType = "CPU"
	TraceReal         TraceType = "Real"
	TraceMemorySample TraceType = "MemorySample"
)

Directories

Path Synopsis