helper

package
Version: v0.0.0-...-dcd0f7d Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2018 License: Apache-2.0 Imports: 17 Imported by: 6

Documentation

Index

Constants

View Source
const (
	FlamegraphInsertHttpQuery = "" /* 135-byte string literal not displayed */
	FlamegraphInsertQuery     = "" /* 185-byte string literal not displayed */
	BaseLevel                 = 0
)
View Source
const (
	FlamegraphClusterInsertHTTPQuery = "INSERT INTO flamegraph_clusters (type, cluster, date, server, version)"
	FlamegraphClusterInsertQuery     = "INSERT INTO flamegraph_clusters (type, cluster, date, server, version) VALUES (?, ?, ?, ?, ?)"
)
View Source
const (
	FlamegraphTimestampInsertHTTPQuery = "INSERT INTO flamegraph_timestamps (type, cluster, timestamp, date, version)"
	FlamegraphTimestampInsertQuery     = "INSERT INTO flamegraph_timestamps (type, cluster, timestamp, date, version) VALUES (?, ?, ?, ?, ?)"
)
View Source
const (
	MetricStatInsertHTTPQuery = "INSERT INTO metricstats (timestamp, type, cluster, name, mtime, atime, rdtime, server, date, version)"

	MetricStatInsertQuery = "" /* 139-byte string literal not displayed */
)

Variables

View Source
var ErrGracefulCommitNotEnoughLines = fmt.Errorf("not enough lines to commit")

Functions

func DBStartTransaction

func DBStartTransaction(db *sql.DB, query string) (*sql.Tx, *sql.Stmt, error)

func NameToIdInt64

func NameToIdInt64(name string) int64

func NameToIdUint64

func NameToIdUint64(name string) uint64

func ReconstructTree

func ReconstructTree(data map[int64]types.ClickhouseField, root *types.FlameGraphNode, minValue int64)

Types

type ClickhouseConfig

type ClickhouseConfig struct {
	ClickhouseServers []string `yaml:"servers"`
	ClickhouseHost    string   `yaml:"host"`
	Cluster           string   `yaml:"cluster"`
	RowsPerInsert     int      `yaml:"rows_per_insert"`

	UseDistributedTables   bool   `yaml:"use_distributed_tables"`
	DistributedClusterName string `yaml:"distributed_cluster_name"`
}

type ClickhouseHTTPSender

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

func NewClickhouseHTTPSender

func NewClickhouseHTTPSender(servers []string, query string) *ClickhouseHTTPSender

func (*ClickhouseHTTPSender) Commit

func (c *ClickhouseHTTPSender) Commit() error

func (*ClickhouseHTTPSender) NewRequest

func (c *ClickhouseHTTPSender) NewRequest() error

func (*ClickhouseHTTPSender) SendClusterHTTP

func (c *ClickhouseHTTPSender) SendClusterHTTP(cluster, server string) error

func (*ClickhouseHTTPSender) SendFlatFgPB

func (c *ClickhouseHTTPSender) SendFlatFgPB(node *fgpb.FlameGraphFlat) error

func (*ClickhouseHTTPSender) SendMetricstatsHTTP

func (c *ClickhouseHTTPSender) SendMetricstatsHTTP(node *fgpb.FlatMetricInfo) error

func (*ClickhouseHTTPSender) SendTimestampHTTP

func (c *ClickhouseHTTPSender) SendTimestampHTTP(graphType, cluster string, timestamp int64) error

type ClickhouseSender

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

func NewClickhouseSender

func NewClickhouseSender(db *sql.DB, query string, t int64, rowsPerInsert int) (*ClickhouseSender, error)

func (*ClickhouseSender) Commit

func (c *ClickhouseSender) Commit() (int64, error)

func (*ClickhouseSender) CommitAndRenew

func (c *ClickhouseSender) CommitAndRenew(tx *sql.Tx, query string) error

func (*ClickhouseSender) GracefulCommit

func (c *ClickhouseSender) GracefulCommit() error

func (*ClickhouseSender) SendCluster

func (c *ClickhouseSender) SendCluster(cluster, server string) error

func (*ClickhouseSender) SendFg

func (c *ClickhouseSender) SendFg(cluster, name string, id int64, mtime int64, total, value, parentID int64, childrenIds []int64, level uint64) error

func (*ClickhouseSender) SendFgPB

func (c *ClickhouseSender) SendFgPB(tree *fgpb.FlameGraph) error

func (*ClickhouseSender) SendFlatFgPB

func (c *ClickhouseSender) SendFlatFgPB(node *fgpb.FlameGraphFlat) error

func (*ClickhouseSender) SendFlatMetricStatsPB

func (c *ClickhouseSender) SendFlatMetricStatsPB(stats *fgpb.FlatMetricInfo) error

func (*ClickhouseSender) SendMetricStats

func (c *ClickhouseSender) SendMetricStats(timestamp int64, cluster, path string, mtime, atime, rdtime, count int64) error

func (*ClickhouseSender) SendMetricStatsPB

func (c *ClickhouseSender) SendMetricStatsPB(stats *fgpb.MultiMetricStats) error

func (*ClickhouseSender) SendStacktrace

func (c *ClickhouseSender) SendStacktrace(data *types.StackFlameGraphNode, fullName string) error

func (*ClickhouseSender) SendStacktraceTimestamp

func (c *ClickhouseSender) SendStacktraceTimestamp(data *types.StackFlameGraphNode) error

"INSERT INTO stacktraceTimestamps (Timestamp, Application, Instance, Date, Version)

func (*ClickhouseSender) SendTimestamp

func (c *ClickhouseSender) SendTimestamp(graphType, cluster string, timestamp int64) error

type Query

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

func NewQuery

func NewQuery(db *sql.DB, ts, application, instance, samples string, minValue int64) (*Query, error)

func (*Query) GetStackFlamegraph

func (q *Query) GetStackFlamegraph(showFileNames bool) (*types.FlameGraphNode, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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