Skip to content
Snippets Groups Projects
Commit fe268692 authored by Bjoern Weissenfels's avatar Bjoern Weissenfels
Browse files

changed cpu order and default value and values of select method button

parent 327c608d
Branches
Tags
No related merge requests found
......@@ -15,8 +15,6 @@ import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import javax.faces.event.AjaxBehaviorEvent;
import kieker.common.record.controlflow.OperationExecutionRecord;
import livedemo.entities.DataEntry;
import livedemo.entities.Record;
......@@ -47,7 +45,6 @@ public class ChartBean implements Observer{
long oerTimestamp; // temp var in nanos
long lastTimestamp;
boolean firstCall;
boolean newMethod;
@ManagedProperty(value = "#{dataBean}")
DataBean dataBean;
......@@ -64,7 +61,6 @@ public class ChartBean implements Observer{
this.lastTimestamp = System.currentTimeMillis();
this.availableMethods = new ArrayList<String>();
this.firstCall = true;
this.newMethod = false;
}
@PostConstruct
......@@ -82,16 +78,6 @@ public class ChartBean implements Observer{
this.dataBean = dataBean;
}
public boolean getNewMethod(){
System.out.println("try to get newMethod: " + this.newMethod);
if(this.newMethod){
this.newMethod = false;
return false;
}else{
return true;
}
}
public List<Integer> getPossibleNumberOfDisplayedEntries(){
return this.possibleNumberOfDisplayedEntries;
}
......@@ -238,16 +224,15 @@ public class ChartBean implements Observer{
if(!allRecords.isEmpty()){
this.oerTimestamp = allRecords.getFirst().getOperationExecutionRecord().getLoggingTimestamp();
for(Record r : allRecords){
OperationExecutionRecord oer = r.getOperationExecutionRecord();
String signature = oer.getOperationSignature();
if(oer.getLoggingTimestamp() >= this.oerTimestamp){
String signature = r.getShortSignature();
if(r.getOperationExecutionRecord().getLoggingTimestamp() >= this.oerTimestamp){
do{
this.oerTimestamp += this.duration;
for(String sig : this.oerMap.keySet()){
this.oerMap.get(sig).add(new DataEntry(this.oerTimestamp));
}
}
while(oer.getLoggingTimestamp() >= this.oerTimestamp);
while(r.getOperationExecutionRecord().getLoggingTimestamp() >= this.oerTimestamp);
if(!this.oerMap.containsKey(signature)){
LinkedList<DataEntry> newData = new LinkedList<DataEntry>();
DataEntry data = new DataEntry(this.oerTimestamp);
......@@ -255,7 +240,6 @@ public class ChartBean implements Observer{
newData.add(data);
this.oerMap.put(signature, newData);
this.availableMethods.add(signature);
this.newMethod = true;
}else{
LinkedList<DataEntry> entries = this.oerMap.get(signature);
entries.getLast().addRecord(r);
......@@ -271,7 +255,6 @@ public class ChartBean implements Observer{
newData.add(data);
this.oerMap.put(signature, newData);
this.availableMethods.add(signature);
this.newMethod = true;
}
}
}
......@@ -310,16 +293,15 @@ public class ChartBean implements Observer{
}
}else{
for(Record r : newRecords){
OperationExecutionRecord oer = r.getOperationExecutionRecord();
String signature = oer.getOperationSignature();
if(oer.getLoggingTimestamp() > this.oerTimestamp){
String signature = r.getShortSignature();
if(r.getOperationExecutionRecord().getLoggingTimestamp() > this.oerTimestamp){
do{
this.oerTimestamp += this.duration;
for(String sig : this.oerMap.keySet()){
this.oerMap.get(sig).add(new DataEntry(this.oerTimestamp));
}
}
while(oer.getLoggingTimestamp() > this.oerTimestamp);
while(r.getOperationExecutionRecord().getLoggingTimestamp() > this.oerTimestamp);
if(!this.oerMap.containsKey(signature)){
LinkedList<DataEntry> newData = new LinkedList<DataEntry>();
DataEntry data = new DataEntry(this.oerTimestamp);
......@@ -327,7 +309,6 @@ public class ChartBean implements Observer{
newData.add(data);
this.oerMap.put(signature, newData);
this.availableMethods.add(signature);
this.newMethod = true;
}else{
LinkedList<DataEntry> entries = this.oerMap.get(signature);
entries.getLast().addRecord(r);
......@@ -343,7 +324,6 @@ public class ChartBean implements Observer{
newData.add(data);
this.oerMap.put(signature, newData);
this.availableMethods.add(signature);
this.newMethod = true;
}
}
}
......
package livedemo.managedbeans;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
......@@ -140,16 +141,18 @@ public class CpuBean implements Observer{
this.dataBean.updateCPUList();
Set<String> ids = this.cpuMap.keySet();
this.possibleCPUs.clear();
for(String s : ids){
this.possibleCPUs.add(s);
}
Collections.sort(this.possibleCPUs);
}
return this.possibleCPUs;
}
public List<String> getSelectedCPUs(){
if(this.selectedCPUs.isEmpty() && !this.possibleCPUs.isEmpty()){
this.selectedCPUs.add(this.possibleCPUs.get(0));
this.selectedCPUs.addAll(this.possibleCPUs);
}
return this.selectedCPUs;
}
......@@ -174,7 +177,7 @@ public class CpuBean implements Observer{
// this call will update the map, after this all cpuIds are known
this.dataBean.updateMemSwapList();
Set<String> ids = this.memSwapMap.keySet();
this.possibleCPUs.clear();
this.possibleHosts.clear();
for(String s : ids){
this.possibleHosts.add(s);
}
......
No preview for this file type
No preview for this file type
......@@ -77,7 +77,7 @@
</h:panelGrid>
<p:lineChart id="count" value="#{chartBean.countingModel}" legendPosition="ne"
title="Method Calls Per 3 Seconds" minY="0" style="height:300px;margin-top:20px"
title="Method Calls Per #{chartBean.intervallLength} Seconds" minY="0" style="height:300px;margin-top:20px"
xaxisLabel="Time" yaxisLabel="Number of calls"/>
<p:barChart id="resp" value="#{chartBean.responsetimeModel}" legendPosition="ne"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment