mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-25 01:10:37 +00:00
feat: implement /api/v1/labels for prometheus (#1580)
* feat: implement /api/v1/labels for prometheus * fix: only gather match[] * chore: fix typo * chore: fix typo * chore: change style * fix: suggestion * fix: suggestion * chore: typo * fix: fmt * fix: add more test
This commit is contained in:
@@ -22,6 +22,13 @@ pub fn current_time_rfc3339() -> String {
|
||||
chrono::Utc::now().to_rfc3339()
|
||||
}
|
||||
|
||||
/// Returns the yesterday time in rfc3339 format.
|
||||
pub fn yesterday_rfc3339() -> String {
|
||||
let now = chrono::Utc::now();
|
||||
let day_before = now - chrono::Duration::days(1);
|
||||
day_before.to_rfc3339()
|
||||
}
|
||||
|
||||
/// Port of rust unstable features `int_roundings`.
|
||||
pub(crate) fn div_ceil(this: i64, rhs: i64) -> i64 {
|
||||
let d = this / rhs;
|
||||
|
||||
Reference in New Issue
Block a user