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

insights

package
v0.345.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnomaliesCmd

func AnomaliesCmd(ch *cmdutil.Helper) *cobra.Command

AnomaliesCmd lists detected resource anomalies for a branch.

func AnomaliesShowCmd added in v0.322.0

func AnomaliesShowCmd(ch *cmdutil.Helper) *cobra.Command

AnomaliesShowCmd shows an anomaly and the queries correlated with it.

func ErrorsCmd

func ErrorsCmd(ch *cmdutil.Helper) *cobra.Command

ErrorsCmd lists aggregated query errors for a branch.

func ErrorsShowCmd added in v0.322.0

func ErrorsShowCmd(ch *cmdutil.Helper) *cobra.Command

ErrorsShowCmd lists the individual queries behind an error fingerprint.

func InsightsCmd

func InsightsCmd(ch *cmdutil.Helper) *cobra.Command

InsightsCmd surfaces server-side query insights for a database: aggregated query statistics, query errors, anomalies, and schema recommendations.

func QueriesCmd

func QueriesCmd(ch *cmdutil.Helper) *cobra.Command

QueriesCmd lists aggregated query statistics for a branch.

func QuerySamplesCmd added in v0.315.0

func QuerySamplesCmd(ch *cmdutil.Helper) *cobra.Command

QuerySamplesCmd lists recent individual executions for a query fingerprint.

func QueryShowCmd added in v0.327.0

func QueryShowCmd(ch *cmdutil.Helper) *cobra.Command

func QuerySummaryCmd added in v0.327.0

func QuerySummaryCmd(ch *cmdutil.Helper) *cobra.Command

func QueryTrafficBudgetsCmd added in v0.327.0

func QueryTrafficBudgetsCmd(ch *cmdutil.Helper) *cobra.Command

func RecommendationDismissCmd added in v0.315.0

func RecommendationDismissCmd(ch *cmdutil.Helper) *cobra.Command

RecommendationDismissCmd dismisses a schema recommendation.

func RecommendationShowCmd added in v0.327.0

func RecommendationShowCmd(ch *cmdutil.Helper) *cobra.Command

func RecommendationsCmd

func RecommendationsCmd(ch *cmdutil.Helper) *cobra.Command

RecommendationsCmd lists schema recommendations for a database.

func TagShowCmd added in v0.315.0

func TagShowCmd(ch *cmdutil.Helper) *cobra.Command

TagShowCmd shows one tag key and its values.

func TagSummariesCmd added in v0.315.0

func TagSummariesCmd(ch *cmdutil.Helper) *cobra.Command

TagSummariesCmd lists query statistics grouped by tag keys.

func TagsCmd added in v0.315.0

func TagsCmd(ch *cmdutil.Helper) *cobra.Command

TagsCmd lists query tags and groups related subcommands.

Types

type AnomalyRow

type AnomalyRow struct {
	ID                 string `header:"id" json:"id"`
	Active             bool   `header:"active" json:"active"`
	PeriodStart        string `header:"started" json:"period_start"`
	PeriodEnd          string `header:"ended" json:"period_end"`
	MinutesInViolation int64  `header:"minutes in violation" json:"minutes_in_violation"`
}

AnomalyRow is an anomaly formatted for table output.

type CorrelationRow added in v0.322.0

type CorrelationRow struct {
	Correlation float64 `header:"correlation" json:"r"`
	Fingerprint string  `header:"fingerprint" json:"fingerprint"`
	Keyspace    string  `header:"keyspace" json:"keyspace"`
	TabletType  string  `header:"tablet type" json:"tablet_type"`
	Query       string  `header:"query" json:"normalized_sql"`
}

CorrelationRow is a query correlated with an anomaly, for table output.

type ErrorQueryRow added in v0.322.0

type ErrorQueryRow struct {
	StartedAt  string  `header:"started" json:"started_at"`
	DurationMs float64 `header:"duration (ms)" json:"total_duration_millis"`
	Username   string  `header:"user" json:"username"`
	Keyspace   string  `header:"keyspace" json:"keyspace"`
	Error      string  `header:"error" json:"error_message"`
	Query      string  `header:"query" json:"normalized_sql"`
}

ErrorQueryRow is a failed query execution formatted for table output.

type ErrorRow

type ErrorRow struct {
	Count       int64  `header:"count" json:"error_count"`
	LastSeen    string `header:"last seen" json:"started_at"`
	Message     string `header:"message" json:"error_message"`
	Fingerprint string `header:"fingerprint" json:"error_fingerprint"`
}

ErrorRow is a query error row formatted for table output. The fingerprint is the full error_fingerprint rather than the truncated id, so it can be passed to 'pscale insights errors show'.

type QueryRow

type QueryRow struct {
	Fingerprint   string  `header:"fingerprint" json:"fingerprint"`
	Keyspace      string  `header:"keyspace" json:"keyspace"`
	Count         int64   `header:"count" json:"query_count"`
	TotalTimeMs   float64 `header:"total time (ms)" json:"sum_total_duration_millis"`
	TimePerQryMs  float64 `header:"per query (ms)" json:"time_per_query"`
	P50Ms         float64 `header:"p50 (ms)" json:"p50_latency"`
	P99Ms         float64 `header:"p99 (ms)" json:"p99_latency"`
	RowsRead      int64   `header:"rows read" json:"sum_rows_read"`
	ReadPerReturn float64 `header:"read/returned" json:"rows_read_per_returned"`
	Errors        int64   `header:"errors" json:"error_count"`
	LastRunAt     string  `header:"last run" json:"last_run_at"`
	Query         string  `header:"query" json:"normalized_sql"`
}

