2 * Copyright (c) 2013 Plexxi, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.affinity.analytics.northbound;
11 import java.util.ArrayList;
12 import java.util.List;
15 import javax.xml.bind.annotation.XmlAccessType;
16 import javax.xml.bind.annotation.XmlAccessorType;
17 import javax.xml.bind.annotation.XmlElement;
18 import javax.xml.bind.annotation.XmlRootElement;
21 @XmlAccessorType(XmlAccessType.NONE)
22 public class AllStatistics {
24 private List<ProtocolStatistics> stats;
27 @SuppressWarnings("unused")
28 private AllStatistics() {
31 public AllStatistics(Map<Byte, Long> byteCounts, Map<Byte, Long> packetCounts, Map<Byte, Double> durations, Map<Byte, Double> bitRates) {
32 this.stats = new ArrayList<ProtocolStatistics>();
33 for (Byte protocol : byteCounts.keySet()) {
34 long byteCount = byteCounts.get(protocol);
35 long packetCount = packetCounts.get(protocol);
36 double duration = durations.get(protocol);
37 double bitRate = bitRates.get(protocol);
38 this.stats.add(new ProtocolStatistics(protocol, new Statistics(byteCount, packetCount, duration, bitRate)));
42 public List<ProtocolStatistics> getStats() {
46 public void setStats(List<ProtocolStatistics> stats) {