getFileCacheStats()

RTMP/E

 getFileCacheStats([verbose:Boolean] [, file:String]) : Object

HTTP

 http://www.example.com:1111/admin/getFileCacheStats?auser=username&apswd=password[&verbose=value][&file=string]

Obtains data about the file cache including size of cache, number of file objects held in cache, and number of segment hits and misses. If the verbose parameter is set to true, individual statistics for each file in the cache are returned.

Beginning with Flash Media Server 3.5, you can dynamically control the core to which an application is sent. Controlling the cores allows load balancing across cores based on their performance counters. In getFileCacheStats, the results are grouped by core.

Availability

Flash Media Server 3.0

Parameters

verbose

Boolean; true displays individual statistics for each file in the cache; false displays a summary of all the objects in the cache. The default value is false.

file

A String indicating the statistics of a file. Specify a value in the form [object_name] value.

The file property value requires the following syntax, "flv:[path]", "mp3:[path]", "mp4:[path]", and so on. To determine this value, first call the API with verbose=true and grab the path from the result, as in the following:

 <object_name>5888_C:\Program Files\Adobe\Adobe Media Server 4\applications\app_1\streams\_definst_\Coral_Reef_Adventure_spark_150k_105s</object_name>

Note: Remove 5888_ when it is used in the file property; only the file path should be used.

Do not use the verbose and file parameters at the same time. If both are used, the first one is taken and the second one is ignored. If there are many files in the cache, using verbose and setting it to true can be time-consuming. It may also cause a browser timeout if you call the API from a web browser. To reduce the amount of data being returned, pass the name of a single object as a parameter. Passing the name of a single object returns only the statistics for that object.

auser

A String indicating the user name of the administrator.

apswd

A String indicating the password of the administrator.

Returns

RTMP/E

If the call succeeds, the server sends a reply information object with a level property of status, a code property of NetConnection.Call.Success, and a data property that is an object. The data object has the following properties:

Property

Description

num_objs

Number; total number of file objects held in the cache.

hits

Number; total number of segment “hits” since the server started.

misses

Number; total number of segment misses since the server started.

bytes

Number; current size of the cache, in bytes.

bytes_inuse

Number; current amount of cache being used, in bytes

released

Number; total number of segments released since the server started.

cores

An object containing information about specific core processes. This object contains all the properties of the data object and an additional core_id property. For example, <data><hits> contains an aggregate value for the server. The property <core><hits> contains a value for a specific core. If no cores are running, the <cores> element is empty.

core_id

Number; the ID of a core process.

num_segments

Number; total number of segments held in the cache.

num_segments_inuse

Number; total number of segments in the cache being actively used. Added in Flash Media Server 3.5.1.

If the verbose parameter is set to true, the data property has an objects property with the following individual statistics for each file in the cache:

Property

Description

object_name

Name of the stream object.

num_segments

Number; total number of segments from this object currently cached.

num_segments_inuse

Number; total number of segments from this object being actively used. Added in Flash Media Server 3.5.1.

hits

Hits for this object.

misses

Misses for this object.

useCount

Number; total number of clients accessing this object (including internal server clients).

released

Number; total number of segments released from this object.

recording

If this file is being recorded.

bytes

Number; size of this object in the cache.

num_kfs

Number; total number of frames in the keyframe cache for this object.

kfbytes

Number; size of the keyframe cache for this object, in bytes.

bytes_inuse

Number; the amount of this object being actively used, in bytes.

overhead

Number; the fixed memory overhead of this object, in bytes.

Following is the output of a call to getFileCacheStats() with verbose set to false:

 <result>   <level>status</level>   <code>NetConnect.Call.Success</code>   <timestamp>7/24/2008 3:59:22 PM</timestamp>   <data> <num_objs>0</num_objs> <hits>0</hits> <misses>0</misses> <bytes>0</bytes> <bytes_inuse>0</bytes_inuse> <released>0</released> <cores> <_26432> <num_objs>0</num_objs> <hits>0</hits> <misses>0</misses> <bytes>0</bytes> <bytes_inuse>0</bytes_inuse> <released>0</released> <core_id>0</core_id> <_26432> </cores> </data>  </result>

note: If no cores have started (no applications running), then only the aggregate data is returned.

If the call fails, the server sends a reply information object with a level property of error and a code property of NetConnection.Call.Failed or a more specific value, if available. Some objects might also have a description property that contains a string describing the cause of the failure.

HTTP

If the call succeeds, it returns XML with the following structure (the data is sample data):

 <result>   <level>status</level>   <code>NetConnection.Call.Success</code>   <timestamp>7/16/2008 10:23:59 AM</timestamp>   <data>   <num_objs>1</num_objs>   <hits>10</hits>   <misses>17</misses>   <bytes>2064203</bytes> <bytes_inuse>261875</bytes_inuse>   <released>0</released> <cores> <_3644> <num_objs>1</num_objs> <hits>10</hts> <misses>17</misses> <bytes>2064203</bytes> <bytes_inuse>261875<bytes_inuse> <released>0</released> <objects> <_0> <_3644> <num_objects>1</num_objs> <hits>6</hits> <misses>28</misses> <bytes>2440227</bytes> <bytes_inuse>528112</bytes_inuse> <released>0</released> <core_id>1</core_id> <objects></objects> </_3364> <_0> </objects> <_3644> </cores>   <objects>   <_0>   <object_name>3644_C:\Program Files\Adobe\Adobe Media Server 4\applications\vod\media\sample</object_name>   <num_segments>9</num_segments>   <hits>10</hits>   <misses>9</misses>   <useCount>3</useCount>   <released>0</released>   <recording>false</recording>   <bytes>2064203</bytes>   <num_kfs>0</num_kfs>   <kfbytes>0</kfbytes>   </_0>   </objects>   </data>  </result>

If the call fails, it returns XML with the following structure:

 <result>   <level></level>   <code></code>   <description></description>   <timestamp></timestamp>  </result>

Note: The timestamp response over HTTP is formatted differently on Windows (9/23/2007 6:16:40 PM) and Linux (Sun 23 Sep 2007 06:16:40 PM IST).

See also

Get help faster and easier

New user?