You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to facilitate proper time manipulation, arithmetic, and comparison it will be very useful to have Durations.
Create an OTTL Converter Function, probably called Duration, that is able to create a new time.Duration type from a string. Something similar to https://pkg.go.dev/time#ParseDuration can be used.
The function should take 1 parameters, a string (represented as a StringGetter) that represents the duration in Go format, such as 1s for 1 second or 2h for 2 hours or 3m30s for 3 minutes and 30 seconds.
The text was updated successfully, but these errors were encountered:
TylerHelmuth
changed the title
Create a Convert function for handling Durations
[pkg/ottl] Converter Function that is able to create a new time.Duration type from a string.
May 16, 2023
TylerHelmuth
changed the title
[pkg/ottl] Converter Function that is able to create a new time.Duration type from a string.
[pkg/ottl] Converter Function that is able to create a new time.Duration type from a string.
May 23, 2023
Description: Added a converter function that takes a string
representation of a duration and converts it to a Golang duration.
Link to tracking Issue:
#22015
Testing: Unit tests for stringGetter to duration.
Documentation:
---------
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
In order to facilitate proper time manipulation, arithmetic, and comparison it will be very useful to have Durations.
Create an OTTL Converter Function, probably called
Duration
, that is able to create a newtime.Duration
type from a string. Something similar to https://pkg.go.dev/time#ParseDuration can be used.The function should take 1 parameters, a string (represented as a
StringGetter
) that represents the duration in Go format, such as1s
for 1 second or2h
for 2 hours or3m30s
for 3 minutes and 30 seconds.The text was updated successfully, but these errors were encountered: