Page tree
Skip to end of metadata
Go to start of metadata

Introduced in




Returns information about the current status of the cache, which can be used to determine the best parameters for cache initialization.

Can also output the current contents of the cache into a .csv file.

This function is useful in finding the ideal parameters to use for a cache.


Syntax:[cache, file] call fn_vbs_cacheDiag
  • cache: String or Array - Array or string name of variable used as cache.
  • file: String - Location of output file. If only a file name or relative path is given, the file is placed relative to the program executable (optional, if omitted, no file is created).
Return Value:Array - [cache_params, usage_stats, hit_stats]
  • cache_params: [maximum size, clean size, clean mode, array input] - Parameters used to establish the cache.
  • usage_stats: [used elements, percent of available space in use, clean size percent of maximum size] - Statistics on how much of the cache space is used.
  • hit_stats: [cache hits, cache misses, hit percent] - Statistics on how often data is pulled from the cache ("hits") as opposed to being calculated from scratch ("misses").


When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.


_stats = ["mycache", "C:\mycache.csv"] call fn_vbs_cacheDiag

Additional Information

See also: fn vbs cachedEval, fn vbs cacheInit