Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(remap transform): add parse_duration function #4186

Merged
merged 2 commits into from Oct 1, 2020

Conversation

JeanMertz
Copy link
Contributor

@JeanMertz JeanMertz commented Sep 29, 2020

.duration = "300ms"
.duration_seconds = parse_duration(.duration, output = "s") // 0.3

closes #3733

@JeanMertz JeanMertz added type: feature A value-adding code addition that introduce new functionality. domain: vrl Anything related to the Vector Remap Language transform: remap Anything `remap` transform related labels Sep 29, 2020
@JeanMertz JeanMertz added this to the 2020-09-28 - Derezzed milestone Sep 29, 2020
@JeanMertz JeanMertz self-assigned this Sep 29, 2020
Copy link
Contributor

@StephenWakely StephenWakely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a touch of regex fear..

src/mapping/query/function/parse_duration.rs Outdated Show resolved Hide resolved
@binarylogic
Copy link
Contributor

Looking good. You think unit is a better name than format for the argument?

Copy link
Member

@bruceg bruceg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks ok, but some questions about "format" vs "convert".

src/mapping/query/function/parse_duration.rs Show resolved Hide resolved
src/mapping/query/function/parse_duration.rs Outdated Show resolved Hide resolved
src/mapping/query/function/parse_duration.rs Outdated Show resolved Hide resolved
src/mapping/query/function/parse_duration.rs Outdated Show resolved Hide resolved
src/mapping/query/function/parse_duration.rs Outdated Show resolved Hide resolved
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 9fceb7d into master Oct 1, 2020
@JeanMertz JeanMertz deleted the jean/remap-parse_duration branch October 1, 2020 13:07
mengesb pushed a commit to jacobbraaten/vector that referenced this pull request Dec 9, 2020
Signed-off-by: Brian Menges <brian.menges@anaplan.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: vrl Anything related to the Vector Remap Language transform: remap Anything `remap` transform related type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New parse_duration remap function
4 participants