Package com.cetsoft.caudit.common

Examples of com.cetsoft.caudit.common.AuditProvider


   * 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

          quantity.increment();
        }
      }
    }).start();
    final DoubleQuantity doubleQuantity = Audits.getDoubleQuantity(PROVIDED_QUANTITY_ID);
    doubleQuantity.setProvider(new AuditProvider() {
      public void updateAudit() {
        doubleQuantity.set(Math.random());
      }
    });
    Audits.monitorUsedMemoryInMB();
View Full Code Here

TOP

Related Classes of com.cetsoft.caudit.common.AuditProvider

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.