X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fdom%2Fbroker%2Fimpl%2FDataStoreStatsWrapper.java;h=aa4297613e183a335aea53eef47e9f39b3788cc9;hb=6fd408a04fe4a3611843e2246ece6d7c34b76903;hp=9116d50d9c4965fc81842a4a6e1f558f457c2ad3;hpb=144c567aa78ca4f6ea6279163b3a8ba8d5de0dc2;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/DataStoreStatsWrapper.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/DataStoreStatsWrapper.java index 9116d50d9c..aa4297613e 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/DataStoreStatsWrapper.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/DataStoreStatsWrapper.java @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ package org.opendaylight.controller.sal.dom.broker.impl; import java.util.concurrent.atomic.AtomicLong; @@ -52,7 +59,7 @@ public class DataStoreStatsWrapper implements Delegator, DataStore { } finally { final long endTime = System.nanoTime(); final long runTime = endTime - startTime; - cfgReadTimeTotal.addAndGet(runTime); + operReadTimeTotal.addAndGet(runTime); } } @@ -98,40 +105,40 @@ public class DataStoreStatsWrapper implements Delegator, DataStore { return requestCommitCount.get(); } - public final long getConfigurationReadTotalTime() { - return cfgReadTimeTotal.get(); + public final double getConfigurationReadTotalTime() { + return cfgReadTimeTotal.get() / 1000.0d; } - public final long getOperationalReadTotalTime() { - return operReadTimeTotal.get(); + public final double getOperationalReadTotalTime() { + return operReadTimeTotal.get() / 1000.0d; } - public final long getRequestCommitTotalTime() { - return requestCommitTimeTotal.get(); + public final double getRequestCommitTotalTime() { + return requestCommitTimeTotal.get() / 1000.0d; } - public final long getConfigurationReadAverageTime() { + public final double getConfigurationReadAverageTime() { long readCount = cfgReadCount.get(); if(readCount == 0) { return 0; } - return cfgReadTimeTotal.get() / readCount; + return getConfigurationReadTotalTime() / readCount; } - public final long getOperationalReadAverageTime() { + public final double getOperationalReadAverageTime() { long readCount = operReadCount.get(); if(readCount == 0) { return 0; } - return operReadTimeTotal.get() / readCount; + return getOperationalReadTotalTime() / readCount; } - public final long getRequestCommitAverageTime() { + public final double getRequestCommitAverageTime() { long count = requestCommitCount.get(); if(count == 0) { return 0; } - return requestCommitTimeTotal.get() / count; + return getRequestCommitTotalTime() / count; } }