Added performance-related metrics for the Topology and Intents:

===

 * "Topology.EventNotification.LastEventTimestamp"
   Timestamp of the last Topology event (system nanoseconds)

 * "Topology.EventNotification.ListenerEventRate"
   Rate of the Topology events published to the Topology listeners

===

 * "Intents.AddOperation.BeginOperationTimestamp"
   Timestamp of the incoming Add Intent API operation (system nanoseconds)

 * "Intents.AddOperation.EndOperationTimestamp"
   Timestamp of the Add Intent operation completion (system nanoseconds)

 * "Intents.AddOperation.IncomingRate"
   Rate of the incoming Add Intent API operations

 * "Intents.AddOperation.ProcessingRate"
   Rate of processing the Add Intent operations

===

 * "Intents.RemoveOperation.BeginOperationTimestamp"
   Timestamp of the incoming Remove Intent API operation (system nanoseconds)

 * "Intents.RemoveOperation.EndOperationTimestamp"
   Timestamp of the Remove Intent operation completion (system nanoseconds)

 * "Intents.RemoveOperation.IncomingRate"
   Rate of the incoming Remove Intent API operations

 * "Intents.RemoveOperation.ProcessingRate"
   Rate of processing the Remove Intent operations

===

All performance metrics are exposed via the Metrics REST API:

 * GET all metrics:
url = "http://%s:%s/wm/onos/metrics" % (self.onos_ip, self.onos_port)

 * GET a specific metric:
url = "http://%s:%s/wm/onos/metrics?ids=%s" % (self.onos_ip, self.onos_port, args.metric_id)

   where "metric_id" is the name of the Metric. E.g.:
   ids=Topology.EventNotification.LastEventTimestamp

 * GET multiple metrics:
url = "http://%s:%s/wm/onos/metrics?ids=%s" % (self.onos_ip, self.onos_port, args.metric_id)

   where "metric_id" is comma-separated list of Metric names. E.g:
   ids=Topology.EventNotification.LastEventTimestamp,Topology.EventNotification.ListenerEventRate

===

The JSON format of the output is the following:

{
    "meters": [
        {
            "name": "Intents.AddOperation.IncomingRate",
            "meter": {
                "count": 2,
                "mean_rate": 0.007488255279864508,
                "m5_rate": 0.006082798637345469,
                "m15_rate": 0.021083988195124116,
                "units": "events/second",
                "m1_rate": 0.002155350653737004
            }
        },
        ...
    ],
    "histograms": [],
    "timers": [],
    "gauges": [
        {
            "gauge": {
                "value": 179956769775795
            },
            "name": "Intents.AddOperation.BeginOperationTimestamp"
        },
        ...
    ],
    "counters": []
}

where
  - "meter.count" is the number of events
  - "meter.mean_rate" is the mean rate of the events
  - "meter.m5_rate" is the rate of the events over the last 5-minute interval
  - "meter.m15_rate" is the rate of the events over the last 15-minute interval
  - "meter.m1_rate" is the rate of the events over the last 1-minute interval
  - "meter.units" is the units of the rate (should be "events/second")

  - "gauge.value" is the value of the particular metric.
     In case of the "*Timestamp" metrics, it is the system nanoseconds
     timestamp for the particular event or operation.

Also, fixed some of the unit tests.
NOTE: Currently, for some of the tests we have to explicitly
remove all metrics when tearing-down a test.
In the future we should have a single base unit test class,
and only its tearDown() method should do such cleanup.

Change-Id: Iad5b47b908a29dcfd9fb08e7a010ddf2627fd808
14 files changed
tree: 0d7c852c5b1a66acec358ba2b7001f9b78a5e879
  1. .checkstyle
  2. .gitignore
  3. .gitreview
  4. Authors
  5. LICENSE.txt
  6. NOTICE.txt
  7. PARTNERS.txt
  8. README.md
  9. build-ramcloud-java-bindings.sh
  10. cluster-mgmt/
  11. conf/
  12. gui/
  13. install-oracle-java.sh
  14. lib/
  15. old-scripts/
  16. onos.sh
  17. onoscli
  18. pom.xml
  19. prep-for-offline.sh
  20. ramcloud-build-scripts/
  21. sample/
  22. scripts/
  23. setup-ramcloud.sh
  24. src/
  25. start-ons2014demo.sh
  26. start-rest.sh
  27. vm-utils/
  28. web/
README.md

ONOS (Open Networking Operating System)

