Less compares first the metrics, then the timestamp.
(i, j int)
| 295 | |
| 296 | // Less compares first the metrics, then the timestamp. |
| 297 | func (vec Vector) Less(i, j int) bool { |
| 298 | switch { |
| 299 | case vec[i].Metric.Before(vec[j].Metric): |
| 300 | return true |
| 301 | case vec[j].Metric.Before(vec[i].Metric): |
| 302 | return false |
| 303 | case vec[i].Timestamp.Before(vec[j].Timestamp): |
| 304 | return true |
| 305 | default: |
| 306 | return false |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | // Equal compares two sets of samples and returns true if they are equal. |
| 311 | func (vec Vector) Equal(o Vector) bool { |