Class: ServerManager

(abstract) core/abstracts.ServerManager()

This is a standalone object for managing the MediaServer

Extends

Members

(static) constructorParams

Source:

(static) events

Source:

Methods

(static) getCpuCount(callbackopt) → {external:Promise}

Number of CPU cores that the media server can use.

Linux processes can be configured to use only a subset of the cores that are available in the system, via the process affinity settings (sched_setaffinity(2)). With this method it is possible to know the number of cores that the media server can use in the machine where is running.

For example, it's possible to limit the core affinity inside a Docker container by running with a command such as docker run --cpuset-cpus='0,1'.

Note that the return value represents the number of logical processing units available, i.e. CPU cores including Hyper-Threading.

Parameters:
Name Type Attributes Description
callback module:core/abstracts.ServerManager~getCpuCountCallback <optional>
Source:
Returns:
Type
external:Promise

(static) getKmd(moduleName, callbackopt) → {external:Promise}

Returns the kmd associated to a module
Parameters:
Name Type Attributes Description
moduleName external:String Name of the module to get its kmd file
callback module:core/abstracts.ServerManager~getKmdCallback <optional>
Source:
Returns:
Type
external:Promise

(static) getUsedCpu(interval, callbackopt) → {external:Promise}

Average CPU usage of the server.

This method measures the average CPU usage of the media server during the requested interval. Normally you will want to choose an interval between 1000 and 10000 ms.

The returned value represents the global system CPU usage of the media server, as an average across all processing units (CPU cores).

Parameters:
Name Type Attributes Description
interval external:Integer Time to measure the average CPU usage, in milliseconds.
callback module:core/abstracts.ServerManager~getUsedCpuCallback <optional>
Source:
Returns:
Type
external:Promise

(static) getUsedMemory(callbackopt) → {external:Promise}

Returns the amount of memory that the server is using, in KiB
Parameters:
Name Type Attributes Description
callback module:core/abstracts.ServerManager~getUsedMemoryCallback <optional>
Source:
Returns:
Type
external:Promise

getChildren(callbackopt) → {external:Promise}

Children of this MediaObject.
Parameters:
Name Type Attributes Description
callback module:core/abstracts.MediaObject~getChildrenCallback <optional>
Inherited From:
Source:
Returns:
Type
external:Promise

getCreationTime(callbackopt) → {external:Promise}

MediaObject creation time in seconds since Epoch.
Parameters:
Name Type Attributes Description
callback module:core/abstracts.MediaObject~getCreationTimeCallback <optional>
Inherited From:
Source:
Returns:
Type
external:Promise

getInfo(callbackopt) → {external:Promise}

Server information, version, modules, factories, etc
Parameters:
Name Type Attributes Description
callback module:core/abstracts.ServerManager~getInfoCallback <optional>
Source:
Returns:
Type
external:Promise

getMediaPipeline(callbackopt) → {external:Promise}

MediaPipeline to which this MediaObject belongs. It returns itself when invoked for a pipeline object.
Parameters:
Name Type Attributes Description
callback module:core/abstracts.MediaObject~getMediaPipelineCallback <optional>
Inherited From:
Source:
Returns:
Type
external:Promise

getMetadata(callbackopt) → {external:Promise}

Metadata stored in the server
Parameters:
Name Type Attributes Description
callback module:core/abstracts.ServerManager~getMetadataCallback <optional>
Source:
Returns:
Type
external:Promise

getName(callbackopt) → {external:Promise}

This MediaObject's name.

This is just sugar to simplify developers' life debugging, it is not used internally for indexing nor identifying the objects. By default, it's the object's ID.

Parameters:
Name Type Attributes Description
callback module:core/abstracts.MediaObject~getNameCallback <optional>
Inherited From:
Source:
Returns:
Type
external:Promise

getParent(callbackopt) → {external:Promise}

Parent of this MediaObject.

The parent of a Hub or a MediaElement is its MediaPipeline. A MediaPipeline has no parent, so this property will be null.

Parameters:
Name Type Attributes Description
callback module:core/abstracts.MediaObject~getParentCallback <optional>
Inherited From:
Source:
Returns:
Type
external:Promise

getPipelines(callbackopt) → {external:Promise}

All the pipelines available in the server
Parameters:
Name Type Attributes Description
callback module:core/abstracts.ServerManager~getPipelinesCallback <optional>
Source:
Returns:
Type
external:Promise

getSendTagsInEvents(callbackopt) → {external:Promise}

Flag activating or deactivating sending the element's tags in fired events.
Parameters:
Name Type Attributes Description
callback module:core/abstracts.MediaObject~getSendTagsInEventsCallback <optional>
Inherited From:
Source:
Returns:
Type
external:Promise

getSessions(callbackopt) → {external:Promise}

All active sessions in the server
Parameters:
Name Type Attributes Description
callback module:core/abstracts.ServerManager~getSessionsCallback <optional>
Source:
Returns:
Type
external:Promise

setName(name, callbackopt) → {external:Promise}

This MediaObject's name.

This is just sugar to simplify developers' life debugging, it is not used internally for indexing nor identifying the objects. By default, it's the object's ID.

Parameters:
Name Type Attributes Description
name external:String
callback module:core/abstracts.MediaObject~setNameCallback <optional>
Inherited From:
Source:
Returns:
Type
external:Promise

setSendTagsInEvents(sendTagsInEvents, callbackopt) → {external:Promise}

Flag activating or deactivating sending the element's tags in fired events.
Parameters:
Name Type Attributes Description
sendTagsInEvents external:Boolean
callback module:core/abstracts.MediaObject~setSendTagsInEventsCallback <optional>
Inherited From:
Source:
Returns:
Type
external:Promise

Type Definitions

getCpuCountCallback(error, result)

Parameters:
Name Type Description
error external:Error
result external:Integer Number of CPU cores available for the media server.
Source:

getInfoCallback(error, result)

Parameters:
Name Type Description
error external:Error
result module:core/complexTypes.ServerInfo
Source:

getKmdCallback(error, result)

Parameters:
Name Type Description
error external:Error
result external:String The kmd file.
Source:

getMetadataCallback(error, result)

Parameters:
Name Type Description
error external:Error
result external:String
Source:

getPipelinesCallback(error, result)

Parameters:
Name Type Description
error external:Error
result module:core.MediaPipeline
Source:

getSessionsCallback(error, result)

Parameters:
Name Type Description
error external:Error
result external:String
Source:

getUsedCpuCallback(error, result)

Parameters:
Name Type Description
error external:Error
result external:Number CPU usage %.
Source:

getUsedMemoryCallback(error, result)

Parameters:
Name Type Description
error external:Error
result external:int64 Used memory, in KiB.
Source: