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


Introduced in

Version:1.31

Description

Description:

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

Syntax:[cache, file] call fn_vbs_cacheDiag
Parameters:
  • 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").

Warning

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.

Examples

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

Additional Information

See also: fn vbs cachedEval, fn vbs cacheInit
Multiplayer: 
Problems: 

Notes