Building a Realtime AngularJS Dashboard using Spring Rest and MongoDB — Part 2

Building a Realtime AngularJS Dashboard using Spring Rest and MongoDB — Part 2

This post is a continuation of where we left off from our previous post “Building a Realtime AngularJS Dashboard using Spring Rest and MongoDB — Part 1”.

Our Realtime Dashboard AngularJS Application

DashboardCpu

The Model Class for DiskStatistics (DiskStatistics.java)

package com.avaldes.model;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.codehaus.jackson.annotate.JsonProperty;

@XmlRootElement(name = "disk_statistics")
public class DiskStatistics {
  private long availableBytes;
  private double diskQueue;
  private long diskReadBytes;
  private long diskReads;
  private double diskServiceTime;
  private long diskWriteBytes;
  private long freeBytes;
  private long freeFiles;
  private long totalFiles;
  private long usedBytes;
  private double usePercentage;
  
  @XmlElement(name="available_bytes") 
  @JsonProperty("available_bytes")
  public long getAvailableBytes() {
    return availableBytes;
  }
  
  public void setAvailableBytes(long availableBytes) {
    this.availableBytes = availableBytes;
  }

  @XmlElement(name="disk_queue") 
  @JsonProperty("disk_queue")
  public double getDiskQueue() {
    return diskQueue;
  }

  public void setDiskQueue(double diskQueue) {
    this.diskQueue = diskQueue;
  }

  @XmlElement(name="disk_read_bytes") 
  @JsonProperty("disk_read_bytes")
  public long getDiskReadBytes() {
    return diskReadBytes;
  }

  public void setDiskReadBytes(long diskReadBytes) {
    this.diskReadBytes = diskReadBytes;
  }

  @XmlElement(name="disk_reads") 
  @JsonProperty("disk_reads")
  public long getDiskReads() {
    return diskReads;
  }

  public void setDiskReads(long diskReads) {
    this.diskReads = diskReads;
  }

  @XmlElement(name="disk_service_time") 
  @JsonProperty("disk_service_time")
  public double getDiskServiceTime() {
    return diskServiceTime;
  }

  public void setDiskServiceTime(double diskServiceTime) {
    this.diskServiceTime = diskServiceTime;
  }

  @XmlElement(name="disk_write_bytes") 
  @JsonProperty("disk_write_bytes")
  public long getDiskWriteBytes() {
    return diskWriteBytes;
  }

  public void setDiskWriteBytes(long diskWriteBytes) {
    this.diskWriteBytes = diskWriteBytes;
  }

  @XmlElement(name="free_bytes") 
  @JsonProperty("free_bytes")
  public long getFreeBytes() {
    return freeBytes;
  }

  public void setFreeBytes(long freeBytes) {
    this.freeBytes = freeBytes;
  }

  @XmlElement(name="free_files") 
  @JsonProperty("free_files")
  public long getFreeFiles() {
    return freeFiles;
  }

  public void setFreeFiles(long freeFiles) {
    this.freeFiles = freeFiles;
  }

  @XmlElement(name="total_files") 
  @JsonProperty("total_files")
  public long getTotalFiles() {
    return totalFiles;
  }

  public void setTotalFiles(long totalFiles) {
    this.totalFiles = totalFiles;
  }

  @XmlElement(name="used_bytes") 
  @JsonProperty("used_bytes")
  public long getUsedBytes() {
    return usedBytes;
  }

  public void setUsedBytes(long usedBytes) {
    this.usedBytes = usedBytes;
  }

  @XmlElement(name="use_percentage") 
  @JsonProperty("use_percentage")
  public double getUsePercentage() {
    return usePercentage;
  }

  public void setUsePercentage(double usePercentage) {
    this.usePercentage = usePercentage;
  }

  @Override
  public String toString() {
    return "DiskStatistics [availableBytes=" + availableBytes 
		    + ", diskQueue=" + diskQueue + ", diskReadBytes=" 
				+ diskReadBytes + ", diskReads=" + diskReads 
				+ ", diskServiceTime=" + diskServiceTime + ", diskWriteBytes=" 
				+ diskWriteBytes + ", freeBytes=" + freeBytes 
				+ ", freeFiles=" + freeFiles + ", totalFiles=" 
				+ totalFiles + ", usedBytes=" + usedBytes 
				+ ", usePercentage=" + usePercentage + "]";
  }
}

