IceMX package

Module contents

class IceMX.ChildInvocationMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, size: int = 0, replySize: int = 0)

Bases: Metrics

Provides information on child invocations. A child invocation is either remote (sent over an Ice connection) or collocated. An invocation can have multiple child invocations if it is retried. Child invocation metrics are embedded within IceMX.InvocationMetrics.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • size (int)

  • replySize (int)

size

The size of the invocation. This corresponds to the size of the marshaled input parameters.

Type:

int

replySize

The size of the invocation reply. This corresponds to the size of the marshaled output and return parameters.

Type:

int

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.CollocatedMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, size: int = 0, replySize: int = 0)

Bases: ChildInvocationMetrics

Provides information on invocations that are collocated. Collocated metrics are embedded within IceMX.InvocationMetrics.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • size (int)

  • replySize (int)

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.ConnectionMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, receivedBytes: int = 0, sentBytes: int = 0)

Bases: Metrics

Provides information on the data sent and received over Ice connections.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • receivedBytes (int)

  • sentBytes (int)

receivedBytes

The number of bytes received by the connection.

Type:

int

sentBytes

The number of bytes sent by the connection.

Type:

int

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.DispatchMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, userException: int = 0, size: int = 0, replySize: int = 0)

Bases: Metrics

Provides information on servant dispatches.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • userException (int)

  • size (int)

  • replySize (int)

userException

The number of dispatches that failed with a user exception.

Type:

int

size

The size of the incoming requests. This corresponds to the size of the marshaled input parameters.

Type:

int

replySize

The size of the replies. This corresponds to the size of the marshaled output and return parameters.

Type:

int

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.InvocationMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, retry: int = 0, userException: int = 0, remotes: list[~IceMX.Metrics.Metrics | None] = <factory>, collocated: list[~IceMX.Metrics.Metrics | None] = <factory>)

Bases: Metrics

Provide measurements for proxy invocations. Proxy invocations can either be sent over the wire or be collocated.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • retry (int)

  • userException (int)

  • remotes (list[Metrics | None])

  • collocated (list[Metrics | None])

retry

The number of retries for the invocations.

Type:

int

userException

The number of invocations that failed with a user exception.

Type:

int

remotes

The remote invocation metrics map.

Type:

list[Metrics | None]

collocated

The collocated invocation metrics map.

Type:

list[Metrics | None]

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.Metrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0)

Bases: Value

The base class for metrics. A metrics object represents a collection of measurements associated to a given a system.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

id

The metrics identifier.

Type:

str

total

The total number of objects observed by this metrics. This includes the number of currently observed objects and the number of objects observed in the past.

Type:

int

current

The number of objects currently observed by this metrics.

Type:

int

totalLifetime

The sum of the lifetime of each observed objects. This does not include the lifetime of objects which are currently observed, only the objects observed in the past.

Type:

int

failures

The number of failures observed.

Type:

int

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.MetricsAdmin

Bases: Object, ABC

abstractmethod disableMetricsView(name: str, current: Current) None | Awaitable[None]

Disables a metrics view.

Parameters:
  • name (str) – The metrics view name.

  • current (Ice.Current) – The Current object for the dispatch.

Returns:

None or an awaitable that completes when the dispatch completes.

Return type:

None | Awaitable[None]

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

abstractmethod enableMetricsView(name: str, current: Current) None | Awaitable[None]

Enables a metrics view.

Parameters:
  • name (str) – The metrics view name.

  • current (Ice.Current) – The Current object for the dispatch.

Returns:

None or an awaitable that completes when the dispatch completes.

Return type:

None | Awaitable[None]

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

abstractmethod getMapMetricsFailures(view: str, map: str, current: Current) Sequence[MetricsFailures] | Awaitable[Sequence[MetricsFailures]]

Gets the metrics failures associated with the given view and map.

Parameters:
  • view (str) – The name of the metrics view.

  • map (str) – The name of the metrics map.

  • current (Ice.Current) – The Current object for the dispatch.

