pid_controller 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +11 -5
- data/lib/pid_controller.rb +1 -1
- data/lib/pid_controller/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64ecc7bf7935e8cc32a7a406336901a92604aebc
|
4
|
+
data.tar.gz: c49271b98e1befb819efccc1a7e90d6b8b48cb4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fac26433f749c99c20233fafb6d865a7e43a4446bbbf18e8842d2d874816a2dc0e2682fc03a0325a5f335cfe3896d33d4b8f5d3b433057eb73fd396af2469e2
|
7
|
+
data.tar.gz: 346311b9cbe34e75e2e992ffa3eae936bca68b0c9d05cc23102dd3147c8156e92081621e7a94689c465ffa24606a97e01be2b597e6531bd4ade242f907b19c3c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# PidController
|
2
|
+
|
2
3
|
[![Gem Version](https://badge.fury.io/rb/pid_controller.svg)](https://badge.fury.io/rb/pid_controller)
|
3
4
|
[![Build Status](https://travis-ci.org/gabetax/pid_controller.svg?branch=master)](https://travis-ci.org/gabetax/pid_controller)
|
4
5
|
|
@@ -15,11 +16,18 @@ I mentioned databases, so here's an example of how we can prevent a low priority
|
|
15
16
|
|
16
17
|
```ruby
|
17
18
|
sensor = MySQLSensor.new # Use your imagination
|
18
|
-
controller = PIDController.new(
|
19
|
+
controller = PIDController.new(
|
20
|
+
setpoint: 60.0,
|
21
|
+
kp: 5.0,
|
22
|
+
ki: 1.0,
|
23
|
+
kd: 0.1,
|
24
|
+
output_max: 0.0,
|
25
|
+
integral_max: 0.0
|
26
|
+
)
|
19
27
|
|
20
28
|
Event.where(account_id: account_id).in_batches do |relation|
|
21
29
|
relation.delete_all
|
22
|
-
backoff = controller << sensor.cpu_utilization
|
30
|
+
backoff = -1 * controller << sensor.cpu_utilization
|
23
31
|
sleep backoff if backoff > 0
|
24
32
|
end
|
25
33
|
```
|
@@ -28,8 +36,6 @@ end
|
|
28
36
|
|
29
37
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
38
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
39
|
## Contributing
|
34
40
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/gabetax/pid_controller
|
41
|
+
Bug reports and pull requests are welcome on GitHub at <https://github.com/gabetax/pid_controller.>
|
data/lib/pid_controller.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pid_controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabe Martin-Dempesy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|