Transmuter.Telemetry.Logger (transmuter v2.0.0)

Copy Markdown View Source

A Logger handler for the Transmuter events that show compile work.

It logs model loads, compiles, segment compiles, cache evictions, Hub downloads and the Hub metadata that comes from the cache because the Hub could not be reached. It does not log the events of each call, because a service makes many calls, or the files that come from the Hub cache. See Transmuter.Telemetry for all events.

Usage

Attach the handler in the start/2 function of your application:

def start(_type, _args) do
  Transmuter.Telemetry.Logger.attach()

  Supervisor.start_link(children, strategy: :one_for_one)
end

Example output

[info] [Transmuter] hub.download completed in 2.31s (Xenova/all-MiniLM-L6-v2 onnx/model.onnx, 90.4 MB)
[info] [Transmuter] load completed in 412ms (Xenova/all-MiniLM-L6-v2 onnx/model.onnx, 343 nodes, opset 11)
[info] [Transmuter] compile completed in 1.2s (Xenova/all-MiniLM-L6-v2 onnx/model.onnx, EMLX, no graph break)
[info] [Transmuter] segment.compile completed in 85ms (kokoro.onnx, position 0, stop 209 (a value that decides a shape), compiled, shapes [...])
[info] [Transmuter] segment.compile completed in 640ms (kokoro.onnx, position 210, stop end, compiled, shapes [...])
[info] [Transmuter] segment.compile completed in 12ms (kokoro.onnx, position 210, stop end, compiled, disk cache hit, shapes [...])
[info] [Transmuter] cache.evict (kokoro.onnx, position 210, cache size 8, shapes [...])
[info] [Transmuter] hub.info used the saved metadata, because the Hub could not be reached or gave an error (Xenova/all-MiniLM-L6-v2, revision main)

Options

Transmuter.Telemetry.Logger.attach(
  level: :debug,
  handler_id: "my-logger"
)
  • :level - the log level. The default is :info.
  • :handler_id - the handler ID. The default is "transmuter-telemetry-logger".

Detaching

Transmuter.Telemetry.Logger.detach()

Summary

Functions

Attaches the handler. See the module documentation for the options.

Detaches the handler. The :handler_id option is the same as in attach/1.

Functions

attach(opts \\ [])

Attaches the handler. See the module documentation for the options.

detach(opts \\ [])

Detaches the handler. The :handler_id option is the same as in attach/1.