clickhouse

package
v0.5.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClickhouseQueryLogSchema

type ClickhouseQueryLogSchema struct {
	QueryType                  string    `db:"type"`
	EventTimeMicroseconds      time.Time `db:"event_time_microseconds"`
	QueryStartTimeMicroseconds time.Time `db:"query_start_time_microseconds"`

	// IO Information
	ReadRows  uint64 `db:"read_rows"`
	ReadBytes uint64 `db:"read_bytes"`

	WrittenRows  uint64 `db:"written_rows"`
	WrittenBytes uint64 `db:"written_bytes"`

	ResultRows  uint64 `db:"result_rows"`
	ResultBytes uint64 `db:"result_bytes"`

	// Query Information
	MemoryUsage     uint64   `db:"memory_usage"`
	CurrentDatabase string   `db:"current_database"`
	Query           string   `db:"normalized_query"`
	QueryHash       uint64   `db:"query_hash"` // cityHash64 of normalizeQuery(query)
	QueryKind       string   `db:"query_kind"`
	Databases       []string `db:"databases"`
	Tables          []string `db:"tables"`
	Columns         []string `db:"columns"`
	Projections     []string `db:"projections"`
	Views           []string `db:"views"`
	ExceptionCode   int32    `db:"exception_code"`
	Exception       string   `db:"exception"`
	StackTrace      string   `db:"stack_trace"`

	// Client Information
	InitialUser                       string    `db:"initial_user"`
	InitialQueryId                    string    `db:"initial_query_id"`
	InitialAddress                    *net.IP   `db:"initial_address"`
	InitialPort                       uint16    `db:"initial_port"`
	InitialQueryStartTimeMicroseconds time.Time `db:"initial_query_start_time_microseconds"`
	OsUser                            string    `db:"os_user"`
	ClientHostname                    string    `db:"client_hostname"`
	ClientName                        string    `db:"client_name"`
	ClientRevision                    uint32    `db:"client_revision"`
	ClientRevisionMajor               uint32    `db:"client_version_major"`
	ClientRevisionMinor               uint32    `db:"client_version_minor"`
	ClientRevisionPatch               uint32    `db:"client_version_patch"`
	DistributedDepth                  uint64    `db:"distributed_depth"`
}

type ClickhouseScrapper

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

func NewClickhouseScrapper

func NewClickhouseScrapper(ctx context.Context, conf ClickhouseScrapperConf) (*ClickhouseScrapper, error)

func (*ClickhouseScrapper) Close

func (e *ClickhouseScrapper) Close() error

func (*ClickhouseScrapper) DialectType added in v0.1.8

func (e *ClickhouseScrapper) DialectType() string

func (*ClickhouseScrapper) Executor

func (*ClickhouseScrapper) FetchQueryLogs

func (s *ClickhouseScrapper) FetchQueryLogs(ctx context.Context, from, to time.Time, obfuscator querylogs.QueryObfuscator) (querylogs.QueryLogIterator, error)

func (*ClickhouseScrapper) IsPermissionError added in v0.1.1

func (e *ClickhouseScrapper) IsPermissionError(err error) bool

func (*ClickhouseScrapper) QueryCatalog

func (e *ClickhouseScrapper) QueryCatalog(ctx context.Context) ([]*scrapper.CatalogColumnRow, error)

func (*ClickhouseScrapper) QueryCustomMetrics

func (e *ClickhouseScrapper) QueryCustomMetrics(ctx context.Context, sql string, args ...any) ([]*scrapper.CustomMetricsRow, error)

func (*ClickhouseScrapper) QueryDatabases

func (e *ClickhouseScrapper) QueryDatabases(ctx context.Context) ([]*scrapper.DatabaseRow, error)

func (*ClickhouseScrapper) QuerySegments

func (e *ClickhouseScrapper) QuerySegments(ctx context.Context, sql string, args ...any) ([]*scrapper.SegmentRow, error)

func (*ClickhouseScrapper) QuerySqlDefinitions

func (e *ClickhouseScrapper) QuerySqlDefinitions(ctx context.Context) ([]*scrapper.SqlDefinitionRow, error)

func (*ClickhouseScrapper) QueryTableMetrics

func (e *ClickhouseScrapper) QueryTableMetrics(ctx context.Context, lastMetricsFetchTime time.Time) ([]*scrapper.TableMetricsRow, error)

func (*ClickhouseScrapper) QueryTables

func (e *ClickhouseScrapper) QueryTables(ctx context.Context) ([]*scrapper.TableRow, error)

func (*ClickhouseScrapper) SqlDialect added in v0.1.8

func (e *ClickhouseScrapper) SqlDialect() sqldialect.Dialect

func (*ClickhouseScrapper) ValidateConfiguration

func (e *ClickhouseScrapper) ValidateConfiguration(ctx context.Context) ([]string, error)

type ClickhouseScrapperConf

type ClickhouseScrapperConf struct {
	dwhexecclickhouse.ClickhouseConf
	DatabaseName string
}

Jump to

Keyboard shortcuts

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