/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: IdCacheStats.java,v 1.2 2008/08/07 17:22:06 arviranga Exp $
*
*/
/**
* <code>IdCacheStats</code> implements the <code>StatsListener</code>
* and provides the information of the total number of entry in cache
* table and the number of hits and total number of reads.
*/
/**
* Creates a new IdRepo Stats
*
* @param name Name of Cache
*/
nameOfCache = name;
}
}
}
}
}
}
}
}
}
/**
* Prints the session statistics for the given session table.
*
*/
public void printStats() {
// Print Stats information
+ "\nNumber of Get and Search requests during this interval: "
+ (double) intervalCount
+ "\nNumber of Hits during this interval: "
+ totalIntervalHits + "\nHit ratio for this interval: "
+ (double) totalIntervalHits / (double) intervalCount
+ "\nTotal number of Get requests since server start: "
+ "\nTotal number of Get Hits since server start: "
+ totalGetCacheHits + "\nOverall Hit ratio: "
+ (double) totalGetCacheHits / (double) totalGetRequests
+ "\nTotal number of Search requests since server start: "
+ "\nTotal number of FQDN Search hits since server start: "
+ totalSearchHits + "\nOverall Hit ratio: "
+ (double) totalSearchHits / (double) totalSearchRequests
// Reset interval hits to 0
intervalCount = 0;
totalIntervalHits = 0;
}
}