Skip to content

Commit

Permalink
Merge pull request #20233 from agrare/fix_rollup_spec_fp_precision
Browse files Browse the repository at this point in the history
Fix metrics rollup floating point precision error
  • Loading branch information
gtanzillo authored Jun 2, 2020
2 parents 1d937fe + 9e591b5 commit f6b999a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/models/metric/ci_mixin/rollup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,14 @@
expect(perfs[0].sys_uptime_absolute_latest).to eq(3.0) # pulled from Host realtime
expect(perfs[0].derived_cpu_available).to eq(19_152)

expect(perfs[2].cpu_usage_rate_average).to eq(12.0) # pulled from Host realtime
expect(perfs[2].cpu_usagemhz_rate_average).to eq(24.0) # pulled from Host realtime
expect(perfs[2].sys_uptime_absolute_latest).to eq(16.0) # pulled from Host realtime
expect(perfs[2].cpu_usage_rate_average).to be_within(0.001).of(12.0) # pulled from Host realtime
expect(perfs[2].cpu_usagemhz_rate_average).to be_within(0.001).of(24.0) # pulled from Host realtime
expect(perfs[2].sys_uptime_absolute_latest).to be_within(0.001).of(16.0) # pulled from Host realtime
expect(perfs[2].derived_cpu_available).to eq(19_152)

expect(perfs[3].cpu_usage_rate_average).to eq(24.0) # pulled from Host realtime
expect(perfs[3].cpu_usagemhz_rate_average).to eq(48.0) # pulled from Host realtime
expect(perfs[3].sys_uptime_absolute_latest).to eq(32.0) # pulled from Host realtime
expect(perfs[3].cpu_usage_rate_average).to be_within(0.001).of(24.0) # pulled from Host realtime
expect(perfs[3].cpu_usagemhz_rate_average).to be_within(0.001).of(48.0) # pulled from Host realtime
expect(perfs[3].sys_uptime_absolute_latest).to be_within(0.001).of(32.0) # pulled from Host realtime
expect(perfs[3].derived_cpu_available).to eq(19_152)
end
end
Expand Down

0 comments on commit f6b999a

Please sign in to comment.