The Model Class for Heartbeat (Heartbeat.java)

package com.avaldes.model;

import java.text.SimpleDateFormat;
import java.util.Date;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import com.avaldes.util.JsonDateSerializer;

@XmlRootElement(name = "heartbeat")
public class Heartbeat {
  private static final long serialVersionUID = -127298392839023L;
  private int count;  
  private String ipAddress;
  private Date startDate;
  private Date currentDate;
  
  SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy 'at' h:mm:ss a");
  
  public Heartbeat() {
    count = 1;
    startDate = new Date();
    currentDate = new Date();
  }

  @XmlElement(name="count") 
  @JsonProperty("count")
  public int getCount() {
    return count;
  }

  public void setCount(int count) {
    this.count = count;
  }

  @XmlElement(name="ip_address") 
  @JsonProperty("ip_address")
  public String getIpAddress() {
    return ipAddress;
  }

  public void setIpAddress(String ipAddress) {
    this.ipAddress = ipAddress;
  }

  @XmlElement(name="start_date") 
  @JsonProperty("start_date")
  public String getStartDate() {
    return df.format(startDate);
  }

  public void setStartDate(Date startDate) {
    this.startDate = startDate;
  }

  @XmlElement(name="current_date") 
  @JsonProperty("current_date")
  public String getCurrentDate() {
    return df.format(currentDate);
  }

  public void setCurrentDate(Date currentDate) {
    this.currentDate = currentDate;
  }

  @XmlElement(name="start_date_long") 
  @JsonProperty("start_date_long")
  public long getStartDateLong() {
    return startDate.getTime();
  }

  @XmlElement(name="current_date_long") 
  @JsonProperty("current_date_long")
  public long getCurrentDateLong() {
    return currentDate.getTime();
  }

  @Override
  public String toString() {
    return "Heartbeat [count=" + count + ", ipAddress=" + ipAddress
        + ", startDate=" + startDate + ", currentDate=" + currentDate
        + "]";
  } 
}

The Model Class for JvmStatistics (JvmStatistics.java)

package com.avaldes.model;

import java.io.Serializable;
import java.util.Arrays;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.codehaus.jackson.annotate.JsonProperty;

@XmlRootElement(name = "jvm_statistics")
public class JvmStatistics implements Serializable {
  private static final long serialVersionUID = -12837283723827389L;
  private String CPUVendor;
  private String CPUModel;
  private String CPUMhz;
  
  // {Stopped=0, Threads=1678, Idle=0, Sleeping=0, 
	//                Running=117, Zombie=0, Total=117}
  private long stoppedProcs;
  private long idleProcs;
  private long sleepingProcs;
  private long runningProcs;
  private long zombieProcs;
  private long totalProcs;
  private long threads;

  // CPU states: 7.7% user, 3.8% system, 0.0% nice, 
  //	                0.0% wait, 87.5% idle
  private double userCpu;
  private double systemCpu;
  private double niceCpu;
  private double waitCpu;
  private double idleCpu;

  // Mem: 16685724K av, 4893048K used, 11792676K free
  private long totalMem;
  private long usedMem;
  private long freeMem;
  private double freeMemPercent;
  private double userMemPrecent;

  // Swap: 19700380K av, 5501760K used, 14198620K free
  private long totalSwap;
  private long usedSwap;
  private long freeSwap;
  
  private Double[] userCpuHistory;
  private Double[] systemCpuHistory;
  private Process[] processHistory;
  
  private Memory[] memoryHistory;
  private Swap[] swapHistory;
  
  @XmlElement(name="cpu_vendor") 
  @JsonProperty("cpu_vendor")
  public String getCPUVendor() {
    return CPUVendor;
  }

  public void setCPUVendor(String vendor) {
    CPUVendor = vendor;
  }

  @XmlElement(name="cpu_model") 
  @JsonProperty("cpu_model")
  public String getCPUModel() {
    return CPUModel;
  }

  public void setCPUModel(String model) {
    CPUModel = model;
  }

  @XmlElement(name="cpu_mhz") 
  @JsonProperty("cpu_mhz")
  public String getCPUMhz() {
    return CPUMhz;
  }

  public void setCPUMhz(String mhz) {
    CPUMhz = mhz;
  }

  @XmlElement(name="stopped_procs") 
  @JsonProperty("stopped_procs")
  public long getStoppedProcs() {
    return stoppedProcs;
  }

