diff options
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/db.rs b/src/db.rs index 6edeba1..d0a2c7d 100644 --- a/src/db.rs +++ b/src/db.rs @@ -59,7 +59,7 @@ impl Database { pub fn get_last_n_host_meminfo(&self, count: usize) -> Vec<DbMeminfo> { let conn = self.conn.lock().unwrap(); let mut stmt = conn - .prepare("SELECT * FROM stats_hostmem ORDER BY stamp ASC LIMIT ?1") + .prepare("SELECT * FROM stats_hostmem ORDER BY stamp DESC LIMIT ?1") .unwrap(); stmt.query_map(params![count], |row| { @@ -82,7 +82,7 @@ impl Database { ) -> Vec<DbMeminfo> { let conn = self.conn.lock().unwrap(); let mut stmt = conn - .prepare("SELECT * FROM stats_hostmem WHERE stamp > ?1 AND stamp < ?2 ORDER BY stamp ASC LIMIT ?3") + .prepare("SELECT * FROM stats_hostmem WHERE stamp > ?1 AND stamp < ?2 ORDER BY stamp DESC LIMIT ?3") .unwrap(); stmt.query_map(params![since, until, count], |row| { @@ -110,7 +110,7 @@ impl Database { pub fn get_last_n_hostnet(&self, count: usize) -> Vec<DbNetinfo> { let conn = self.conn.lock().unwrap(); let mut stmt = conn - .prepare("SELECT * FROM stats_hostnet ORDER BY stamp ASC LIMIT ?1") + .prepare("SELECT * FROM stats_hostnet ORDER BY stamp DESC LIMIT ?1") .unwrap(); stmt.query_map(params![count], |row| { |