Commit 195655a68cbfbb976d31bd26c251cd57f2d610ea
1 parent
6da8ac03
new export :bandwidth
Showing
4 changed files
with
27 additions
and
9 deletions
src/main/java/net/floodlightcontroller/pelstats/PELStats.java
| ... | ... | @@ -44,6 +44,7 @@ import org.openflow.protocol.Pel.statistics.VideoMetricDevice; |
| 44 | 44 | import org.openflow.protocol.Pel.threshold.PelVendorExtension; |
| 45 | 45 | import org.openflow.protocol.Pel.statistics.StatisticVoIP; |
| 46 | 46 | import org.openflow.protocol.Pel.statistics.StatisticVoIP_CAC; |
| 47 | +import org.openflow.protocol.Pel.statistics.StatisticVoIP_Queue; | |
| 47 | 48 | import org.openflow.protocol.action.OFAction; |
| 48 | 49 | import org.openflow.protocol.action.OFActionEnqueue; |
| 49 | 50 | import org.openflow.protocol.statistics.OFStatistics; |
| ... | ... | @@ -257,15 +258,15 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 257 | 258 | |
| 258 | 259 | |
| 259 | 260 | } |
| 260 | - /*if (srb.getStatistic().getType()==8){ | |
| 261 | - ArrayList<double[]> cacStats; | |
| 261 | + if (srb.getStatistic().getType()==8){ | |
| 262 | 262 | if(cacStatsMap.get(sw)!=null){ |
| 263 | - cacStats =new ArrayList<double[]>(cacStatsMap.get(sw)); | |
| 264 | - } | |
| 265 | - cacStats.add(stats); | |
| 266 | - //System.out.println("@PELStats \tputting switch"); | |
| 263 | + ArrayList<double[]> cacStats = new ArrayList<double[]>(cacStatsMap.get(sw)); | |
| 264 | + double[] stats =cacStats.get(cacStats.size()-1); | |
| 265 | + stats[4]=((StatisticVoIP_Queue)srb.getStatistic()).getVoipBandwidth(); | |
| 266 | + cacStats.set(cacStats.size()-1, stats); | |
| 267 | 267 | cacStatsMap.put(sw,cacStats); |
| 268 | - }*/ | |
| 268 | + } | |
| 269 | + } | |
| 269 | 270 | |
| 270 | 271 | |
| 271 | 272 | if(enabledStatistics.containsKey(sw)){ | ... | ... |
src/main/java/net/floodlightcontroller/pelstats/rest/RESTExportStats.java
| ... | ... | @@ -155,9 +155,9 @@ public class RESTExportStats extends ServerResource{ |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | else if (idVoip==1){//export stats for this switch only |
| 158 | + out.println("Switch:\t"+mySwitch); | |
| 159 | + out.println("Date\tNumber of calls\tAverage iMOS\tBandwidth"); | |
| 158 | 160 | for (double[] list:PELStats.cacStatsMap.get(mySwitch)){ |
| 159 | - out.println("Switch:\t"+mySwitch); | |
| 160 | - out.println("Date\tNumber of calls\tAverage iMOS\tBandwidth"); | |
| 161 | 161 | if(list[1]!=0)out.println(list[0]+"\t"+list[1]+"\t"+list[2]+"\t"+list[3]); |
| 162 | 162 | } |
| 163 | 163 | } | ... | ... |
src/main/resources/web/js/views/voip.js
| ... | ... | @@ -288,6 +288,22 @@ window.VoIPListView = Backbone.View.extend({ |
| 288 | 288 | }); |
| 289 | 289 | |
| 290 | 290 | }, |
| 291 | + ExportCAC:function(e){ | |
| 292 | + var self=this; | |
| 293 | + console.log("Export on "+self.model.idswitch); | |
| 294 | + $.ajax({ | |
| 295 | + url:hackBase + '/wm/iptv/switch/'+self.model.idswitch+'/export/8/0/json', | |
| 296 | + dataType:"json", | |
| 297 | + success:function (data) { | |
| 298 | + | |
| 299 | + if ( data.resultCode == 0 ) alert(data.error); | |
| 300 | + else { | |
| 301 | + console.log("Export BW started for "+self.model.idswitch); | |
| 302 | + } | |
| 303 | + }, | |
| 304 | + }); | |
| 305 | + | |
| 306 | + }, | |
| 291 | 307 | |
| 292 | 308 | }); |
| 293 | 309 | ... | ... |
src/main/resources/web/tpl/voip-list.html
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | <td style="width: 450px;"><h1>Calls (<%= nvoip %>)</h1></td> |
| 17 | 17 | <td style="width: 150px;"><input value="Export VoIP" name="exportVoIP" type="button"></td> |
| 18 | 18 | <td><input value="Export CAC" name="exportCAC" type="button"></td> |
| 19 | + <td><input value="Export Bandwidth" name="exportBW" type="button"></td> | |
| 19 | 20 | </tr> |
| 20 | 21 | </tbody> |
| 21 | 22 | </table> | ... | ... |