Returns:

The metrics failures associated with the map.

Return type:

Sequence[MetricsFailures] | Awaitable[Sequence[MetricsFailures]]

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

abstractmethod getMetricsFailures(view: str, map: str, id: str, current: Current) MetricsFailures | Awaitable[MetricsFailures]

Gets the metrics failure associated for the given metrics.

Parameters:
  • view (str) – The name of the metrics view.

  • map (str) – The name of the metrics map.

  • id (str) – The ID of the metrics.

  • current (Ice.Current) – The Current object for the dispatch.

Returns:

The metrics failures associated with the metrics.

Return type:

MetricsFailures | Awaitable[MetricsFailures]

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

abstractmethod getMetricsView(view: str, current: Current) tuple[Mapping[str, Sequence[Metrics | None]], int] | Awaitable[tuple[Mapping[str, Sequence[Metrics | None]], int]]

Gets the metrics objects for the given metrics view.

Parameters:
  • view (str) – The name of the metrics view.

  • current (Ice.Current) – The Current object for the dispatch.

Returns:

A tuple containing:
  • Mapping[str, Sequence[Metrics | None]] The metrics view data, a dictionary of metric maps for each metrics class configured with the view. The timestamp allows the client to compute averages which are not dependent of the invocation latency for this operation.

  • int The local time of the process when the metrics objects were retrieved.

Return type:

tuple[Mapping[str, Sequence[Metrics | None]], int] | Awaitable[tuple[Mapping[str, Sequence[Metrics | None]], int]]

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

abstractmethod getMetricsViewNames(current: Current) tuple[Sequence[str], Sequence[str]] | Awaitable[tuple[Sequence[str], Sequence[str]]]

Gets the names of enabled and disabled metrics.

Parameters:

current (Ice.Current) – The Current object for the dispatch.

Returns:

A tuple containing:
  • Sequence[str] The names of the enabled views.

  • Sequence[str] The names of the disabled views.

Return type:

tuple[Sequence[str], Sequence[str]] | Awaitable[tuple[Sequence[str], Sequence[str]]]

static ice_staticId() str

Obtain the type ID of the Slice interface.

Returns:

The type ID.

Return type:

str

class IceMX.MetricsAdminPrx

Bases: ObjectPrx

static checkedCast(proxy: ObjectPrx | None, facet: str | None = None, context: dict[str, str] | None = None) MetricsAdminPrx | None

Creates a new proxy from an existing proxy after confirming the target object’s type via a remote invocation.

Parameters:
  • proxy (ObjectPrx | None) – The source proxy.

  • facet (str, optional) – A facet name.

  • context (dict[str, str], optional) – The request context.

Returns:

A new proxy with the requested type, or None if the source proxy is None or if the target object does not support the requested type.

Return type:

ObjectPrx | None

static checkedCastAsync(proxy: ObjectPrx | None, facet: str | None = None, context: dict[str, str] | None = None) Awaitable[MetricsAdminPrx | None]

Creates a new proxy from an existing proxy after confirming the target object’s type via a remote invocation.

Parameters:
  • proxy (ObjectPrx | None) – The source proxy.

  • facet (str, optional) – A facet name.

  • context (dict[str, str], optional) – The request context.

Returns:

A new proxy with the requested type, or None if the source proxy is None or if the target object does not support the requested type.

Return type:

ObjectPrx | None

disableMetricsView(name: str, context: dict[str, str] | None = None) None

Disables a metrics view.

Parameters:
  • name (str) – The metrics view name.

  • context (dict[str, str]) – The request context for the invocation.

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

Return type:

None

disableMetricsViewAsync(name: str, context: dict[str, str] | None = None) Awaitable[None]

Disables a metrics view.

Parameters:
  • name (str) – The metrics view name.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

An awaitable that is completed when the invocation completes.

Return type:

Awaitable[None]

enableMetricsView(name: str, context: dict[str, str] | None = None) None

Enables a metrics view.

