Stats: add metrics stats implementation

Resolves #285