Examples of BandwidthUsage


Examples of org.wso2.carbon.usage.agent.beans.BandwidthUsage

        if(log.isTraceEnabled()){
            log.trace("Persisting service bandwidth usage for tenant " + tenantId + " in size: " + inDataSize + " out size: " + outDataSize);
        }
        // add the job to queue
        if (inDataSize > 0) {
            BandwidthUsage usage = new BandwidthUsage(tenantId,
                    UsageConstants.SERVICE_INCOMING_BW, inDataSize);
            Util.addToPersistingControllerQueue(usage);
        }
        if (outDataSize > 0) {
            BandwidthUsage usage = new BandwidthUsage(tenantId,
                    UsageConstants.SERVICE_OUTGOING_BW, outDataSize);
            Util.addToPersistingControllerQueue(usage);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.usage.agent.beans.BandwidthUsage

        // if the jobQueue is not empty
        while (!jobQueue.isEmpty()) {

            // get the first element from the queue, which is a BandwidthUsage object
            BandwidthUsage usage = jobQueue.poll();
           
            // get the tenant id
            int tenantId = usage.getTenantId();

            //get the Summarizer object corresponds to the tenant id
            Summarizer summarizer = summarizerMap.get(tenantId);

            // when tenant invoke service for the first time, no corresponding summarizer object in
View Full Code Here

Examples of org.wso2.carbon.usage.agent.beans.BandwidthUsage

        public void accumulate(BandwidthUsage usage) {
            // get the measurement name of usage entry
            String key = usage.getMeasurement();

            // get the existing value of measurement
            BandwidthUsage existingUsage = usageMap.get(key);

            // if this measurement is metered earlier add the new value to the existing value
            if (existingUsage != null) {
                existingUsage.setValue(existingUsage.getValue() + usage.getValue());
            } else {
                // if this measurement is not metered previously we need to add it to the usageMap
                usageMap.put(key, usage);
            }
        }
View Full Code Here

Examples of org.wso2.carbon.usage.agent.beans.BandwidthUsage

     * @param size value of the incoming bandwidth
     */

    public static void storeIncomingBandwidth(int tenantId, long size) {
        if (size > 0) {
            BandwidthUsage usage = new BandwidthUsage(
                    tenantId, UsageConstants.REGISTRY_INCOMING_BW, size);
            Util.addToPersistingControllerQueue(usage);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.usage.agent.beans.BandwidthUsage

     * @param tenantId tenant id
     * @param size value of the outgoing bandwidth
     */
    public static void storeOutgoingBandwidth(int tenantId, long size) {
        if (size > 0) {
            BandwidthUsage usage = new BandwidthUsage(
                    tenantId, UsageConstants.REGISTRY_OUTGOING_BW, size);
            Util.addToPersistingControllerQueue(usage);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.