mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-14 16:12:19 +00:00
add experimental rrd api to get cpu stats
This commit is contained in:
parent
5bc85d2d04
commit
1c0117790f
@ -9,6 +9,8 @@ use serde_json::Value;
|
|||||||
|
|
||||||
use proxmox::tools::fs::{create_path, CreateOptions};
|
use proxmox::tools::fs::{create_path, CreateOptions};
|
||||||
|
|
||||||
|
use crate::api2::types::{RRDMode, RRDTimeFrameResolution};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
const PBS_RRD_BASEDIR: &str = "/var/lib/proxmox-backup/rrdb";
|
const PBS_RRD_BASEDIR: &str = "/var/lib/proxmox-backup/rrdb";
|
||||||
|
@ -4,23 +4,10 @@ use std::path::Path;
|
|||||||
use anyhow::{bail, Error};
|
use anyhow::{bail, Error};
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
|
use crate::api2::types::{RRDMode, RRDTimeFrameResolution};
|
||||||
|
|
||||||
const RRD_DATA_ENTRIES: usize = 70;
|
const RRD_DATA_ENTRIES: usize = 70;
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
|
||||||
pub enum RRDMode {
|
|
||||||
Max,
|
|
||||||
Average,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[repr(u64)]
|
|
||||||
#[derive(Copy, Clone)]
|
|
||||||
pub enum RRDTimeFrameResolution {
|
|
||||||
Hour = 60, // 1 min => last 70 minutes
|
|
||||||
Day = 60*30, // 30 min => last 35 hours
|
|
||||||
Week = 60*180, // 3 hours => about 8 days
|
|
||||||
Month = 60*720, // 12 hours => last 35 days
|
|
||||||
Year = 60*10080, // 1 week => last 490 days
|
|
||||||
}
|
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Default, Copy, Clone)]
|
#[derive(Default, Copy, Clone)]
|
||||||
|
Loading…
Reference in New Issue
Block a user