diff --git a/README.md b/README.md index 4bda25c..2a5b05d 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ Run the binary via terminal to view a full list of options: ./procchi -p 7766 -u test -k test # (If `-u` and `-k` are not specified, Procchi will prompt for credentials before deploying the web server, which is reccommended) -# Start Procchi on the default port (6565), and have it retain only 50 elements in metric history for each metric -./procchi -h 50 +# Start Procchi on the default port (6565), and have it retain a max of 50 elements in metric history for each metric +./procchi -m 50 # Start Procchi configured to update every 10 seconds (instead of the default of 5 seconds) ./procchi -r 10 diff --git a/backend/src/main.rs b/backend/src/main.rs index 811ab7c..43b78b1 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -55,7 +55,7 @@ struct Args { port: u16, /// Max amount of history to keep at once for each metric - #[arg(short, long, default_value = "100")] + #[arg(short = 'm', long, default_value = "100")] history_max: usize, /// Rate (in seconds) at which to update the resource monitor diff --git a/frontend/src/pages/Home/data.tsx b/frontend/src/pages/Home/data.tsx index 7e48fa6..dc8db48 100644 --- a/frontend/src/pages/Home/data.tsx +++ b/frontend/src/pages/Home/data.tsx @@ -107,6 +107,14 @@ export function DataHome(props: Props) { xLabel="Time" yLabel="Disk Usage (GB)" min={0} + max={ + // get the largest disk size + Math.max( + ...Object.keys(diskData).map((disk) => { + return diskData[disk][0].total + }) + ) / 1024 / 1024 / 1024 + } datasets={Object.keys(diskData).map((disk, i) => { return { data: diskData[disk].map((v) => {