src/api2/admin/datastore.rs: implement API to return last GC status

This commit is contained in:
Dietmar Maurer
2019-04-11 12:04:25 +02:00
parent 8d76e8b773
commit f2b99c34f7
3 changed files with 21 additions and 4 deletions

View File

@ -4,12 +4,15 @@ use std::path::{Path, PathBuf};
use std::io::{Read, Write};
use std::sync::{Arc, Mutex};
use std::os::unix::io::AsRawFd;
use serde_derive::Serialize;
use openssl::sha;
use crate::tools;
#[derive(Clone, Serialize)]
pub struct GarbageCollectionStatus {
pub upid: Option<String>,
pub used_bytes: usize,
pub used_chunks: usize,
pub disk_bytes: usize,
@ -19,6 +22,7 @@ pub struct GarbageCollectionStatus {
impl Default for GarbageCollectionStatus {
fn default() -> Self {
GarbageCollectionStatus {
upid: None,
used_bytes: 0,
used_chunks: 0,
disk_bytes: 0,