  public void setStoppedProcs(long stoppedProcs) {
    this.stoppedProcs = stoppedProcs;
  }

  @XmlElement(name="idle_procs") 
  @JsonProperty("idle_procs")
  public long getIdleProcs() {
    return idleProcs;
  }

  public void setIdleProcs(long idleProcs) {
    this.idleProcs = idleProcs;
  }

  @XmlElement(name="sleeping_procs") 
  @JsonProperty("sleeping_procs")
  public long getSleepingProcs() {
    return sleepingProcs;
  }

  public void setSleepingProcs(long sleepingProcs) {
    this.sleepingProcs = sleepingProcs;
  }

  @XmlElement(name="running_procs") 
  @JsonProperty("running_procs")
  public long getRunningProcs() {
    return runningProcs;
  }

  public void setRunningProcs(long runningProcs) {
    this.runningProcs = runningProcs;
  }

  @XmlElement(name="zombie_procs") 
  @JsonProperty("zombie_procs")
  public long getZombieProcs() {
    return zombieProcs;
  }

  public void setZombieProcs(long zombieProcs) {
    this.zombieProcs = zombieProcs;
  }

  @XmlElement(name="total_procs") 
  @JsonProperty("total_procs")
  public long getTotalProcs() {
    return totalProcs;
  }

  public void setTotalProcs(long totalProcs) {
    this.totalProcs = totalProcs;
  }

  public long getThreads() {
    return threads;
  }

  public void setThreads(long threads) {
    this.threads = threads;
  }

  @XmlElement(name="user_cpu") 
  @JsonProperty("user_cpu")
  public double getUserCpu() {
    return userCpu;
  }

  public void setUserCpu(double userCpu) {
    this.userCpu = userCpu;
  }

  @XmlElement(name="system_cpu") 
  @JsonProperty("system_cpu")
  public double getSystemCpu() {
    return systemCpu;
  }

  public void setSystemCpu(double systemCpu) {
    this.systemCpu = systemCpu;
  }

  @XmlElement(name="nice_cpu") 
  @JsonProperty("nice_cpu")
  public double getNiceCpu() {
    return niceCpu;
  }

  public void setNiceCpu(double niceCpu) {
    this.niceCpu = niceCpu;
  }

  @XmlElement(name="wait_cpu") 
  @JsonProperty("wait_cpu")
  public double getWaitCpu() {
    return waitCpu;
  }

  public void setWaitCpu(double waitCpu) {
    this.waitCpu = waitCpu;
  }

  @XmlElement(name="idle_cpu") 
  @JsonProperty("idle_cpu")
  public double getIdleCpu() {
    return idleCpu;
  }

  public void setIdleCpu(double idleCpu) {
    this.idleCpu = idleCpu;
  }

  @XmlElement(name="total_mem") 
  @JsonProperty("total_mem")
  public long getTotalMem() {
    return totalMem;
  }

  public void setTotalMem(long totalMem) {
    this.totalMem = totalMem;
  }

  @XmlElement(name="used_mem") 
  @JsonProperty("used_mem")
  public long getUsedMem() {
    return usedMem;
  }

  public void setUsedMem(long usedMem) {
    this.usedMem = usedMem;
  }

  @XmlElement(name="free_mem") 
  @JsonProperty("free_mem")
  public long getFreeMem() {
    return freeMem;
  }

  public void setFreeMem(long freeMem) {
    this.freeMem = freeMem;
  }

  @XmlElement(name="free_mem_percent") 
  @JsonProperty("free_mem_percent")
  public double getFreeMemPercent() {
    return freeMemPercent;
  }

  public void setFreeMemPercent(double freeMemPercent) {
    this.freeMemPercent = freeMemPercent;
  }
  
  @XmlElement(name="user_mem_percent") 
  @JsonProperty("user_mem_percent")
  public double getUserMemPrecent() {
    return userMemPrecent;
  }

  
  public void setUserMemPrecent(double userMemPrecent) {
    this.userMemPrecent = userMemPrecent;
  }
  
  @XmlElement(name="total_swap") 
  @JsonProperty("total_swap")
  public long getTotalSwap() {
    return totalSwap;
  }
  
  public void setTotalSwap(long totalSwap) {
    this.totalSwap = totalSwap;
  }

  @XmlElement(name="used_swap") 
  @JsonProperty("used_swap")
  public long getUsedSwap() {
    return usedSwap;
  }
  
