server_timing v0.1.5 ServerTiming View Source

ServerTiming is the main module, for configuring start and end time, for an unique name / service name.

Usage

  • Once, you are done setting up the plug in your router.
  defmodule MyModule do
    alias ServerTiming
    alias MyModule.HelloService

    def myServiceCall(conn, message) do
      ServerTiming.start(conn, "hello-service")
      HelloService.doSomething(message)
      ServerTiming.stop(conn, "hello-service")
    end
  end

The above will register hello-service tag in your conn and set server-timing header for the hello-service

Link to this section Summary

Functions

Registers start time for a specified "name"

Registers stop time for a specified "name"

Link to this section Functions

Link to this function start(conn, name) View Source
start(Plug.Conn, String.t()) :: Plug.Conn
start(Plug.Conn, Atom.t()) :: Plug.Conn

Registers start time for a specified "name"

Link to this function stop(conn, name) View Source
stop(Plug.Conn, String.t()) :: Plug.Conn
stop(Plug.Conn, Atom.t()) :: Plug.Conn

Registers stop time for a specified "name"