oracle

package
v1.2207.0-pre2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DynPerformanceViewSQLAreaTpl = `` /* 230-byte string literal not displayed */

	DynPerformanceViewSQLAreaColumnExecutions     = "executions"
	DynPerformanceViewSQLAreaColumnElapsedTime    = "elapsed_time"
	DynPerformanceViewSQLAreaColumnCPUTime        = "cpu_time"
	DynPerformanceViewSQLAreaColumnDiskReads      = "disk_reads"
	DynPerformanceViewSQLAreaColumnBufferGets     = "buffer_gets"
	DynPerformanceViewSQLAreaColumnUserIOWaitTime = "user_io_wait_time"
)

Note: I can not use Oracle to convert microseconds to seconds by "ROUND(cpu_time/1000/1000)"; it should return float64 or string, but the driver return empty value, seem to be a bug; So I get the original cpu_time (microseconds) and convert it to seconds within the SQLE code logic.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func NewDB

func NewDB(dsn *DSN) (*DB, error)

func (*DB) Close

func (o *DB) Close() error

func (*DB) QueryTopSQLs

func (o *DB) QueryTopSQLs(ctx context.Context, topN int, orderBy string) ([]*DynPerformanceSQLArea, error)

type DSN

type DSN struct {
	Host        string
	Port        string
	User        string
	Password    string
	ServiceName string
}

func (*DSN) String

func (d *DSN) String() string

type DynPerformanceSQLArea

type DynPerformanceSQLArea struct {
	SQLFullText    string `json:"sql_fulltext"`
	Executions     int64  `json:"executions"`
	ElapsedTime    int64  `json:"elapsed_time"`
	UserIOWaitTime int64  `json:"user_io_wait_time"`
	CPUTime        int64  `json:"cpu_time"`
	DiskReads      int64  `json:"disk_reads"`
	BufferGets     int64  `json:"buffer_gets"`
}

DynPerformanceSQLArea ref to https://docs.oracle.com/cd/E18283_01/server.112/e17110/dynviews_3064.htm

Jump to

Keyboard shortcuts

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