Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postprocessing data read enhancements #376

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/models/kairos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def self.query params
rollup_value = params[:rollup].to_i
rollup_unit = Kairos.get_timespan( params[:rollup].gsub(rollup_value.to_s,'') )

limit = params[:limit]&.to_i

device = Device.find(params[:id])

if sensor_key = params[:sensor_key]
Expand All @@ -26,6 +28,7 @@ def self.query params

component = device.find_component_by_sensor_id(sensor_id)


unless component
return {
device_id: params[:id],
Expand All @@ -44,6 +47,7 @@ def self.query params
metrics = [{
tags: { device_id: params[:id] },
name: sensor_key,
limit: limit,
aggregators: [
{
name: function,
Expand All @@ -54,7 +58,7 @@ def self.query params
}
}
]
}]
}.compact]

data = { metrics: metrics, cache_time: 0 }

Expand Down
1 change: 0 additions & 1 deletion spec/requests/v0/password_resets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
it "can reset password with valid token" do
expect(user.authenticate('newpass')).to be_falsey
j = api_put "password_resets/#{user.password_reset_token}", { password: 'newpass' }
p response
expect(j["username"]).to eq(user.username)
expect(response.status).to eq(200)

Expand Down
Loading