package timing

import (
	"context"

	"github.com/labstack/echo/v4"
)

// DB records the DB time spent in the request.
func DB(c context.Context, desc ...string) *TimingEnd {
	return Start(c, "db", desc...)
}

// RPC records the RPC time spent in the request.
func RPC(c context.Context, desc ...string) *TimingEnd {
	return Start(c, "rpc", desc...)
}

// Total records the total time spent in the request.
func Total(c echo.Context) *TimingEnd {
	return Start(c.Request().Context(), "total")
}