ONOS (Open Networking Operating System) is an experimental distributed SDN OS. Currently, it is under active development. ONOS was announced and demonstrated at ONS'13, '14.

License

Apache 2.0

Steps to download and setup a development Virtual Machine

https://wiki.onlab.us:8443/display/onosdocs/Getting+Started+with+ONOS

Building ONOS

  1. Cleanly build ONOS

     $ cd ${ONOS_HOME}/
     $ mvn clean
     $ mvn compile
    

External Dependencies

  1. Required packages

     $ sudo apt-get install maven python-flask python-cmd2 python-pyparsing
    
  2. ZooKeeper

    Download and install apache-zookeeper-3.4.6: http://zookeeper.apache.org/releases.html

    By default ONOS expect ZooKeeper to be installed in ~/zookeeper-3.4.6.
    This can be changed by specifing the path using ZK_HOME environment variable.

    Data directory ZooKeeper uses by default is /var/lib/zookeeper. You will need to give current user permission to write to this directory.

    This directory can be changed using specifying ZK_LIB_DIR environment variable and running ./onos.sh setup to generate ${ONOS_HOME}/conf/zoo.cfg.

    See Configuration for details about ./onos.sh setup.

  3. RAMCloud

    Run setup-ramcloud.sh to download and install RAMCloud to ~/ramcloud.
    Installation path can be changed by specifing RAMCLOUD_HOME environment variable.

     $ cd ${ONOS_HOME}/
     $ ./setup-ramcloud.sh
    

Configuration

./onos.sh setup script is used to generate ONOS related configuration files. This script read configuration from "${ONOS_CONF_DIR}/onos_node.`hostname`.conf".

Copy the file "${ONOS_HOME}/conf/onos_node.conf" to match the hostname and configure the content appropriately.
e.g., To use RAMCloud as data store change host.backend to ramcloud

Once you're done with required configuration run following to generate configuration files.

    $ cd ${ONOS_HOME}/
    $ ./onos.sh setup

Running ONOS and required components

To start ZooKeeper, RAMCloud (if enabled in configuration) and ONOS core.

    $ cd ${ONOS_HOME}/
    $ ./onos.sh start single-node

To stop all the above

    $ cd ${ONOS_HOME}/
    $ ./onos.sh stop

If you need to use the REST APIs, follow the instruction for "Start ONOS REST API server" in next section.

Running ONOS and required components one by one

You can manually start/stop individual ONOS components as follows:

  1. Start Zookeeper

     $ cd ${ONOS_HOME}/
     $ ./onos.sh zk start
    
     ## Confirm Zookeeper is running:
     $ ./onos.sh zk status
    
  2. Start RAMCloud Coordinator (only on one of the node in cluster)

     $ cd ${ONOS_HOME}/
     $ ./onos.sh rc-coord start
    
     ## Confirm RAMCloud Coordinator is running:
     $ ./onos.sh rc-coord status
    
  3. Start RAMCloud Server

     $ cd ${ONOS_HOME}/
     $ ./onos.sh rc-server start
    
     ## Confirm RAMCloud Server is running:
     $ ./onos.sh rc-server status
    
  4. Start ONOS

     $ cd ${ONOS_HOME}/
     $ ./onos.sh core start
    
     ## Confirm ONOS is running:
     $ ./onos.sh core status
    
  5. Start ONOS REST API server

     $ cd ${ONOS_HOME}/
     $ ./start-rest.sh start
    
     ## Confirm the REST API server is running:
     $ ./start-rest.sh status
    

Running unit tests

Unit tests bundled with ONOS source code, can be executed by using the following:

    $ cd ${ONOS_HOME}/
    $ mvn test

Some of the unit tests, which take longer time to execute are excluded from the above goal. To force running all the unit tests, use the following commands:

    $ cd ${ONOS_HOME}/
    $ mvn test -P all-tests

To run only a subset of the unit tests, use the following commands:

    $ cd ${ONOS_HOME}/
    $ mvn test -Dtest=PortNumberTest

Comma and wildcards can be used to specify multiple test cases. See maven-surefire-plugin website for details.

Developing ONOS in offline environment (Optional)

Maven need the Internet connection to download required dependencies and plugins, when they're used for the first time.

If you need to develop ONOS in an Internet unreachable environment you may want to run the following helper script before you go offline, so that required dependencies and plugins for frequently used maven target will be downloaded to your local environment.

    $ ./prep-for-offline.sh