prototype of metric API