  public void setUsedSwap(long usedSwap) {
    this.usedSwap = usedSwap;
  }

  @XmlElement(name="free_swap") 
  @JsonProperty("free_swap")
  public long getFreeSwap() {
    return freeSwap;
  }

  public void setFreeSwap(long freeSwap) {
    this.freeSwap = freeSwap;
  }

  @XmlElement(name="user_cpu_history") 
  @JsonProperty("user_cpu_history")
  public Double[] getUserCpuHistory() {
    return userCpuHistory;
  }

  public void setUserCpuHistory(Double[] userCpuHistory) {
    this.userCpuHistory = userCpuHistory;
  }

  @XmlElement(name="process_history") 
  @JsonProperty("process_history")
  public Process[] getProcessHistory() {
    return processHistory;
  }

  public void setProcessHistory(Process[] processHistory) {
    this.processHistory = processHistory;
  }

  @XmlElement(name="system_cpu_history") 
  @JsonProperty("system_cpu_history")
  public Double[] getSystemCpuHistory() {
    return systemCpuHistory;
  }

  public void setSystemCpuHistory(Double[] systemCpuHistory) {
    this.systemCpuHistory = systemCpuHistory;
  }

  @XmlElement(name="memory_history") 
  @JsonProperty("memory_history")
  public Memory[] getMemoryHistory() {
    return memoryHistory;
  }

  public void setMemoryHistory(Memory[] memoryHistory) {
    this.memoryHistory = memoryHistory;
  }

  @XmlElement(name="swap_history") 
  @JsonProperty("swap_history")
  public Swap[] getSwapHistory() {
    return swapHistory;
  }

  public void setSwapHistory(Swap[] swapHistory) {
    this.swapHistory = swapHistory;
  }

  @Override
  public String toString() {
    return "JvmStatistics [CPUVendor=" + CPUVendor + ", CPUModel=" 
        + CPUModel + ", CPUMhz=" + CPUMhz + ", stoppedProcs=" 
        + stoppedProcs + ", idleProcs=" + idleProcs  + ", sleepingProcs=" 
        + sleepingProcs + ", runningProcs=" + runningProcs 
        + ", zombieProcs=" + zombieProcs + ", totalProcs=" + totalProcs
        + ", threads=" + threads + ", userCpu=" + userCpu 
        + ", systemCpu=" + systemCpu + ", niceCpu=" + niceCpu
        + ", waitCpu=" + waitCpu + ", idleCpu=" + idleCpu 
        + ", totalMem=" + totalMem + ", usedMem=" + usedMem
        + ", freeMem=" + freeMem + ", freeMemPercent=" + freeMemPercent 
        + ", userMemPrecent=" + userMemPrecent + ", totalSwap=" 
        + totalSwap + ", usedSwap=" + usedSwap + ", freeSwap=" 
        + freeSwap + ", userCpuHistory=" + Arrays.toString(userCpuHistory) 
        + ", systemCpuHistory=" + Arrays.toString(systemCpuHistory)
        + ", processHistory=" + Arrays.toString(processHistory) 
        + ", memoryHistory=" + Arrays.toString(memoryHistory) 
        + ", swapHistory=" + Arrays.toString(swapHistory) + "]";
  }
}

The Model Class for Memory (Memory.java)

package com.avaldes.model;

public class Memory {
  private long memoryTotal;
  private long memoryUsed;
  private long memoryFree;
  private long creationTime;
  
  public Memory(long memoryTotal, long memoryUsed, long memoryFree) {
    long now = System.currentTimeMillis();
    
    this.memoryTotal = memoryTotal;
    this.memoryUsed = memoryUsed;
    this.memoryFree = memoryFree;
    this.creationTime = now;
  }

  public long getMemoryTotal() {
    return memoryTotal;
  }
  
  public void setMemoryTotal(long memoryTotal) {
    this.memoryTotal = memoryTotal;
  }
  
  public long getMemoryUsed() {
    return memoryUsed;
  }
  
  public void setMemoryUsed(long memoryUsed) {
    this.memoryUsed = memoryUsed;
  }
  
  public long getMemoryFree() {
    return memoryFree;
  }
  
  public void setMemoryFree(long memoryFree) {
    this.memoryFree = memoryFree;
  }
  
  public long getCreationTime() {
    return creationTime;
  }

