count on custom metric search reimplemented