Commit 437c086f82ced7a2045448238afb40d596be6420
1 parent
b8c8cf7f
date in CAC export
Showing
2 changed files
with
6 additions
and
2 deletions
src/main/java/net/floodlightcontroller/pelstats/rest/RESTExportStats.java
| ... | ... | @@ -149,14 +149,14 @@ public class RESTExportStats extends ServerResource{ |
| 149 | 149 | out.println("Switch:\t"+entry.getKey()); |
| 150 | 150 | out.println("Number of calls\tAverage iMOS"); |
| 151 | 151 | for (double[] list:PELStats.cacStatsMap.get(entry.getKey())){ |
| 152 | - if(list[1]!=0)out.println(list[0]+"\t"+list[1]); | |
| 152 | + if(list[1]!=0)out.println(list[2]+"\t"+list[0]+"\t"+list[1]); | |
| 153 | 153 | } |
| 154 | 154 | out.println("\n"); |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | else if (idVoip==1){//export stats for this switch only |
| 158 | 158 | for (double[] list:PELStats.cacStatsMap.get(mySwitch)){ |
| 159 | - if(list[1]!=0)out.println(list[0]+"\t"+list[1]); | |
| 159 | + if(list[1]!=0)out.println(list[2]+"\t"+list[0]+"\t"+list[1]); | |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | ... | ... |
src/main/java/org/openflow/protocol/Pel/statistics/StatisticVoIP_CAC.java
| 1 | 1 | package org.openflow.protocol.Pel.statistics; |
| 2 | 2 | |
| 3 | 3 | import java.nio.ByteBuffer; |
| 4 | +import java.util.Date; | |
| 4 | 5 | import java.text.DecimalFormat; |
| 5 | 6 | |
| 6 | 7 | import net.floodlightcontroller.pelstats.PELStats; |
| ... | ... | @@ -10,6 +11,7 @@ public class StatisticVoIP_CAC extends Statistic{ |
| 10 | 11 | private double averageMos; |
| 11 | 12 | private double bandwidth; |
| 12 | 13 | private String cacStatus; |
| 14 | + private Date date; | |
| 13 | 15 | |
| 14 | 16 | private static final int DOUBLE_STRING_SIZE = 10; |
| 15 | 17 | |
| ... | ... | @@ -26,6 +28,7 @@ public class StatisticVoIP_CAC extends Statistic{ |
| 26 | 28 | nbCalls=b.getInt(); |
| 27 | 29 | averageMos=getDoubleBytes(b,1)/50; |
| 28 | 30 | bandwidth=((double)b.getInt())*8/1000; |
| 31 | + date=new Date(); | |
| 29 | 32 | |
| 30 | 33 | //TODO Change the condition |
| 31 | 34 | if (nbCalls>100 || (averageMos<3 &&nbCalls>50)){ |
| ... | ... | @@ -42,6 +45,7 @@ public class StatisticVoIP_CAC extends Statistic{ |
| 42 | 45 | double stats[]=new double[2]; |
| 43 | 46 | stats[0]=nbCalls; |
| 44 | 47 | stats[1]=averageMos; |
| 48 | + stats[2]=date.getTime(); | |
| 45 | 49 | return stats; |
| 46 | 50 | } |
| 47 | 51 | ... | ... |