models

package
v0.0.0-debug-20260702 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	IsFirstMask = 1 << 0 // 0001
	IsLastMask  = 1 << 1 // 0010
)
View Source
const DiskIO = "Disk IO"
View Source
const ExternalScan = "External Scan"
View Source
const FSCacheDiskHit = "FileService Cache Disk Hit"
View Source
const FSCacheDiskRead = "FileService Cache Disk Read"
View Source
const FSCacheHit = "FileService Cache Hit"
View Source
const FSCacheMemoryHit = "FileService Cache Memory Hit"
View Source
const FSCacheMemoryRead = "FileService Cache Memory Read"
View Source
const FSCacheRead = "FileService Cache Read"
View Source
const FSCacheRemoteHit = "FileService Cache Remote Hit"
View Source
const FSCacheRemoteRead = "FileService Cache Remote Read"
View Source
const InputRows = "Input Rows"
View Source
const InputSize = "Input Size"
View Source
const InsertTime = "Insert Time"
View Source
const MemorySize = "Memory Size"
View Source
const Network = "Network"
View Source
const OutputRows = "Output Rows"
View Source
const OutputSize = "Output Size"
View Source
const S3Delete = "S3 Delete Count"
View Source
const S3DeleteMul = "S3 DeleteMul Count"
View Source
const S3Get = "S3 Get Count"
View Source
const S3Head = "S3 Head Count"
View Source
const S3List = "S3 List Count"
View Source
const S3Put = "S3 Put Count"
View Source
const ScanBytes = "Scan Bytes"
View Source
const ScanTime = "Scan Time"
View Source
const TableScan = "Table Scan"
View Source
const TimeConsumed = "Time Consumed"
View Source
const WaitTime = "Wait Time"

Variables

This section is empty.

Functions

func CalcTotalS3Requests

func CalcTotalS3Requests(gblStats GblStats, statsInfo *statistic.StatsInfo) (list, head, put, get, delete, deleteMul, writtenRows, deletedRows int64)

CalcTotalS3Requests calculates the total number of S3 requests (List, Head, Put, Get, Delete, DeleteMul) by summing up values from global statistics (gblStats) and different stages of the execution process (PlanStage, CompileStage, and PrepareRunStage) in the statsInfo.

func ExplainPhyPlan

func ExplainPhyPlan(phy *PhyPlan, statsInfo *statistic.StatsInfo, option ExplainOption) string

ExplainPhyPlan used to `mo_explan_phy` internal function

func PhyPlanToJSON

func PhyPlanToJSON(p *PhyPlan) (string, error)

func PrintPipelineTree

func PrintPipelineTree(node *PhyOperator, prefix string, isRoot, isTail bool, option ExplainOption, buffer *bytes.Buffer)

Types

type Edge

type Edge struct {
	Id     string `json:"id"`
	Src    string `json:"src"`
	Dst    string `json:"dst"`
	Output int64  `json:"output"`
	Unit   string `json:"unit"`
}

type ExplainData

type ExplainData struct {
	Steps        []Step `json:"steps"`
	Code         uint16 `json:"code"`
	Message      string `json:"message"`
	Uuid         string `json:"uuid"`
	PhyPlan      PhyPlan
	NewPlanStats statistic.StatsInfo
}

func NewExplainData

func NewExplainData(uuid uuid.UUID) *ExplainData

func NewExplainDataFail

func NewExplainDataFail(uuid uuid.UUID, code uint16, msg string) *ExplainData

func (*ExplainData) StatisticsRead deprecated

func (d *ExplainData) StatisticsRead() (rows int64, size int64)

StatisticsRead statistics read rows, size in ExplainData

Deprecated: please use explain.GetInputRowsAndInputSize instead.

type ExplainOption

type ExplainOption int
const (
	NormalOption ExplainOption = iota
	VerboseOption
	AnalyzeOption
)

type GblStats

type GblStats struct {
	ScopePrepareTimeConsumed int64
	OperatorTimeConsumed     int64
	MemorySize               int64
	SpillSize                int64
	NetWorkSize              int64
	DiskIOSize               int64
	S3ListRequest            int64
	S3HeadRequest            int64
	S3PutRequest             int64
	S3GetRequest             int64
	S3DeleteRequest          int64
	S3DeleteMultiRequest     int64
	WrittenRows              int64
	DeletedRows              int64
}

GblStats used to hold the total time and wait time of physical plan execution, rename to PhyGblStats

func ExtractPhyPlanGlbStats

func ExtractPhyPlanGlbStats(plan *PhyPlan) GblStats

Function to process the entire PhyPlan and extract the stats

type Global

type Global struct {
	Statistics Statistics `json:"statistics"`
	TotalStats TotalStats `json:"totalStats"`
}

func NewGlobal

func NewGlobal() *Global

type GraphData

type GraphData struct {
	Nodes  []Node  `json:"nodes"`
	Edges  []Edge  `json:"edges"`
	Labels []Label `json:"labels"`
	Global Global  `json:"global"`
}

func NewGraphData

func NewGraphData(nodeSize int) *GraphData

func (*GraphData) StatisticsGlobalResource

func (graphData *GraphData) StatisticsGlobalResource(ctx context.Context) error

Statistics of global resource usage, adding resources of all nodes

type Label

type Label struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

func NewLabel

func NewLabel(name string, value interface{}) *Label

type Node

type Node struct {
	NodeId     string     `json:"id"`
	Name       string     `json:"name"`
	Title      string     `json:"title"`
	Labels     []Label    `json:"labels"`
	Statistics Statistics `json:"statistics"`
	Stats      Stats      `json:"stats"`
	TotalStats TotalStats `json:"totalStats"`
}

type PhyOperator

type PhyOperator struct {
	OpName       string                 `json:"OpName"`
	NodeIdx      int                    `json:"NodeIdx"`
	Status       uint8                  `json:"Status"`
	DestReceiver []PhyReceiver          `json:"toMergeReceiver,omitempty"`
	OpStats      *process.OperatorStats `json:"OpStats,omitempty"`
	Children     []*PhyOperator         `json:"Children,omitempty"`
	IsFirst      bool                   `json:"IsFirst,omitempty"`
	IsLast       bool                   `json:"IsLast,omitempty"`
}

type PhyPlan

type PhyPlan struct {
	Version     string     `json:"version"`
	RetryTime   int        `json:"retryTime,omitempty"`
	LocalScope  []PhyScope `json:"scope,omitempty"`
	RemoteScope []PhyScope `json:"RemoteScope,omitempty"`
}

func JSONToPhyPlan

func JSONToPhyPlan(jsonStr string) (PhyPlan, error)

func NewPhyPlan

func NewPhyPlan() *PhyPlan

type PhyReceiver

type PhyReceiver struct {
	Idx        int    `json:"Idx"`
	RemoteUuid string `json:"Uuid,omitempty"`
}

type PhyScope

type PhyScope struct {
	Magic               string        `json:"Magic"`
	Mcpu                int8          `json:"Mcpu,omitempty"`
	Receiver            []PhyReceiver `json:"Receiver,omitempty"`
	DataSource          *PhySource    `json:"DataSource,omitempty"`
	PreScopes           []PhyScope    `json:"PreScopes,omitempty"`
	RootOperator        *PhyOperator  `json:"RootOperator,omitempty"`
	PrepareTimeConsumed int64         `json:"PrepareTimeConsumed,omitempty"`
}

type PhySource

type PhySource struct {
	SchemaName   string   `json:"SchemaName"`
	RelationName string   `json:"TableName"`
	Attributes   []string `json:"Columns"`
}

type PlanStats

type PlanStats struct {
}

type StatisticValue

type StatisticValue struct {
	Name  string `json:"name"`
	Value int64  `json:"value"`
	Unit  string `json:"unit"`
}

func NewStatisticValue

func NewStatisticValue(name string, unit string) *StatisticValue

type Statistics

type Statistics struct {
	Time       []StatisticValue `json:"Time"`
	Memory     []StatisticValue `json:"Memory"`
	Throughput []StatisticValue `json:"Throughput"`
	IO         []StatisticValue `json:"IO"`
	Network    []StatisticValue `json:"Network"`
}

func NewStatistics

func NewStatistics() *Statistics

type Stats

type Stats struct {
	BlockNum    int32   `json:"blocknum"`
	Outcnt      float64 `json:"outcnt"`
	Cost        float64 `json:"cost"`
	HashmapSize float64 `json:"hashmapsize"`
	Rowsize     float64 `json:"rowsize"`
}

type Step

type Step struct {
	GraphData   GraphData `json:"graphData"`
	Step        int       `json:"step"`
	Description string    `json:"description"`
	State       string    `json:"state"`
	PlanStats   PlanStats `json:"stats"`
}

func NewStep

func NewStep(step int) *Step

type TotalStats

type TotalStats struct {
	Name  string `json:"name"`
	Value int64  `json:"value"`
	Unit  string `json:"unit"`
}

Jump to

Keyboard shortcuts

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