metrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetColdStartDurationStatistics

func GetColdStartDurationStatistics(
	ctx context.Context,
	logsFetcher sdkinterfaces.LogsInsightsFetcher,
	cwFetcher sdkinterfaces.CloudWatchFetcher,
	invocationsCache sdkinterfaces.Cache,
	query sdktypes.FunctionQuery,
) (*sdktypes.ColdStartDurationStatisticsReturn, error)

GetColdStartDurationStatistics calculates colstart duration statistics of an AWS Lambda function over a specified time range and qualifier (version). It does not use the duration metric from cloudwatch, as there is a risk of aggregating durations depending on the period

func GetColdStartRate

GetColdStartRate calculates the cold start rate of an AWS Lambda function over a specified time range and qualifier (version). The cold start rate is computed as cold starts divided by total invocations.

func GetDurationStatistics

func GetDurationStatistics(
	ctx context.Context,
	logsFetcher sdkinterfaces.LogsInsightsFetcher,
	cwFetcher sdkinterfaces.CloudWatchFetcher,
	invocationsCache sdkinterfaces.Cache,
	query sdktypes.FunctionQuery,
) (*sdktypes.DurationStatisticsReturn, error)

GetDurationStatistics calculates duration statistics of an AWS Lambda function over a specified time range and qualifier (version). It does not use the duration metric from cloudwatch, as there is a risk of aggregating durations depending on the period

func GetErrorRate

func GetErrorRate(
	ctx context.Context,
	cwFetcher sdkinterfaces.CloudWatchFetcher,
	invocationsCache sdkinterfaces.Cache,
	query sdktypes.FunctionQuery,
) (*sdktypes.ErrorRateReturn, error)

GetErrorRate calculates the ratio of errors and total invoations of an AWS Lambda function over a specified time range and qualifier (version).

func GetErrorTypes

GetErrorTypes counts the different errors that occur over a specified time range and qualifier (version). It uses a regex to search for the error in an [ERROR] line in logs and groups them based on semantics.

func GetFunctionConfiguration

func GetFunctionConfiguration(
	ctx context.Context,
	lambdaClient sdkinterfaces.LambdaClient,
	query sdktypes.FunctionQuery,
) (*sdktypes.BaseStatisticsReturn, error)

GetFunctionConfiguration gets configurations of an AWS Lambda function with a sprcific qualifier.

func GetMaxMemoryUsageStatistics

func GetMaxMemoryUsageStatistics(
	ctx context.Context,
	logsFetcher sdkinterfaces.LogsInsightsFetcher,
	cwFetcher sdkinterfaces.CloudWatchFetcher,
	invocationsCache sdkinterfaces.Cache,
	query sdktypes.FunctionQuery,
) (*sdktypes.MemoryUsagePercentilesReturn, error)

GetMaxMemoryUsageStatistics calculates statistics on the maximum used memory of an AWS Lambda functions invocations over a specified time range and qualifier (version).

func GetThrottleRate

func GetThrottleRate(
	ctx context.Context,
	cwFetcher sdkinterfaces.CloudWatchFetcher,
	invocationsCache sdkinterfaces.Cache,
	query sdktypes.FunctionQuery,
) (*sdktypes.ThrottleRateReturn, error)

GetThrottleRate calculates the throttle rate of an AWS Lambda function over a specified time range and qualifier (version). The throttle rate is computed as throttled invocations divided by total invocations.

func GetTimeoutRate

GetTimeoutRate calculates the timeout rate of an AWS Lambda function over a specified time range and qualifier (version). The timeout rate is computed as timed-out invocations divided by total invocations.

func GetWasteRatio

GetWasteRatio calculates the ratio between billed duration and execution duration of an AWS Lambda function over a specified time range and qualifier (version). The waste ratio is computed as: (billed duration - total duration / billed duration)

Types

This section is empty.

Jump to

Keyboard shortcuts

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