QueryRow is a query statistics row formatted for table output.

type QuerySampleRow added in v0.315.0

type QuerySampleRow struct {
	ID           string  `header:"id" json:"id"`
	StartedAt    string  `header:"started" json:"started_at"`
	DurationMs   float64 `header:"duration (ms)" json:"total_duration_millis"`
	Username     string  `header:"user" json:"username"`
	RowsRead     int64   `header:"rows read" json:"rows_read"`
	RowsReturned int64   `header:"rows returned" json:"rows_returned"`
	Error        string  `header:"error" json:"error_message"`
	Query        string  `header:"query" json:"normalized_sql"`
}

QuerySampleRow is an individual query execution for table output.

type QueryShowRow added in v0.327.0

type QueryShowRow struct {
	ID           string  `header:"id" json:"id"`
	Fingerprint  string  `header:"fingerprint" json:"fingerprint"`
	StartedAt    string  `header:"started" json:"started_at"`
	Statement    string  `header:"statement" json:"statement_type"`
	Keyspace     string  `header:"keyspace" json:"keyspace"`
	Tables       string  `header:"tables" json:"tables"`
	Username     string  `header:"user" json:"username"`
	Remote       string  `header:"remote address" json:"remote_address"`
	ShardQueries int64   `header:"shard queries" json:"shard_queries"`
	RowsRead     int64   `header:"rows read" json:"rows_read"`
	RowsAffected int64   `header:"rows affected" json:"rows_affected"`
	RowsReturned int64   `header:"rows returned" json:"rows_returned"`
	DurationMs   float64 `header:"duration (ms)" json:"total_duration_millis"`
	Error        string  `header:"error" json:"error_message"`
	Query        string  `header:"query" json:"normalized_sql"`
}

type QuerySummaryRow added in v0.327.0

type QuerySummaryRow struct {
	Fingerprint   string  `header:"fingerprint" json:"fingerprint"`
	Keyspace      string  `header:"keyspace" json:"keyspace"`
	Statement     string  `header:"statement" json:"statement_type"`
	Count         int64   `header:"count" json:"query_count"`
	Errors        int64   `header:"errors" json:"error_count"`
	TotalTimeMs   float64 `header:"total time (ms)" json:"sum_total_duration_millis"`
	TimePerQryMs  float64 `header:"per query (ms)" json:"time_per_query"`
	P50Ms         float64 `header:"p50 (ms)" json:"p50_latency"`
	P99Ms         float64 `header:"p99 (ms)" json:"p99_latency"`
	MaxMs         float64 `header:"max (ms)" json:"max_latency"`
	RowsRead      int64   `header:"rows read" json:"sum_rows_read"`
	RowsReturned  int64   `header:"rows returned" json:"sum_rows_returned"`
	ReadPerReturn float64 `header:"read/returned" json:"rows_read_per_returned"`
	LastRunAt     string  `header:"last run" json:"last_run_at"`
	Tables        string  `header:"tables" json:"tables"`
	Multishard    bool    `header:"multishard" json:"multishard"`
	Query         string  `header:"query" json:"normalized_sql"`
}

type RecommendationDetailRow added in v0.327.0

type RecommendationDetailRow struct {
	Number   int    `header:"number" json:"number"`
	State    string `header:"state" json:"state"`
	Type     string `header:"type" json:"recommendation_type"`
	Table    string `header:"table" json:"table_name"`
	Keyspace string `header:"keyspace" json:"keyspace,omitempty"`
	Title    string `header:"title" json:"title"`
	DDL      string `header:"ddl" json:"ddl_statement"`
	URL      string `header:"url" json:"html_url,omitempty"`
}

type RecommendationRow

type RecommendationRow struct {
	Number   int    `header:"number" json:"number"`
	State    string `header:"state" json:"state"`
	Type     string `header:"type" json:"recommendation_type"`
	Table    string `header:"table" json:"table_name"`
	Keyspace string `header:"keyspace" json:"keyspace,omitempty"`
	Title    string `header:"title" json:"title"`
}

RecommendationRow is a schema recommendation formatted for table output.

type TagRow added in v0.315.0

type TagRow struct {
	Name       string `header:"name" json:"name"`
	Source     string `header:"source" json:"source"`
	QueryCount int64  `header:"queries" json:"query_count"`
	TopValues  string `header:"top values" json:"top_values"`
}

TagRow is a tag key for table output.

type TagSummaryRow added in v0.315.0

type TagSummaryRow struct {
	Dimensions    string  `header:"dimensions" json:"dimensions"`
	Count         int64   `header:"count" json:"query_count"`
	TotalTimeMs   float64 `header:"total time (ms)" json:"sum_total_duration_millis"`
	TimePerQryMs  float64 `header:"per query (ms)" json:"time_per_query"`
	P99Ms         float64 `header:"p99 (ms)" json:"p99_latency"`
	RowsRead      int64   `header:"rows read" json:"sum_rows_read"`
	ReadPerReturn float64 `header:"read/returned" json:"rows_read_per_returned"`
	Errors        int64   `header:"errors" json:"error_count"`
}

TagSummaryRow is a tag-grouped query stats row for table output.

type TagValueRow added in v0.315.0

type TagValueRow struct {
	Name       string `header:"value" json:"name"`
	Kind       string `header:"kind" json:"kind"`
	QueryCount int64  `header:"queries" json:"query_count"`
}

TagValueRow is a tag value for table output.

Jump to

Keyboard shortcuts

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