Packages
membrane_core
0.7.0
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.7
1.2.6
1.2.5
retired
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.2.0-rc1
1.1.2
1.1.1
1.1.0
1.1.0-rc1
1.1.0-rc0
1.0.1
1.0.0
1.0.0-rc1
1.0.0-rc0
0.12.9
0.12.8
0.12.7
0.12.6
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
retired
0.11.5
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.10.2
0.10.1
0.10.0
0.9.0
0.8.2
0.8.1
0.8.0
0.7.0
0.6.1
0.6.0
0.5.3
0.5.2
0.5.1
0.5.0
0.4.3
0.4.2
0.4.1
0.4.0
0.3.2
0.3.1
0.3.0
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
Membrane Multimedia Framework (Core)
Current section
Files
Jump to
Current section
Files
lib/membrane/telemetry.ex
defmodule Membrane.Telemetry do
@moduledoc """
Defines basic telemetry event types used by Membrane's Core.
Membrane uses [Telemetry Package](https://hex.pm/packages/telemetry) for instrumentation and does not store or save any measurements by itself.
It is user's responsibility to use some sort of metrics reporter
that will be attached to `:telemetry` package to consume and process generated measurements.
## Instrumentation
`Membrane.Telemetry` publishes functions that return described below event names.
The following events are published by Membrane's Core with following measurement types and metadata:
* `[:membrane, :metric, :value]` - used to report metrics, such as input buffer's size inside functions, incoming events and received caps.
* Measurement: `t:metric_event_value_t/0`
* Metadata: `%{}`
* `[:membrane, :link, :new]` - to report new link connection being initialized in pipeline.
* Measurement: `t:new_link_event_value_t/0`
* Metadata: `%{}`
The measurements are reported only when application using Membrane Core specifies following in compile-time config file:
config :membrane_core,
enable_telemetry: true
"""
@type event_name_t :: [atom(), ...]
@typedoc """
* component_path - element's or bin's path
* metric - metric's name
* value - metric's value
"""
@type metric_event_value_t :: %{
component_path: String.t(),
metric: String.t(),
value: integer()
}
@spec metric_event_name() :: event_name_t()
def metric_event_name, do: [:membrane, :metric, :value]
@typedoc """
* parent_path - process path of link's parent
* from - from element name
* to - to element name
* pad_from - from's pad name
* pad_to - to's pad name
"""
@type new_link_event_value_t :: %{
parent_path: String.t(),
from: String.t(),
to: String.t(),
pad_from: String.t(),
pad_to: String.t()
}
@spec new_link_event_name() :: event_name_t()
def new_link_event_name, do: [:membrane, :link, :new]
end