Documentation
¶
Index ¶
- Constants
- Variables
- func AddToDefaultPathChksum(pathStr string) error
- func CleanPath(pathStr string) string
- func DefaultFileHasher(filePath string) (uint64, error)
- func GetCollectors() []prometheus.Collector
- func IncHotloadChangeTotal(url string)
- func ObserveHotloadModtimeLatencyHistogram(strategy, path string, val float64)
- func ResetCollectors()
- func SetHotloadLastChangedTimestampSeconds(url string, val float64)
- type FileHasher
Constants ¶
View Source
const ( GRPCMethodKey = "grpc_method" GRPCServiceKey = "grpc_service" StatementKey = "stmt" // either exec or query ExecStatement = "exec" QueryStatement = "query" StrategyKey = "strategy" PathKey = "path" UrlKey = "url" )
View Source
const (
PathChksumMetricsEnableEnvVar = "HOTLOAD_PATH_CHKSUM_METRICS_ENABLE"
)
Variables ¶
View Source
var ( ErrDuplicatePath = errors.New("duplicate path") ErrPathNotFound = errors.New("path not found") HotloadPathChksumTimestampSecondsName = "hotload_path_chksum_timestamp_seconds" HotloadPathChksumTimestampSecondsHelp = "Hotload path checksum last changed (unix timestamp), by path" HotloadPathChksumTimestampSecondsGaugeFuncVec = gaugefuncvec.New(prometheus.GaugeOpts{ Name: HotloadPathChksumTimestampSecondsName, Help: HotloadPathChksumTimestampSecondsHelp, }, []string{PathKey}) )
View Source
var ExpectHotloadPathChksumTimestampSecondsPreamble = `` /* 233-byte string literal not displayed */
View Source
var ExpectHotloadPathChksumTimestampSecondsRegexp = `
hotload_path_chksum_timestamp_seconds{path="%s"} \d\.\d+e\+\d+`
View Source
var HotloadChangeTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: HotloadChangeTotalName, Help: HotloadChangeTotalHelp, }, []string{UrlKey})
View Source
var HotloadChangeTotalHelp = "Hotload change total by url"
View Source
var HotloadChangeTotalName = "hotload_change_total"
HotloadChangeTotal is count of changes detected by hotload
View Source
var HotloadLastChangedTimestampSeconds = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: HotloadLastChangedTimestampSecondsName, Help: HotloadLastChangedTimestampSecondsHelp, }, []string{UrlKey})
View Source
var HotloadLastChangedTimestampSecondsHelp = "Hotload last changed (unix timestamp), by url"
View Source
var HotloadLastChangedTimestampSecondsName = "hotload_last_changed_timestamp_seconds"
HotloadLastChangedTimestampSeconds is timestamp when hotload last detected change (unix timestamp)
View Source
var HotloadModtimeLatencyHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: HotloadModtimeLatencyHistogramName, Help: HotloadModtimeLatencyHistogramHelp, Buckets: HotloadModtimeLatencyHistogramDefBuckets, }, []string{StrategyKey, PathKey})
View Source
var HotloadModtimeLatencyHistogramDefBuckets = []float64{900, 1800, 2700, 3600, 4500, 5400, 7200, 10800, 14400, 28800, 86400}
View Source
var HotloadModtimeLatencyHistogramHelp = "Hotload modtime latency histogram (seconds) by strategy and path"
View Source
var HotloadModtimeLatencyHistogramName = "hotload_modtime_latency_histogram"
HotloadModtimeLatencyHistogram is modtime latency histogram (in seconds) ie: each sample datapoint is time.Now().Sub(Modtime)
View Source
var SqlStmtsSummary = prometheus.NewSummaryVec(prometheus.SummaryOpts{ Name: SqlStmtsSummaryName, Help: "The number of sql stmts called in a transaction by statement type per grpc service and method", }, []string{GRPCServiceKey, GRPCMethodKey, StatementKey})
View Source
var SqlStmtsSummaryName = "transaction_sql_stmts"
SqlStmtsSummary is a prometheus metric to keep track of the number of times a sql statement is called in a transaction by statement type per grpc service
Functions ¶
func AddToDefaultPathChksum ¶ added in v1.7.3
AddToDefaultPathChksum adds a path to the global defaultPathChksum for checksum metrics
func DefaultFileHasher ¶ added in v1.7.3
DefaultFileHasher hashes file contents using CRC64
func GetCollectors ¶
func GetCollectors() []prometheus.Collector
func IncHotloadChangeTotal ¶ added in v1.7.0
func IncHotloadChangeTotal(url string)
func SetHotloadLastChangedTimestampSeconds ¶ added in v1.7.2
Types ¶
type FileHasher ¶ added in v1.7.3
Define FileHasher type so we can mock it for unit-testing
Click to show internal directories.
Click to hide internal directories.