usageStats

package
v0.0.0-...-9e27111 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 14 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var QueryStatsMap = make(map[uint64]*QueryStats)

Functions

func FlushStatsToFile

func FlushStatsToFile(orgid uint64) error

func ForceFlushStatstoFile

func ForceFlushStatstoFile()

func GetBaseStatsDir

func GetBaseStatsDir(orgid uint64) string

func GetCurrentMetricsStats

func GetCurrentMetricsStats(orgid uint64) (uint64, uint64)

func GetQueryCount

func GetQueryCount()

func GetQueryStats

func GetQueryStats(orgid uint64) (uint64, float64, uint64)

func GetTotalLogLines

func GetTotalLogLines(orgid uint64) uint64

func GetUsageStats

func GetUsageStats(pastXhours uint64, granularity UsageStatsGranularity, orgid uint64) (map[string]ReadStats, error)

Calculate total bytesCount,linesCount and return hourly / daily count

func ReadQueryStats

func ReadQueryStats(orgid uint64) error

func StartUsageStats

func StartUsageStats()

func UpdateCompressedStats

func UpdateCompressedStats(segFileSize int64, orgid uint64)

func UpdateMetricsStats

func UpdateMetricsStats(bytesCount uint64, incomingMetrics uint64, orgid uint64)

func UpdateQueryStats

func UpdateQueryStats(queryCount uint64, totalRespTime float64, orgid uint64)

func UpdateStats

func UpdateStats(bytesCount uint64, logLinesCount uint64, orgid uint64)

Types

type CompressedStats

type CompressedStats struct {
	CompressedBytes int64
	TimeStamp       time.Time
}

type QueryStats

type QueryStats struct {
	QueryCount          uint64
	QueriesSinceInstall uint64
	TotalRespTime       float64
}

type ReadStats

type ReadStats struct {
	BytesCount             uint64
	EventCount             uint64
	MetricsDatapointsCount uint64
	TimeStamp              time.Time
}

type Stats

type Stats struct {
	BytesCount                  uint64
	LogLinesCount               uint64
	TotalBytesCount             uint64
	TotalLogLinesCount          uint64
	MetricsDatapointsCount      uint64
	TotalMetricsDatapointsCount uint64
}

type UsageStatsGranularity

type UsageStatsGranularity uint8
const (
	Hourly UsageStatsGranularity = iota + 1
	Daily
)

Jump to

Keyboard shortcuts

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