Parameters:
  • name (str) – The metrics view name.

  • context (dict[str, str]) – The request context for the invocation.

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

Return type:

None

enableMetricsViewAsync(name: str, context: dict[str, str] | None = None) Awaitable[None]

Enables a metrics view.

Parameters:
  • name (str) – The metrics view name.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

An awaitable that is completed when the invocation completes.

Return type:

Awaitable[None]

getMapMetricsFailures(view: str, map: str, context: dict[str, str] | None = None) list[MetricsFailures]

Gets the metrics failures associated with the given view and map.

Parameters:
  • view (str) – The name of the metrics view.

  • map (str) – The name of the metrics map.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

The metrics failures associated with the map.

Return type:

list[MetricsFailures]

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

getMapMetricsFailuresAsync(view: str, map: str, context: dict[str, str] | None = None) Awaitable[list[MetricsFailures]]

Gets the metrics failures associated with the given view and map.

Parameters:
  • view (str) – The name of the metrics view.

  • map (str) – The name of the metrics map.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

The metrics failures associated with the map.

Return type:

Awaitable[list[MetricsFailures]]

getMetricsFailures(view: str, map: str, id: str, context: dict[str, str] | None = None) MetricsFailures

Gets the metrics failure associated for the given metrics.

Parameters:
  • view (str) – The name of the metrics view.

  • map (str) – The name of the metrics map.

  • id (str) – The ID of the metrics.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

The metrics failures associated with the metrics.

Return type:

MetricsFailures

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

getMetricsFailuresAsync(view: str, map: str, id: str, context: dict[str, str] | None = None) Awaitable[MetricsFailures]

Gets the metrics failure associated for the given metrics.

Parameters:
  • view (str) – The name of the metrics view.

  • map (str) – The name of the metrics map.

  • id (str) – The ID of the metrics.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

The metrics failures associated with the metrics.

Return type:

Awaitable[MetricsFailures]

getMetricsView(view: str, context: dict[str, str] | None = None) tuple[dict[str, list[Metrics | None]], int]

Gets the metrics objects for the given metrics view.

Parameters:
  • view (str) – The name of the metrics view.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

A tuple containing:
  • dict[str, list[Metrics | None]] The metrics view data, a dictionary of metric maps for each metrics class configured with the view. The timestamp allows the client to compute averages which are not dependent of the invocation latency for this operation.

  • int The local time of the process when the metrics objects were retrieved.

Return type:

tuple[dict[str, list[Metrics | None]], int]

Raises:

UnknownMetricsView – Thrown when the metrics view cannot be found.

getMetricsViewAsync(view: str, context: dict[str, str] | None = None) Awaitable[tuple[dict[str, list[Metrics | None]], int]]

Gets the metrics objects for the given metrics view.

Parameters:
  • view (str) – The name of the metrics view.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

A tuple containing:
  • dict[str, list[Metrics | None]] The metrics view data, a dictionary of metric maps for each metrics class configured with the view. The timestamp allows the client to compute averages which are not dependent of the invocation latency for this operation.

  • int The local time of the process when the metrics objects were retrieved.

Return type:

Awaitable[tuple[dict[str, list[Metrics | None]], int]]

getMetricsViewNames(context: dict[str, str] | None = None) tuple[list[str], list[str]]

Gets the names of enabled and disabled metrics.

Parameters:

context (dict[str, str]) – The request context for the invocation.

Returns:

A tuple containing:
  • list[str] The names of the enabled views.

  • list[str] The names of the disabled views.

Return type:

tuple[list[str], list[str]]

getMetricsViewNamesAsync(context: dict[str, str] | None = None) Awaitable[tuple[list[str], list[str]]]

Gets the names of enabled and disabled metrics.

Parameters:

context (dict[str, str]) – The request context for the invocation.

Returns:

A tuple containing:
  • list[str] The names of the enabled views.

  • list[str] The names of the disabled views.

Return type:

Awaitable[tuple[list[str], list[str]]]

static ice_staticId() str

