(mt) Stats is a specialised proxy server that gets your server's statistics from MediaTemple's API servers. It was designed to be used with the (mt) Stats Viewer front end, but may even be more generally useful.

If you want to read more about how it works and some potential problems, there's a surprisingly (to me, at least) long post here.

Get an API key for your MediaTemple server. You'll also need your service ID later, which you can get by visiting https://api.mediatemple.net/api/v1/services/ids.json?apikey=XXXXX (I only have one service ID as I have one server, but apparently you could see more.)

Rename the config file node_modules/mt-stats/config/mt-stats-sample.json to mt-stats.json and change the service ID and API key to match your server and key.

ranges - For each range, the resolution at which to request data from the API (e.g. every 15 seconds) and the maximum span (step) to request in one go (to stop the API server objecting). Range is the maximum timespan at which to use that resolution and step

metrics - Metrics supplied by the API. apiKey is the key name in JSON objects and niceName is the name to use on the graphs

definedRanges - MediaTemple also supports some default intervals that can be requested with these URLs, e.g. this URL will serve up the last 5 minutes' data

currentUrl - API server URL from which to get the current stats. %SERVICEID and %APIKEY are replaced with your service ID and API key

historyUrl - API server URL to request stats going back for the past X seconds, e.g. this URL will also give the past 5 minutes' data

rangeUrl - API server URL to get stats covering a specified time range

MediaTemple may or may not respect the stats resolution you request, e.g. there's a minimum resolution of 15s and a request for 2 hour intervals will be returned at a resolution of 60 minutes.

The API server will also only serve up a fairly small amount of data at a given resolution - smaller than I'd like, so the server divides up the client's range into several requests and combines them before returning. The interval at which to split a single request into multiple API queries is the step if this is less than the range for that range. So if you wanted a week's worth of data at 15 second intervals, you could add {"range": 604800, "resolution": 15, "step": 3600 } (but please don't as you'll hit the API server 168 times!). All numbers are seconds.

The metrics bit of the config file is currently set up to return up to a week's worth of data at once; it will return more, but at a resolution that would hammer the MediaTemple server rather, so please add some more ranges if you want to do that.