Skip to content

Commit

Permalink
Sort rrd lookup results
Browse files Browse the repository at this point in the history
* src/lib/rrd.lua: Sort the results so that the most precise info is
  first.
  • Loading branch information
wingo committed Jun 18, 2018
1 parent 2e95609 commit 6530a0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/rrd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ function ref(rrd, t)
end
end
end
for name,source in pairs(ret) do
for cf,readings in pairs(source.cf) do
table.sort(readings, function(a,b) return a.interval<b.interval end)
end
end
return ret
end

Expand Down

0 comments on commit 6530a0d

Please sign in to comment.