Package org.javasimon

Examples of org.javasimon.Stopwatch.start()


  /* (non-Javadoc)
   * @see org.directmemory.supervisor.Supervisor#checkLimits(org.directmemory.CacheStore)
   */
  public void disposeOverflow(CacheStore cache) {
        Stopwatch stopWatch = SimonManager.getStopwatch("supervisor.asyncbatch.checkLimits");
    Split split = stopWatch.start();
   
    if (totalCalls++ >= batchSize) {
      totalCalls = 0;
      new ThreadUsingCache(cache) {
        public void run() {
View Full Code Here


  /* (non-Javadoc)
   * @see org.directmemory.supervisor.Supervisor#checkLimits(org.directmemory.CacheStore)
   */
  public void disposeOverflow(CacheStore cache) {
        Stopwatch stopWatch = SimonManager.getStopwatch("supervisor.batch.checkLimits");
    Split split = stopWatch.start();
   
    if (totalCalls++ >= batchSize) {
      totalCalls = 0;
      logger.debug("checking memory limits");
      cache.disposeHeapOverflow();
View Full Code Here

  /* (non-Javadoc)
   * @see org.directmemory.supervisor.Supervisor#checkLimits(org.directmemory.CacheStore)
   */
  public void disposeOverflow(CacheStore cache) {
        Stopwatch stopWatch = SimonManager.getStopwatch("supervisor.asimple.checkLimits");
    Split split = stopWatch.start();
   
    logger.debug("checking memory limits");
    cache.disposeHeapOverflow();
    cache.disposeOffHeapOverflow();
   
View Full Code Here

  /* (non-Javadoc)
   * @see org.directmemory.supervisor.Supervisor#checkLimits(org.directmemory.CacheStore)
   */
  public void disposeOverflow(CacheStore cache) {
    Stopwatch stopWatch = SimonManager.getStopwatch("supervisor.timed.checkLimits");
    Split split = stopWatch.start();
    long passed = new Date().getTime() - lastCheck.getTime();
    if (passed >= batchInterval) {
      lastCheck = new Date();
      new ThreadUsingCache(cache) {
        public void run() {
View Full Code Here

        entry.buffer.position(entry.position);
        entry.buffer.get(dest);
      }
      split.stop();
      try {
        Split deserSplit = deserializeMon.start();
        @SuppressWarnings("unused")
        DummyPojo obj = Starter.deserialize(dest);
        deserSplit.stop();
//        System.out.println(obj.getName() + " count=" + count);
      } catch (IOException e) {
View Full Code Here

        entry.buffer.get(dest);
      }
      split.stop();
      DummyPojo obj = null;
      try {
        Split deserSplit = deserializeMon.start();
        obj = Starter.deserialize(dest);
        deserSplit.stop();
      } catch (IOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
View Full Code Here

   * @see org.directmemory.utils.Serializer#serialize(java.lang.Object, java.lang.Class)
   */
  @SuppressWarnings("unchecked")
  public byte[] serialize(Object obj, @SuppressWarnings("rawtypes") Class clazz) throws IOException {
        Stopwatch stopWatch = SimonManager.getStopwatch("serializer.PSSerialize");
    Split split = stopWatch.start();
    @SuppressWarnings("rawtypes")
    Schema schema = RuntimeSchema.getSchema(clazz);
    final LinkedBuffer buffer = LinkedBuffer.allocate(serBufferSize);
    byte[] protostuff = null;

View Full Code Here

   * @see org.directmemory.utils.Serializer#deserialize(byte[], java.lang.Class)
   */
  @SuppressWarnings("unchecked")
  public Object deserialize(byte[] source, @SuppressWarnings("rawtypes") Class clazz) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
        Stopwatch stopWatch = SimonManager.getStopwatch("serializer.PSDeserialize");
    Split split = stopWatch.start();
    final Object object = clazz.newInstance();
    @SuppressWarnings("rawtypes")
    final Schema schema = RuntimeSchema.getSchema(clazz);
    ProtostuffIOUtil.mergeFrom(source, object, schema);
    split.stop();
View Full Code Here

public class StandardSerializer implements Serializer {
 
  public byte[] serialize(Object obj, @SuppressWarnings("rawtypes") Class clazz) throws IOException {
        Stopwatch stopWatch = SimonManager.getStopwatch("serializer.javaSerialize");
    Split split = stopWatch.start();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(baos);
    oos.writeObject(obj);
    oos.flush();
    oos.close();
View Full Code Here

    return baos.toByteArray();   
  }

  public Serializable deserialize(byte[] source, @SuppressWarnings("rawtypes") Class clazz) throws IOException, ClassNotFoundException {
        Stopwatch stopWatch = SimonManager.getStopwatch("serializer.javaDeserialize");
    Split split = stopWatch.start();
    ByteArrayInputStream bis = new ByteArrayInputStream(source);
    ObjectInputStream ois = new ObjectInputStream(bis);
    Serializable obj = (Serializable) ois.readObject();
    ois.close();
    split.stop();
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.