torquay 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/torquay.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88709e9d278d916435dd21de4ba2dba36dd64dfc
|
4
|
+
data.tar.gz: 66835f365af3b213b40afae5f8e3943ca3d48163
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5806129c18409028c8b4dea666a89a399055e4580a0fb492e76fad0ae4236ea4824653026c8753c3c4024399f1c639b6c5c046a972371732124a7236860e3ccd
|
7
|
+
data.tar.gz: 2929e3f8971ef2dda8b50ad170d75ccf313ec13e49c82ad2cd8bd70e826b431a1519bc5baf6e0a1429d3b1c95fc5c29b0b8cc89f062bdc0d52e9562220c27f86
|
data/lib/torquay.rb
CHANGED
@@ -41,6 +41,14 @@ class Torquay
|
|
41
41
|
@host[:ports] = @container.json["NetworkSettings"]["Ports"]
|
42
42
|
end
|
43
43
|
|
44
|
+
def set_network_delay(ms)
|
45
|
+
@container.exec(['tc', 'qdisc', 'add', 'dev', 'eth0', 'root', 'netem', 'delay', '#{ms}ms'])
|
46
|
+
end
|
47
|
+
|
48
|
+
def remove_network_delay
|
49
|
+
@container.exec(['tc', 'qdisc', 'del', 'dev', 'eth0', 'root', 'netem'])
|
50
|
+
end
|
51
|
+
|
44
52
|
def cleanup
|
45
53
|
if @container
|
46
54
|
@container.stop
|