  public void setCreationTime(long creationTime) {
    this.creationTime = creationTime;
  }
  
  @Override
  public String toString() {
    return "Memory [memoryTotal=" + memoryTotal + ", memoryUsed="
        + memoryUsed + ", memoryFree=" + memoryFree + ", creationTime="
        + creationTime + "]";
  }
}

The Model Class for NetworkInterfaceDetails (NetworkInterfaceDetails.java)

package com.avaldes.model;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.codehaus.jackson.annotate.JsonProperty;

@XmlRootElement(name = "network_interface_details")
public class NetworkInterfaceDetails {
  private String Address;
  private String Description;
  private String Destination;
  private String Broadcast;
  private long Flags;
  private String HwAddress;
  private long Metric;
  private long MTU;
  private String Name;
  private String Type;
  private String Netmask;
  
  @XmlElement(name="interface_address") 
  @JsonProperty("interface_address")
  public String getAddress() {
    return Address;
  }
  
  public void setAddress(String address) {
    Address = address;
  }

  @XmlElement(name="interface_description") 
  @JsonProperty("interface_description")
  public String getDescription() {
    return Description;
  }

  public void setDescription(String description) {
    Description = description;
  }

  @XmlElement(name="interface_destination") 
  @JsonProperty("interface_destination")
  public String getDestination() {
    return Destination;
  }

  public void setDestination(String destination) {
    Destination = destination;
  }

  @XmlElement(name="interface_broadcast") 
  @JsonProperty("interface_broadcast")
  public String getBroadcast() {
    return Broadcast;
  }

  public void setBroadcast(String broadcast) {
    Broadcast = broadcast;
  }

  @XmlElement(name="interface_flags") 
  @JsonProperty("interface_flags")
  public long getFlags() {
    return Flags;
  }

  public void setFlags(long flags) {
    Flags = flags;
  }

  @XmlElement(name="interface_hwaddr") 
  @JsonProperty("interface_hwaddr")
  public String getHwAddress() {
    return HwAddress;
  }

  public void setHwAddress(String hwAddress) {
    HwAddress = hwAddress;
  }

  @XmlElement(name="interface_metric") 
  @JsonProperty("interface_metric")
  public long getMetric() {
    return Metric;
  }

  public void setMetric(long metric) {
    Metric = metric;
  }

  @XmlElement(name="interface_mtu") 
  @JsonProperty("interface_mtu")
  public long getMTU() {
    return MTU;
  }

  public void setMTU(long mTU) {
    MTU = mTU;
  }

  @XmlElement(name="interface_name") 
  @JsonProperty("interface_name")
  public String getName() {
    return Name;
  }

  public void setName(String name) {
    Name = name;
  }

  @XmlElement(name="interface_type") 
  @JsonProperty("interface_type")
  public String getType() {
    return Type;
  }

  public void setType(String type) {
    Type = type;
  }

  @XmlElement(name="interface_netmask") 
  @JsonProperty("interface_netmask")
  public String getNetmask() {
    return Netmask;
  }

  public void setNetmask(String netmask) {
    Netmask = netmask;
  }

  @Override
  public String toString() {
    return "NetworkInterfaceDetails [Address=" + Address 
      + ", Description=" + Description + ", Destination="
      + Destination + ", Broadcast=" + Broadcast + ", Flags=" 
      + Flags + ", HwAddress=" + HwAddress + ", Metric=" 
      + Metric + ", MTU=" + MTU + ", Name=" + Name 
      + ", Type=" + Type + ", Netmask=" + Netmask + "]";
  }
}

The Model Class for NetworkInterfaces (NetworkInterfaces.java)

package com.avaldes.model;

import java.util.ArrayList;
import java.util.Arrays;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.codehaus.jackson.annotate.JsonProperty;

@XmlRootElement(name = "network_interfaces")
public class NetworkInterfaces {
  private ArrayList<String> interfaces = null;
  
  public void setNetworkInterface(String[] iface) {
    interfaces = new ArrayList<String>(Arrays.asList(iface));   
  }
  
  public void setNetworkInterface(ArrayList<String> iface) {
    interfaces = new ArrayList<String>();
    interfaces.addAll(iface);
  }

  @JsonProperty("interface")
  @XmlElement(name="interface") 
  public ArrayList<String> getNetworkInterface() {
    return interfaces;
  }
}

The Model Class for NetworkInterfaceStats (NetworkInterfaceStats.java)

