metricsformatter

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package metricsformatter provides functionality for manipulating data to be used for metrics collection.

Index

Examples

Constants

View Source
const (
	// Unavailable is the default reported value for an unavailable metric.
	Unavailable = -1.0
)

Variables

This section is empty.

Functions

func PerMinuteToPerSec

func PerMinuteToPerSec(perMinute float64) int64

PerMinuteToPerSec converts a per-minute value to per-second value, rounding to the nearest integer.

Example
fmt.Println(PerMinuteToPerSec(90))
Output:

2

func ToPercentage

func ToPercentage(value float64, precision int) float64

ToPercentage converts a value into a percentage (out of one hundred) with the given precision.

Example
fmt.Println(ToPercentage(0.12345, 4))
Output:

12.35

Types

This section is empty.

Jump to

Keyboard shortcuts

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