Skip to content

Commit

Permalink
Merge branch 'master' into renovate/vertxversion
Browse files Browse the repository at this point in the history
  • Loading branch information
BFergerson authored Jun 23, 2023
2 parents 1f1d375 + 00b1961 commit 6ca896e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/kotlin/spp/protocol/artifact/metrics/MetricStep.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,17 @@ enum class MetricStep {
}
return Instant.from(formatter.parse(value))
}

companion object {
fun fromBucketFormat(value: String): MetricStep {
return values().firstOrNull {
try {
it.bucketFormatter.parse(value)
true
} catch (ignore: Exception) {
false
}
} ?: throw IllegalArgumentException("Invalid date time format: $value")
}
}
}

0 comments on commit 6ca896e

Please sign in to comment.