package com.avaldes.model;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.codehaus.jackson.annotate.JsonProperty;

@XmlRootElement(name = "network_interface_stats")
public class NetworkInterfaceStats {
  private long RxBytes;
  private long RxDroppped;
  private long RxErrors;
  private long RxFrame;
  private long RxOverruns;
  private long RxPackets;
  private long Speed;
  private long TxBytes;
  private long TxCarrier;
  private long TxCollisions;
  private long TxDropped;
  private long TxErrors;
  private long TxOverruns;
  private long TxPackets;
  
  @XmlElement(name="rx_bytes") 
  @JsonProperty("rx_bytes")
  public long getRxBytes() {
    return RxBytes;
  }
  
  public void setRxBytes(long rxBytes) {
    RxBytes = rxBytes;
  }

  @XmlElement(name="rx_dropped") 
  @JsonProperty("rx_dropped")
  public long getRxDroppped() {
    return RxDroppped;
  }

  public void setRxDroppped(long rxDroppped) {
    RxDroppped = rxDroppped;
  }

  @XmlElement(name="rx_errors") 
  @JsonProperty("rx_errors")
  public long getRxErrors() {
    return RxErrors;
  }

  public void setRxErrors(long rxErrors) {
    RxErrors = rxErrors;
  }

  @XmlElement(name="rx_frame") 
  @JsonProperty("rx_frame")
  public long getRxFrame() {
    return RxFrame;
  }

  public void setRxFrame(long rxFrame) {
    RxFrame = rxFrame;
  }

  @XmlElement(name="rx_overruns") 
  @JsonProperty("rx_overruns")
  public long getRxOverruns() {
    return RxOverruns;
  }

  public void setRxOverruns(long rxOverruns) {
    RxOverruns = rxOverruns;
  }

  @XmlElement(name="rx_packets") 
  @JsonProperty("rx_packets")
  public long getRxPackets() {
    return RxPackets;
  }

  public void setRxPackets(long rxPackets) {
    RxPackets = rxPackets;
  }

  @XmlElement(name="speed") 
  @JsonProperty("speed")
  public long getSpeed() {
    return Speed;
  }

  public void setSpeed(long speed) {
    Speed = speed;
  }

  @XmlElement(name="tx_bytes") 
  @JsonProperty("tx_bytes")
  public long getTxBytes() {
    return TxBytes;
  }

  public void setTxBytes(long txBytes) {
    TxBytes = txBytes;
  }

  @XmlElement(name="tx_carrier") 
  @JsonProperty("tx_carrier")
  public long getTxCarrier() {
    return TxCarrier;
  }

  public void setTxCarrier(long txCarrier) {
    TxCarrier = txCarrier;
  }

  @XmlElement(name="tx_collisions") 
  @JsonProperty("tx_collisions")
  public long getTxCollisions() {
    return TxCollisions;
  }

  public void setTxCollisions(long txCollisions) {
    TxCollisions = txCollisions;
  }

  @XmlElement(name="tx_droppped") 
  @JsonProperty("tx_droppped")
  public long getTxDropped() {
    return TxDropped;
  }

  public void setTxDropped(long txDropped) {
    TxDropped = txDropped;
  }

  @XmlElement(name="tx_errors") 
  @JsonProperty("tx_errors")
  public long getTxErrors() {
    return TxErrors;
  }

  public void setTxErrors(long txErrors) {
    TxErrors = txErrors;
  }

  @XmlElement(name="tx_overruns") 
  @JsonProperty("tx_overruns")
  public long getTxOverruns() {
    return TxOverruns;
  }

  public void setTxOverruns(long txOverruns) {
    TxOverruns = txOverruns;
  }

  @XmlElement(name="tx_packets") 
  @JsonProperty("tx_packets")
  public long getTxPackets() {
    return TxPackets;
  }

  public void setTxPackets(long txPackets) {
    TxPackets = txPackets;
  }

  @Override
  public String toString() {
    return "NetworkInterfaceStats [RxBytes=" + RxBytes 
      + ", RxDroppped=" + RxDroppped + ", RxErrors=" 
      + RxErrors + ", RxFrame=" + RxFrame + ", RxOverruns=" 
      + RxOverruns + ", RxPackets=" + RxPackets 
      + ", Speed=" + Speed + ", TxBytes=" + TxBytes
      + ", TxCarrier=" + TxCarrier + ", TxCollisions=" 
      + TxCollisions + ", TxDropped=" + TxDropped 
      + ", TxErrors=" + TxErrors + ", TxOverruns=" 
      + TxOverruns + ", TxPackets=" + TxPackets + "]";
  } 
}

