Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/common/search-from-results/search-from-results.html
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/common/search-from-results/search-from-results.html	(nonexistent)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/common/search-from-results/search-from-results.html	(working copy)
@@ -0,0 +1,10 @@
+<mat-form-field appearance="outline" class="search-field">
+    <fa-icon [icon]="faSearch" matPrefix class="search-icon"></fa-icon>
+    <mat-label>{{ placeholder }}</mat-label>
+    <input matInput (keyup)="onSearch()" [placeholder]="placeholder" [(ngModel)]="searchKey">
+    @if (searchKey) {
+    <button matSuffix mat-icon-button aria-label="Clear" (click)="clearSearch()">
+        <fa-icon [icon]="faTimes"></fa-icon>
+    </button>
+    }
+</mat-form-field>
\ No newline at end of file
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/common/search-from-results/search-from-results.scss
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/common/search-from-results/search-from-results.scss	(nonexistent)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/common/search-from-results/search-from-results.scss	(working copy)
@@ -0,0 +1,16 @@
+.search-field {
+    font-size: 14px;
+    width: 100%;
+}
+
+.search-icon {
+    margin: 0 8px;
+    color: #757575;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+mat-icon {
+    vertical-align: middle;
+}
\ No newline at end of file
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/common/search-from-results/search-from-results.ts
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/common/search-from-results/search-from-results.ts	(nonexistent)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/common/search-from-results/search-from-results.ts	(working copy)
@@ -0,0 +1,27 @@
+import { Component, EventEmitter, Input, Output } from '@angular/core';
+import { SharedModule } from '../../../shared/shared-module';
+import { faSearch, faTimes } from '@fortawesome/free-solid-svg-icons';
+
+@Component({
+    selector: 'app-search-from-results',
+    imports: [SharedModule],
+    templateUrl: './search-from-results.html',
+    styleUrl: './search-from-results.scss'
+})
+export class SearchFromResults {
+    @Input() placeholder: string = 'Search...';
+    @Output() searchChange = new EventEmitter<string>();
+
+    searchKey: string = '';
+    faSearch = faSearch;
+    faTimes = faTimes;
+
+    onSearch() {
+        this.searchChange.emit(this.searchKey);
+    }
+
+    clearSearch() {
+        this.searchKey = '';
+        this.searchChange.emit(this.searchKey);
+    }
+}
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/device-groups/device-groups.html
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/device-groups/device-groups.html	(revision 2771)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/device-groups/device-groups.html	(working copy)
@@ -8,10 +8,7 @@
 </mat-card>
 
 <div class="table-container">
-  <mat-form-field appearance="outline">
-    <mat-label>Search Group</mat-label>
-    <input matInput (keyup)="applyFilter($event)" placeholder="Ex. Array" #input>
-  </mat-form-field>
+  <app-search-from-results placeholder="Ex. Array" (searchChange)="applyFilter($event)"></app-search-from-results>
 
   <table mat-table [dataSource]="dataSource" class="mat-elevation-z1">
     <ng-container matColumnDef="serial">
@@ -27,13 +24,11 @@
       <td mat-cell *matCellDef="let element">
         <div class="row-action">
           @if (element.device_list && element.device_list.length > 0) {
-            <span
-              [matTooltip]="getTruncatedArrayString(element.device_list).full"
-              matTooltipPosition="above">
-          {{ getTruncatedArrayString(element.device_list).display }}
-        </span>
+          <span [matTooltip]="getTruncatedArrayString(element.device_list).full" matTooltipPosition="above">
+            {{ getTruncatedArrayString(element.device_list).display }}
+          </span>
           } @else {
-            -
+          -
           }
         </div>
       </td>
@@ -42,10 +37,9 @@
       <th mat-header-cell *matHeaderCellDef class="action-header w-10"> Action</th>
       <td mat-cell *matCellDef="let element">
         @if (!(element.device_list && element.device_list.length > 0)) {
-          <div class="row-action a-link">
-            <fa-icon [icon]="['far', 'trash-can']" class="delete-icon"
-                     (click)="confirmDelete(element)"></fa-icon>
-          </div>
+        <div class="row-action a-link">
+          <fa-icon [icon]="['far', 'trash-can']" class="delete-icon" (click)="confirmDelete(element)"></fa-icon>
+        </div>
         }
       </td>
     </ng-container>
@@ -53,13 +47,9 @@
     <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
     <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
 
-    <tr class="mat-row" *matNoDataRow>
-      <td class="mat-cell" colspan="4">No data matching the filter "{{ input.value }}"</td>
+    <tr class="mat-row table-no-data" *matNoDataRow>
+      <td class="mat-cell" colspan="4">No data matching the filter "{{ searchKey }}"</td>
     </tr>
   </table>
-  <mat-paginator
-    [pageSizeOptions]="[10, 15, 20, 25]"
-    [length]="totalRecords"
-    showFirstLastButtons
-  ></mat-paginator>
-</div>
+  <mat-paginator [pageSizeOptions]="[10, 15, 20, 25]" [length]="totalRecords" showFirstLastButtons></mat-paginator>
+</div>
\ No newline at end of file
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/device-groups/device-groups.scss
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/device-groups/device-groups.scss	(revision 2771)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/device-groups/device-groups.scss	(working copy)
@@ -2,11 +2,8 @@
   width: 100%;
 }
 
-.mat-mdc-form-field {
-  font-size: 14px;
-  width: 100%;
-}
 
+
 mat-icon {
   vertical-align: middle;
 }
@@ -25,4 +22,4 @@
 
 .a-link {
   cursor: pointer;
-}
+}
\ No newline at end of file
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/device-groups/device-groups.ts
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/device-groups/device-groups.ts	(revision 2771)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/device-groups/device-groups.ts	(working copy)
@@ -1,18 +1,19 @@
-import {Component, inject, ViewChild} from '@angular/core';
-import {take} from 'rxjs/operators';
-import {NotificationService} from '../../../services/notification';
-import {DeviceService} from '../../../services/device-service';
-import {MatTableDataSource} from '@angular/material/table';
-import {SharedModule} from '../../../shared/shared-module';
-import {Confirmation} from '../../../services/confirmation';
-import {MatDialog, MatDialogRef} from '@angular/material/dialog';
-import {FormBuilder, FormGroup, Validators} from '@angular/forms';
-import {MatPaginator} from '@angular/material/paginator';
-import {GlobalSerialPipe} from '../../../pipes/global-serial-pipe';
+import { Component, inject, ViewChild } from '@angular/core';
+import { take } from 'rxjs/operators';
+import { NotificationService } from '../../../services/notification';
+import { DeviceService } from '../../../services/device-service';
+import { MatTableDataSource } from '@angular/material/table';
+import { SharedModule } from '../../../shared/shared-module';
+import { Confirmation } from '../../../services/confirmation';
+import { MatDialog, MatDialogRef } from '@angular/material/dialog';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { MatPaginator } from '@angular/material/paginator';
+import { GlobalSerialPipe } from '../../../pipes/global-serial-pipe';
+import { SearchFromResults } from '../../common/search-from-results/search-from-results';
 
 @Component({
   selector: 'app-device-groups',
-  imports: [SharedModule, GlobalSerialPipe],
+  imports: [SharedModule, GlobalSerialPipe, SearchFromResults],
   templateUrl: './device-groups.html',
   styleUrl: './device-groups.scss'
 })
@@ -52,23 +53,25 @@
       })
   }
 