Gets the Slice type ID of the interface associated with this proxy.

Returns:

The type ID, “::Ice::Object”.

Return type:

str

static uncheckedCast(proxy: ObjectPrx | None, facet: str | None = None) MetricsAdminPrx | None

Creates a new proxy from an existing proxy.

Parameters:
  • proxy (ObjectPrx | None) – The source proxy.

  • facet (str, optional) – A facet name.

Returns:

A new proxy with the requested type, or None if the source proxy is None.

Return type:

ObjectPrx | None

class IceMX.MetricsFailures(id: str = '', failures: dict[str, int] = <factory>)

Bases: object

Keeps track of metrics failures.

Parameters:
  • id (str)

  • failures (dict[str, int])

id

The identifier of the metrics object associated to the failures.

Type:

str

failures

The failures observed for this metrics.

Type:

dict[str, int]

class IceMX.RemoteMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, size: int = 0, replySize: int = 0)

Bases: ChildInvocationMetrics

Provides information on invocations that are specifically sent over Ice connections. Remote metrics are embedded within IceMX.InvocationMetrics.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • size (int)

  • replySize (int)

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.SessionMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, forwardedClient: int = 0, forwardedServer: int = 0, routingTableSize: int = 0, queuedClient: int = 0, queuedServer: int = 0, overriddenClient: int = 0, overriddenServer: int = 0)

Bases: Metrics

Provides information about Glacier2 sessions.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • forwardedClient (int)

  • forwardedServer (int)

  • routingTableSize (int)

  • queuedClient (int)

  • queuedServer (int)

  • overriddenClient (int)

  • overriddenServer (int)

forwardedClient

The number of client requests forwarded.

Type:

int

forwardedServer

The number of server requests forwarded.

Type:

int

routingTableSize

The size of the routing table.

Type:

int

queuedClient

The number of client requests queued.

Type:

int

queuedServer

The number of server requests queued.

Type:

int

overriddenClient

The number of client requests overridden.

Type:

int

overriddenServer

The number of server requests overridden.

Type:

int

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.SubscriberMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, queued: int = 0, outstanding: int = 0, delivered: int = 0)

Bases: Metrics

Provides information about IceStorm subscribers.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • queued (int)

  • outstanding (int)

  • delivered (int)

queued

The number of queued events.

Type:

int

outstanding

The number of outstanding events.

Type:

int

delivered

The number of forwarded events.

Type:

int

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.ThreadMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, inUseForIO: int = 0, inUseForUser: int = 0, inUseForOther: int = 0)

Bases: Metrics

Provides information on the number of threads currently in use and their activity.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • inUseForIO (int)

  • inUseForUser (int)

  • inUseForOther (int)

inUseForIO

The number of threads which are currently performing socket reads or writes.

Type:

int

inUseForUser

The number of threads which are currently calling user code (servant dispatch, AMI callbacks, etc).

Type:

int

inUseForOther

The number of threads which are currently performing other activities such as DNS lookups, garbage collection, etc. These are all the other threads created by the Ice runtime that are not counted in IceMX.ThreadMetrics.inUseForUser or IceMX.ThreadMetrics.inUseForIO.

Type:

int

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

class IceMX.TopicMetrics(id: str = '', total: int = 0, current: int = 0, totalLifetime: int = 0, failures: int = 0, published: int = 0, forwarded: int = 0)

Bases: Metrics

Provides information about one or more IceStorm topics.

Parameters:
  • id (str)

  • total (int)

  • current (int)

  • totalLifetime (int)

  • failures (int)

  • published (int)

  • forwarded (int)

published

The number of events published on the topic(s) by publishers.

Type:

int

forwarded

The number of events forwarded on the topic(s) by IceStorm topic links.

Type:

int

static ice_staticId() str

Obtain the type ID of this Slice class or interface.

Returns:

The type ID.

Return type:

str

exception IceMX.UnknownMetricsView

Bases: UserException

The exception that is thrown when a metrics view cannot be found.

Return type:

None