(optional) Nit: you could extract this into a function that is called like this:

    appendSample(model.Metric{"name": "my_metric"}, t)