The Model Class for OperatingSystemDetails (OperatingSystemDetails.java)

package com.avaldes.model;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.codehaus.jackson.annotate.JsonProperty;

@XmlRootElement(name = "operating_system_details")
public class OperatingSystemDetails {
  // Operating System Details
  private String OSDescription;
  private String OSArchitecture;
  private String OSName;
  private String OSVersion;
  private String OSCodeName;
  private String OSDataModel;
  private String OSVendor;
  private String OSPatchLevel;
  private String JVMVersion;
  private String JVMVendor;
  private String JVMHome;
  
  @XmlElement(name="os_description") 
  @JsonProperty("os_description")
  public String getOSDescription() {
    return OSDescription;
  }

  public void setOSDescription(String oSDescription) {
    OSDescription = oSDescription;
  }

  @XmlElement(name="os_architecture") 
  @JsonProperty("os_architecture")  
  public String getOSArchitecture() {
    return OSArchitecture;
  }

  public void setOSArchitecture(String oSArchitecture) {
    OSArchitecture = oSArchitecture;
  }

  @XmlElement(name="os_vendor") 
  @JsonProperty("os_vendor")
  public String getOSVendor() {
    return OSVendor;
  }

  public void setOSVendor(String oSVendor) {
    OSVendor = oSVendor;
  }

  @XmlElement(name="os_patch_level") 
  @JsonProperty("os_patch_level")
  public String getOSPatchLevel() {
    return OSPatchLevel;
  }

  public void setOSPatchLevel(String oSPatchLevel) {
    OSPatchLevel = oSPatchLevel;
  }

  @XmlElement(name="os_name") 
  @JsonProperty("os_name")
  public String getOSName() {
    return OSName;
  }

  public void setOSName(String oSName) {
    OSName = oSName;
  }

  @XmlElement(name="os_version") 
  @JsonProperty("os_version")
  public String getOSVersion() {
    return OSVersion;
  }

  public void setOSVersion(String oSVersion) {
    OSVersion = oSVersion;
  }

  @XmlElement(name="os_code_name") 
  @JsonProperty("os_code_name")
  public String getOSCodeName() {
    return OSCodeName;
  }

  public void setOSCodeName(String oSCodeName) {
    OSCodeName = oSCodeName;
  }

  @XmlElement(name="os_data_model") 
  @JsonProperty("os_data_model")
  public String getOSDataModel() {
    return OSDataModel;
  }

  public void setOSDataModel(String oSDataModel) {
    OSDataModel = oSDataModel;
  }

  @XmlElement(name="jvm_version") 
  @JsonProperty("jvm_version")
  public String getJVMVersion() {
    return JVMVersion;
  }

  public void setJVMVersion(String jVMVersion) {
    JVMVersion = jVMVersion;
  }

  @XmlElement(name="jvm_vendor") 
  @JsonProperty("jvm_vendor")
  public String getJVMVendor() {
    return JVMVendor;
  }

  public void setJVMVendor(String jVMVendor) {
    JVMVendor = jVMVendor;
  }

  @XmlElement(name="jvm_home") 
  @JsonProperty("jvm_home")
  public String getJVMHome() {
    return JVMHome;
  }

  public void setJVMHome(String jVMHome) {
    JVMHome = jVMHome;
  }

  @Override
  public String toString() {
    return "cpuDetails [OSDescription=" + OSDescription 
      + ", OSArchitecture=" + OSArchitecture + ", OSName="
      + OSName + ", OSVersion=" + OSVersion + ", OSCodeName=" 
      + OSCodeName + ", OSDataModel=" + OSDataModel 
      + ", OSVendor=" + OSVendor + ", OSPatchLevel=" 
      + OSPatchLevel + ", JVMVersion=" + JVMVersion 
      + ", JVMVendor=" + JVMVendor + ", JVMHome=" + JVMHome + "]";
  } 
}

Let’s View the Realtime AngularJS Dashboard GUI Screens

As you can see from the following screenshots, the UI is quite appealing in its design.

Associated Posts

spring_mvc_angular_dashboard

Please Share Us on Social Media

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *