Less compares first the metrics, then the timestamp.
(i, j int)
| 316 | |
| 317 | // Less compares first the metrics, then the timestamp. |
| 318 | func (vec Vector) Less(i, j int) bool { |
| 319 | switch { |
| 320 | case vec[i].Metric.Before(vec[j].Metric): |
| 321 | return true |
| 322 | case vec[j].Metric.Before(vec[i].Metric): |
| 323 | return false |
| 324 | case vec[i].Timestamp.Before(vec[j].Timestamp): |
| 325 | return true |
| 326 | default: |
| 327 | return false |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | // Equal compares two sets of samples and returns true if they are equal. |
| 332 | func (vec Vector) Equal(o Vector) bool { |