<%@ page import="java.util.*, org.ourgrid.webstatus.*, org.ourgrid.peer.manager.allocation.*, org.ourgrid.common.spec.*, org.ourgrid.common.url.*, org.ourgrid.peer.manager.status.*, java.text.*, javax.swing.text.*" errorPage="erro.jsp" buffer="50kb" autoFlush="true" %> OurGrid WebStatus 3.3.1 <% Date currentDate = new Date(); Date timeSnapshot = (Date)request.getAttribute("timeSnapshot"); int totalPeers = 0; int totalConsumers = 0; int totalMachines = 0; int totalIdle = 0; int totalInUse = 0; int totalContacting = 0; int totalDonated = 0; int totalOwner = 0; Collection peerInfoList = (Collection)request.getAttribute("peerInfoList"); totalPeers = peerInfoList.size(); // Getting statistics informations Iterator itTotal = peerInfoList.iterator(); while (itTotal.hasNext()) { PeerInfoPack pack = (PeerInfoPack) itTotal.next(); if (pack.getLocalConsumers() != null) { totalConsumers += pack.getLocalConsumers().size(); } totalMachines += pack.getAllGums().size(); Collection machines = pack.getAllGums(); Iterator itMachines = machines.iterator(); while (itMachines.hasNext()) { StatusEntry entry = itMachines.next(); switch (entry.getStatus()) { case IDLE : { totalIdle++; break; } case DONATED : { totalDonated++; break; } case OWNER : { totalOwner++; break; } case CONTACTING : { totalContacting++; break; } case IN_USE : { totalInUse++; break; } } } } %>
OurGrid Web Status  
 
Statistics
Server time:  <%= currentDate %>
Last snapshot time:  <%= timeSnapshot %>
Peers connected:  <%= totalPeers %>
Consumers connected:  <%= totalConsumers %>
Machines on grid:  <%= totalMachines %>
Idle Machines:  <%= totalIdle %>
Machines in use:  <%= totalInUse %>
     
Online Peers
 
<% int qtdLocalGums = 0; int qtdRemoteGums = 0; int i = 0; String[] cores = {"#E9E9E9","#FFFFFF"}; Iterator itDiv = peerInfoList.iterator(); while (itDiv.hasNext()) { i = 1 -i; int qtdIdle = 0; int qtdInUse = 0; int qtdContacting = 0; int qtdDonated = 0; int qtdOwner = 0; PeerInfoPack pack = (PeerInfoPack) itDiv.next(); String peerOriginalName = pack.getPeerID().getName(); String peerName = pack.getPeerID().getName(); peerName = peerName.replace(' ','_'); peerName = peerName.replace('.','_'); peerName = peerName.replace('-','_'); qtdLocalGums += pack.getLocalGums().size(); qtdRemoteGums += pack.getRemoteGums().size(); Collection machines = pack.getAllGums(); Iterator itMachines = machines.iterator(); while (itMachines.hasNext()) { StatusEntry entry = itMachines.next(); switch (entry.getStatus()) { case IDLE : { qtdIdle++; break; } case DONATED : { qtdDonated++; break; } case OWNER : { qtdOwner++; break; } case CONTACTING : { qtdContacting++; break; } case IN_USE : { qtdInUse++; break; } } } %> <% } %>
Peer Name Version Local Consumers Local Machines Received Machines
Total Idle In use Donated Unavailable
<%= pack.getVersion() %> <%= pack.getLocalConsumers() != null ? pack.getLocalConsumers().size() : "-" %> <%= pack.getAllGums() != null ? pack.getAllGums().size() : "-" %> <%= qtdIdle %> <%= qtdInUse %> <%= qtdDonated %> <%= qtdContacting + qtdOwner %> <%= pack.getRemoteGums() != null ? pack.getRemoteGums().size() : "-" %>
Totals <%= totalMachines %> <%= totalIdle %> <%= totalInUse %> <%= totalDonated %> <%= totalContacting + totalOwner %>  
 
Legend:

Idle machines
Machines in use by local requests
Machines in use received from the community
Machines donated to the community
Machines that are either off-line or in use by their owners (not idle)
- Information not available (Old version)

OurGrid Web Status 3.3.1
OurGrid Project