-  applyFilter(event: Event) {
-    const filterValue = (event.target as HTMLInputElement).value;
+  searchKey: string = '';
+
+  applyFilter(filterValue: string) {
+    this.searchKey = filterValue;
     this.dataSource.filter = filterValue.trim().toLowerCase();
   }
 
   getTruncatedArrayString(array: any[], maxLength: number = 15): { display: string, full: string } {
     if (!array || array.length === 0) {
-      return {display: '', full: ''};
+      return { display: '', full: '' };
     }
 
     const devicesArray = array.map(item => item.ip);
 
     const fullString = devicesArray.join(', ');
     if (fullString.length > maxLength) {
-      return {display: fullString.substring(0, maxLength) + '...', full: fullString};
+      return { display: fullString.substring(0, maxLength) + '...', full: fullString };
     } else {
-      return {display: fullString, full: fullString};
+      return { display: fullString, full: fullString };
     }
   }
 
@@ -88,7 +91,7 @@
     }).subscribe(result => {
       if (result) {
         let rawPayload = new FormData();
-        rawPayload.set('pk', JSON.stringify({"name": groupName}));
+        rawPayload.set('pk', JSON.stringify({ "name": groupName }));
         this._device.deleteDeviceGroup(rawPayload)
           .pipe(take(1))
           .subscribe({
@@ -124,7 +127,7 @@
     dialogRef.afterClosed().subscribe(result => {
       if (result) {
         let rawPayload = new FormData();
-        rawPayload.set('post_data', JSON.stringify({"name": result?.groupName}));
+        rawPayload.set('post_data', JSON.stringify({ "name": result?.groupName }));
         this._device.addDeviceGroup(rawPayload)
           .pipe(take(1))
           .subscribe({
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/devices/devices.html
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/devices/devices.html	(revision 2771)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/devices/devices.html	(working copy)
@@ -8,10 +8,7 @@
   </mat-card-header>
 </mat-card>
 <div class="table-container">
-  <mat-form-field appearance="outline">
-    <mat-label>Search Device</mat-label>
-    <input matInput (keyup)="applyFilter($event)" placeholder="Ex. Array" #input>
-  </mat-form-field>
+  <app-search-from-results placeholder="Ex. Array" (searchChange)="applyFilter($event)"></app-search-from-results>
 
   <table mat-table [dataSource]="dataSource" class="mat-elevation-z1 an-table">
     <ng-container matColumnDef="serial">
@@ -49,9 +46,9 @@
       <td mat-cell *matCellDef="let element">
         <div class="row-action a-link">
           @if (element.connection) {
-            <fa-icon [icon]="['far', 'check-circle']" class="success-icon"></fa-icon>
+          <fa-icon [icon]="['far', 'check-circle']" class="success-icon"></fa-icon>
           } @else {
-            <fa-icon [icon]="['far', 'xmark-circle']" class="delete-icon"></fa-icon>
+          <fa-icon [icon]="['far', 'xmark-circle']" class="delete-icon"></fa-icon>
           }
         </div>
       </td>
@@ -61,23 +58,28 @@
       <td mat-cell *matCellDef="let element">
         <div class="row-action a-link">
           <fa-icon [icon]="['fas', 'id-badge']" size="lg" (click)="showLicenseDialog(element)"
-                   matTooltip="License"></fa-icon>
-          <a target="_blank"
-             rel="noopener noreferrer"
-             [href]="element?.ip && element?.webui_port ? 'https://' + element.ip + ':' + element.webui_port : '#'">
+            matTooltip="License"></fa-icon>
+          <a target="_blank" rel="noopener noreferrer"
+            [href]="element?.ip && element?.webui_port ? 'https://' + element.ip + ':' + element.webui_port : '#'">
             <fa-icon [icon]="['fas', 'tv']" size="lg" matTooltip="WebUI"></fa-icon>
           </a>
           <fa-icon [icon]="['fas', 'terminal']" size="lg" (click)="openWebConsole(element)" matTooltip="CLI"></fa-icon>
           <fa-icon [icon]="['far', 'save']" size="lg" (click)="confirmSave(element)" matTooltip="Save Config"></fa-icon>
           <fa-icon [icon]="['far', 'trash-can']" size="lg" class="delete-icon" matTooltip="Delete Device"
-                   (click)="confirmDelete(element)"></fa-icon>
+            (click)="confirmDelete(element)"></fa-icon>
         </div>
       </td>
     </ng-container>
     <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
     <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
     <tr class="mat-row table-no-data" *matNoDataRow>
-      <td class="mat-cell" colspan="9">No results found.</td>
+      <td class="mat-cell" colspan="9">
+        @if (searchKey) {
+        No data matching the filter "{{ searchKey }}"
+        } @else {
+        No results found.
+        }
+      </td>
     </tr>
   </table>
-</div>
+</div>
\ No newline at end of file
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/devices/devices.ts
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/devices/devices.ts	(revision 2771)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/devices/devices.ts	(working copy)
@@ -1,21 +1,23 @@
-import {Component, inject, OnInit} from '@angular/core';
-import {MatTableDataSource} from '@angular/material/table';
-import {NotificationService} from '../../../services/notification';
-import {DeviceService} from '../../../services/device-service';
-import {Confirmation} from '../../../services/confirmation';
-import {take} from 'rxjs/operators';
-import {SharedModule} from '../../../shared/shared-module';
-import {MAT_DIALOG_DATA, MatDialog, MatDialogConfig, MatDialogRef} from '@angular/material/dialog';
-import {Storage} from '../../../services/storage';
-import {FormBuilder, FormGroup, Validators} from '@angular/forms';
-import {CustomValidators} from '../../../utils/custom-validators';
-import {Router} from '@angular/router';
-import {GlobalSerialPipe} from '../../../pipes/global-serial-pipe';
-import {KeyValuePair, UtilsService} from '../../../services/utils-service';
+import { Component, inject, OnInit } from '@angular/core';
+import { MatTableDataSource } from '@angular/material/table';
+import { NotificationService } from '../../../services/notification';
+import { DeviceService } from '../../../services/device-service';
+import { Confirmation } from '../../../services/confirmation';
+import { take } from 'rxjs/operators';
+import { SharedModule } from '../../../shared/shared-module';
+import { MAT_DIALOG_DATA, MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';
+import { Storage } from '../../../services/storage';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { CustomValidators } from '../../../utils/custom-validators';
+import { Router } from '@angular/router';
+import { GlobalSerialPipe } from '../../../pipes/global-serial-pipe';
+import { KeyValuePair, UtilsService } from '../../../services/utils-service';
 
+import { SearchFromResults } from '../../common/search-from-results/search-from-results';
+
 @Component({
   selector: 'app-devices',
-  imports: [SharedModule, GlobalSerialPipe], templateUrl: './devices.html', styleUrl: './devices.scss'
+  imports: [SharedModule, GlobalSerialPipe, SearchFromResults], templateUrl: './devices.html', styleUrl: './devices.scss'
 })
 export class Devices {
 
@@ -26,6 +28,7 @@
   dialog = inject(MatDialog);
   dialogConfig = new MatDialogConfig();
   deviceType: any = null;
+  searchKey: string = '';
 
   constructor(
     private _notification: NotificationService,
@@ -69,8 +72,8 @@
       })
   }
 
-  applyFilter(event: Event) {
-    const filterValue = (event.target as HTMLInputElement).value;
+  applyFilter(filterValue: string) {
+    this.searchKey = filterValue;
     this.dataSource.filter = filterValue.trim().toLowerCase();
   }
 
@@ -133,7 +136,7 @@
   openWebConsole(device: any): void {
     const url = this._router.serializeUrl(
       this._router.createUrlTree(['/inventory/web-console'], {
-        queryParams: {device_id: device?.id, device_name: device?.name}
+        queryParams: { device_id: device?.id, device_name: device?.name }
       })
     );
     window.open(url, '_blank');
@@ -207,7 +210,7 @@
 
   goToDetails(device: any) {
     this._router.navigate(['/inventory/devices', device.name], {
-      state: {deviceData: device, groups: this.groups}
+      state: { deviceData: device, groups: this.groups }
     });
   }
 
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/hive/repositories/devices_metrics.py
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/hive/repositories/devices_metrics.py	(revision 2771)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/hive/repositories/devices_metrics.py	(working copy)
@@ -25,7 +25,7 @@
 
         # We need data from slightly further back to calculate the delta for the first bucket.
         safe_duration = total_duration_seconds + (bucket_interval_seconds * 2)
-        network_clauses.append(f"time >= NOW() - INTERVAL '{safe_duration} seconds'")
+        network_clauses.append(f"time >= (NOW() AT TIME ZONE 'UTC') - INTERVAL '{safe_duration} seconds'")
         network_where = "WHERE " + " AND ".join(network_clauses)
 
         _query = f"""
@@ -63,7 +63,7 @@
                 -- *** PATCH: Removed the IS NOT NULL filter ***
 
                 -- Filter to the user's requested time window
-                bucket_time >= NOW() - INTERVAL '{total_duration_seconds} seconds'
+                bucket_time >= (NOW() AT TIME ZONE 'UTC') - INTERVAL '{total_duration_seconds} seconds'
             ORDER BY agent_host, time_epoch; -- Order by host, then time
             """
 
@@ -125,7 +125,7 @@
             network_clauses.append(f"agent_host IN ({placeholders})")
             network_params.extend(agent_hosts)
         # Always include time filter
-        network_clauses.append(f"time >= NOW() - INTERVAL '{interval_seconds} seconds'")
+        network_clauses.append(f"time >= (NOW() AT TIME ZONE 'UTC') - INTERVAL '{interval_seconds} seconds'")
         network_where = ""
         if network_clauses:
             network_where = "WHERE " + " AND ".join(network_clauses)
@@ -142,6 +142,7 @@
                 ROW_NUMBER() OVER(PARTITION BY agent_host ORDER BY time DESC) AS rn
             FROM an_device_metrics
             {metrics_where}
+            {'AND' if metrics_where else 'WHERE'} time >= (NOW() AT TIME ZONE 'UTC') - INTERVAL '10 minutes'
         ),
         NetworkBuckets AS (
             SELECT
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/hive/repositories/system_metrics.py
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/hive/repositories/system_metrics.py	(revision 2771)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/hive/repositories/system_metrics.py	(working copy)
@@ -6,12 +6,12 @@
     @staticmethod
     @with_db_connection
     def get_latest_cpu(cur, host="AN"):
-        cpu_query = "SELECT time, host, 100 - usage_idle as cpu_percent FROM cpu WHERE time IN (SELECT max(time) FROM cpu WHERE host = %s) AND host = %s AND cpu = 'cpu-total' ORDER BY time DESC LIMIT 1;"
-        cur.execute(cpu_query, (host, host))
+        cpu_query = "SELECT time, 100 - usage_idle as cpu_percent FROM cpu WHERE cpu = 'cpu-total' AND time > (NOW() AT TIME ZONE 'UTC') - INTERVAL '5 minutes' ORDER BY time DESC LIMIT 1;"
+        cur.execute(cpu_query)
         result = cur.fetchone()
         cur.close()
         if result:
-            time, host, cpu_percent = result
+            time, cpu_percent = result
             return SystemMetrics(time=time, host=host, cpu_percent=cpu_percent)
         return None
 
@@ -32,14 +32,14 @@
                                       GREATEST(write_bytes::BIGINT - LAG(write_bytes) OVER (PARTITION BY host ORDER BY time), 0) AS write_bytes_diff,
                                       EXTRACT(EPOCH FROM (time - LAG(time) OVER (PARTITION BY host ORDER BY time))) AS time_diff_sec
                                   FROM diskio
-                                  WHERE host = %s
+                                  WHERE time > (NOW() AT TIME ZONE 'UTC') - INTERVAL '5 minutes'
                               ) sub
                          WHERE io_time_total_ms IS NOT NULL
                          GROUP BY bucket_time
                          ORDER BY bucket_time DESC
                          LIMIT 1;
                          """
-        cur.execute(disk_query, (host,))
+        cur.execute(disk_query)
         result = cur.fetchone()
         cur.close()
         if result:
@@ -51,12 +51,12 @@
     @staticmethod
     @with_db_connection
     def get_latest_memory(cur, host="AN"):
-        mem_query = "SELECT time, host, used_percent as mem_percent FROM mem WHERE time IN (SELECT max(time) FROM mem WHERE host = %s) AND host = %s ORDER BY time DESC LIMIT 1;"
-        cur.execute(mem_query, (host, host))
+        mem_query = "SELECT time, used_percent as mem_percent FROM mem WHERE time > (NOW() AT TIME ZONE 'UTC') - INTERVAL '5 minutes' ORDER BY time DESC LIMIT 1;"
+        cur.execute(mem_query)
         result = cur.fetchone()
         cur.close()
         if result:
-            time, host, mem_percent = result
+            time, mem_percent = result
             return SystemMetrics(time=time, host=host, mem_percent=mem_percent)
         return None
 
@@ -65,7 +65,6 @@
     def get_latest_disk_usage(cur, host="AN"):
         disk_query = """
                      SELECT time,
-                            host,
                             device,
                             path,
                             total,
@@ -73,21 +72,20 @@
                             free,
                             used_percent
                      FROM disk
-                     WHERE (host, device, time) IN (SELECT host,
-                                                           device,
-                                                           MAX(time)
+                     WHERE (device, time) IN (SELECT device,
+                                                    MAX(time)
                                                     FROM disk
-                                                    WHERE host = %s
-                                                      AND path NOT LIKE 'tmpfs'
-                                                    GROUP BY host, device)
+                                                    WHERE path NOT LIKE 'tmpfs'
+                                                      AND time > (NOW() AT TIME ZONE 'UTC') - INTERVAL '10 minutes'
+                                                    GROUP BY device)
                      ORDER BY device ASC; \
                      """
 
-        cur.execute(disk_query, (host,))
+        cur.execute(disk_query)
         results = cur.fetchall()
         cur.close()
         metrics_list = []
-        for time, host, device, path, total, used, free, used_percent in results:
+        for time, device, path, total, used, free, used_percent in results:
             metrics_list.append(DiskMetrics(
                 time=time,
                 host=host,
@@ -117,7 +115,7 @@
                                  GREATEST(bytes_recv::BIGINT - LAG(bytes_recv) OVER (PARTITION BY host, interface ORDER BY time), 0) AS bytes_recv_diff,
                                  EXTRACT(EPOCH FROM (time - LAG(time) OVER (PARTITION BY host, interface ORDER BY time))) AS time_diff_sec
                              FROM net
-                             WHERE host = %s AND interface NOT LIKE 'lo' AND interface NOT LIKE 'all'
+                             WHERE interface NOT LIKE 'lo' AND interface NOT LIKE 'all' AND time > (NOW() AT TIME ZONE 'UTC') - INTERVAL '5 minutes'
                          ) sub
                     WHERE bytes_sent_diff IS NOT NULL
                     GROUP BY bucket_time, interface
@@ -147,12 +145,11 @@
                            last(100 - usage_idle, time) AS cpu_usage
                     FROM cpu
                     WHERE time BETWEEN %s AND %s
-                      AND host = %s
                       AND cpu = 'cpu-total'
                     GROUP BY bucket_time
                     ORDER BY bucket_time ASC; \
                     """
-        cur.execute(cpu_query, (bucket_interval, start_time, end_time, host))
+        cur.execute(cpu_query, (bucket_interval, start_time, end_time))
         results = cur.fetchall()
         cur.close()
 
@@ -173,11 +170,10 @@
                            last(used_percent, time) AS mem_usage
                     FROM mem
                     WHERE time BETWEEN %s AND %s
-                      AND host = %s
                     GROUP BY bucket_time
                     ORDER BY bucket_time ASC; \
                     """
-        cur.execute(mem_query, (bucket_interval, start_time, end_time, host))
+        cur.execute(mem_query, (bucket_interval, start_time, end_time))
         results = cur.fetchall()
         cur.close()
 
@@ -202,13 +198,12 @@
                                           io_time,
                                           LAG(io_time) OVER (PARTITION BY host ORDER BY time) AS prev_io_time
                                    FROM diskio
-                                   WHERE host = %s
-                                     AND time BETWEEN %s AND %s) sub
+                                   WHERE time BETWEEN %s AND %s) sub
                              WHERE prev_io_time IS NOT NULL
                              GROUP BY bucket_time) final
                        ORDER BY bucket_time ASC; \
                        """
-        cur.execute(disk_io_query, (host, start_time, end_time))
+        cur.execute(disk_io_query, (start_time, end_time))
         results = cur.fetchall()
         cur.close()
 
@@ -241,14 +236,13 @@
                                  EXTRACT(EPOCH FROM
                                          (time - LAG(time) OVER (PARTITION BY host, interface ORDER BY time)))            AS time_diff_sec
                           FROM net
-                          WHERE host = %s
-                            AND interface NOT LIKE 'lo' AND interface NOT LIKE 'all'
+                          WHERE interface NOT LIKE 'lo' AND interface NOT LIKE 'all'
                             AND time BETWEEN %s AND %s) sub
                     WHERE bytes_sent_diff IS NOT NULL
                     GROUP BY bucket_time, interface
                     ORDER BY bucket_time ASC; \
                     """
-        cur.execute(net_query, (host, start_time, end_time))
+        cur.execute(net_query, (start_time, end_time))
         results = cur.fetchall()
         cur.close()
 
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/hive/services/system_metrics.py
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/hive/services/system_metrics.py	(revision 2771)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/hive/services/system_metrics.py	(working copy)
@@ -3,12 +3,22 @@
 from hive.repositories.system_metrics import SystemMetricsRepo
 
 
+from concurrent.futures import ThreadPoolExecutor
+
 def get_latest_system_metrics():
-    cpu_metrics = SystemMetricsRepo.get_latest_cpu()
-    mem_metrics = SystemMetricsRepo.get_latest_memory()
-    disk_io_metrics = SystemMetricsRepo.get_latest_disk_io()
-    disk_metrics = SystemMetricsRepo.get_latest_disk_usage()
-    net_metrics = SystemMetricsRepo.get_latest_throughput()
+    with ThreadPoolExecutor() as executor:
+        future_cpu = executor.submit(SystemMetricsRepo.get_latest_cpu)
+        future_mem = executor.submit(SystemMetricsRepo.get_latest_memory)
+        future_disk_io = executor.submit(SystemMetricsRepo.get_latest_disk_io)
+        future_disk = executor.submit(SystemMetricsRepo.get_latest_disk_usage)
+        future_net = executor.submit(SystemMetricsRepo.get_latest_throughput)
+
+        cpu_metrics = future_cpu.result()
+        mem_metrics = future_mem.result()
+        disk_io_metrics = future_disk_io.result()
+        disk_metrics = future_disk.result()
+        net_metrics = future_net.result()
+
     return {
         'cpu': cpu_metrics.to_dict() if cpu_metrics else None,
         'memory': mem_metrics.to_dict() if mem_metrics else None,
@@ -52,10 +62,17 @@
 
 
 def get_historical_system_metrics():
-    cpu_metrics = _get_historical_cpu_metrics()
-    mem_metrics = _get_historical_mem_metrics()
-    disk_io_metrics = _get_historical_disk_io_metrics()
-    net_metrics = _get_historical_net_metrics()
+    with ThreadPoolExecutor() as executor:
+        future_cpu = executor.submit(_get_historical_cpu_metrics)
+        future_mem = executor.submit(_get_historical_mem_metrics)
+        future_disk_io = executor.submit(_get_historical_disk_io_metrics)
+        future_net = executor.submit(_get_historical_net_metrics)
+
+        cpu_metrics = future_cpu.result()
+        mem_metrics = future_mem.result()
+        disk_io_metrics = future_disk_io.result()
+        net_metrics = future_net.result()
+
     return {
         'cpu_history': cpu_metrics,
         'mem_history': mem_metrics,
