2 * Copyright (c) 2013 Cisco Systems, 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.openflowplugin.droptestkaraf;
11 import java.io.PrintStream;
12 import org.apache.karaf.shell.commands.Command;
13 import org.apache.karaf.shell.console.OsgiCommandSupport;
14 import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
15 import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
17 @Command(scope = "drop-test", name = "showDropStats", description = "Show drop statistics.")
18 public class ShowDropStatsCommandProvider extends OsgiCommandSupport {
21 protected Object doExecute() throws Exception {
22 PrintStream out = session.getConsole();
23 final DropTestRpcProvider rpcProvider = DropTestActivator.getDropRpcProvider();
24 final DropTestDsProvider provider = DropTestActivator.getDropDsProvider();
26 out.format("RPC Test Statistics: %s%n", rpcProvider.getStats().toString());
27 out.format("FRM Test Statistics: %s%n", provider.getStats().toString());