home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / xmem1.exe / XMEM1.C next >
C/C++ Source or Header  |  1995-08-28  |  4KB  |  107 lines

  1. /**************************************************************************
  2. ** File: xmem1.c
  3. **
  4. ** Desc: An attempt to get the amount of memory on a 4.x server
  5. **
  6. **
  7. **   DISCLAIMER  
  8. **  
  9. **   Novell, Inc. makes no representations or warranties with respect to
  10. **   any NetWare software, and specifically disclaims any express or
  11. **   implied warranties of merchantability, title, or fitness for a
  12. **   particular purpose.  
  13. **
  14. **   Distribution of any NetWare software is forbidden without the
  15. **   express written consent of Novell, Inc.  Further, Novell reserves
  16. **   the right to discontinue distribution of any NetWare software.
  17. **   
  18. **   Novell is not responsible for lost profits or revenue, loss of use
  19. **   of the software, loss of data, costs of re-creating lost data, the
  20. **   cost of any substitute equipment or program, or claims by any party
  21. **   other than you.  Novell strongly recommends a backup be made before
  22. **   any software is installed.   Technical support for this software
  23. **   may be provided at the discretion of Novell.
  24. **
  25. **
  26. ** Programmers:
  27. **
  28. **    Ini   Who                  Firm
  29. **    ---------------------------------------------------------------------
  30. **    DWH   Dirk W. Howard       Novell Developer Support
  31. **
  32. **
  33. ** History:
  34. **
  35. **    When        Who      What
  36. **    ---------------------------------------------------------------------
  37. **    12-15-1994    DWH      First code.
  38. **
  39. */
  40.  
  41.  
  42. #include <stdio.h>
  43. #include <nwservst.h>
  44. #include <errno.h>
  45.  
  46. int main()
  47. {
  48.    GetCacheInfoStructure   buffer;
  49.    CacheMemoryCounters     *memCntrs;
  50.    CacheTrendCounters      *trndCntrs;
  51.    CacheInformation        *info;
  52.    LONG                    lccode;
  53.  
  54.    lccode = SSGetCacheInfo( (BYTE *) &buffer, sizeof(buffer) );
  55.    if ( lccode != ESUCCESS )
  56.    {
  57.       printf( "Error %ld returned by SSGetCacheInfo.\n\n", lccode );
  58.       return 1;
  59.    }
  60.    memCntrs = &buffer.MemoryCntrs;
  61.    trndCntrs = &buffer.TrendCntrs;
  62.    info = &buffer.CacheInfo;
  63.  
  64.    printf(  "OriginalNumberOfCacheBuffers : %ld kb\n"
  65.             "CurrentNumberOfCacheBuffers  : %ld kb\n"
  66.             "CacheDirtyBlockThreshold     : %ld kb\n"
  67.             "\n",
  68.             memCntrs->OriginalNumberOfCacheBuffers * 4096,
  69.             memCntrs->CurrentNumberOfCacheBuffers * 4096,
  70.             memCntrs->CacheDirtyBlockThreshold * 4096
  71.             );
  72.  
  73.    printf(  "NumOfCacheChecks : %ld\n"
  74.             "NumOfCacheHits   : %ld\n"
  75.             "LRUSittingTime   : %ld\n"
  76.             "\n",
  77.             trndCntrs->NumOfCacheChecks,
  78.             trndCntrs->NumOfCacheHits,
  79.             trndCntrs->LRUSittingTime
  80.             );
  81.  
  82.    printf(  "MaximumByteCount              : %ld kb\n"
  83.             "MinimumNumberOfCacheBuffers   : %ld\n"
  84.             "MinimumCacheReportThreshold   : %ld\n"
  85.             "AllocateWaitingCount          : %ld\n"
  86.             "NDirtyBlocks                  : %ld\n"
  87.             "CacheDirtyWaitTime            : %ld\n"
  88.             "CacheMaximumConcurrentWrites  : %ld\n"
  89.             "MaximumDirtyTime              : %ld\n"
  90.             "NumberOfDirectoryCacheBuffers : %ld\n"
  91.             "CacheByteToBlockShiftFactor   : %ld\n"
  92.             "\n",
  93.             info->MaximumByteCount * 4096,
  94.             info->MinimumNumberOfCacheBuffers,
  95.             info->MinimumCacheReportThreshold,
  96.             info->AllocateWaitingCount,
  97.             info->NDirtyBlocks,
  98.             info->CacheDirtyWaitTime,
  99.             info->CacheMaximumConcurrentWrites,
  100.             info->MaximumDirtyTime,
  101.             info->NumberOfDirectoryCacheBuffers,
  102.             info->CacheByteToBlockShiftFactor
  103.             );
  104.  
  105.    return 0;
  106. }
  107.