Package com.cetsoft.caudit.quantity

Examples of com.cetsoft.caudit.quantity.LongQuantity


  /**
   * Monitor used memory in kb.
   */
  public static void monitorUsedMemoryInKB() {
    final int longQuantityId = Audits.mapAudit("USED_MEMORY_IN_KB");
    final LongQuantity longQuantity = Audits.getLongQuantity(longQuantityId);
    longQuantity.setProvider(new AuditProvider() {
      public void updateAudit() {
        long usedMemory = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / KILOBYTE;
        longQuantity.set(usedMemory);
      }
    });
  }
View Full Code Here


  /**
   * Monitor used memory in mb.
   */
  public static void monitorUsedMemoryInMB() {
    final int longQuantityId = Audits.mapAudit("USED_MEMORY_IN_MB");
    final LongQuantity longQuantity = Audits.getLongQuantity(longQuantityId);
    longQuantity.setProvider(new AuditProvider() {
      public void updateAudit() {
        long usedMemory = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / MEGABYTE;
        longQuantity.set(usedMemory);
      }
    });
  }
View Full Code Here

  /**
   * Monitor used memory in gb.
   */
  public static void monitorUsedMemoryInGB() {
    final int longQuantityId = Audits.mapAudit("USED_MEMORY_IN_GB");
    final LongQuantity longQuantity = Audits.getLongQuantity(longQuantityId);
    longQuantity.setProvider(new AuditProvider() {
      public void updateAudit() {
        long usedMemory = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / GIGABYTE;
        longQuantity.set(usedMemory);
      }
    });
  }
View Full Code Here

  /**
   * Monitor number of threads.
   */
  public static void monitorNumberOfThreads() {
    final int longQuantityId = Audits.mapAudit("NO_OF_THREADS");
    final LongQuantity longQuantity = Audits.getLongQuantity(longQuantityId);
    longQuantity.setProvider(new AuditProvider() {
      public void updateAudit() {
        longQuantity.set(Thread.activeCount());
      }
    });
  }
View Full Code Here

      case BASIC_STOPWATCH:
        return new Stopwatch(auditId, auditName);
      case COUNTING_STOPWATCH:
        return new CountingStopwatch(auditId, auditName);
      case LONG_QUANTITY:
        return new LongQuantity(auditId, auditName);
      case DOUBLE_QUANTITY:
        return new DoubleQuantity(auditId, auditName);
      case COMPLEX_QUANTITY:
        return new DoubleQuantity(auditId, auditName);
      }
View Full Code Here

      }).start();
    }
    new Thread(new Runnable() {
      public void run() {
        while (true) {
          LongQuantity quantity = Audits.getLongQuantity(LONG_QUANTITY_ID);
          quantity.increment();
        }
      }
    }).start();
    final DoubleQuantity doubleQuantity = Audits.getDoubleQuantity(PROVIDED_QUANTITY_ID);
    doubleQuantity.setProvider(new AuditProvider() {
View Full Code Here

TOP

Related Classes of com.cetsoft.caudit.quantity.LongQuantity

Copyright © 2018 www.massapicom. 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.