Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit904e5be

Browse files
kvapkelvich
authored andcommitted
Move Stresseaux to a separate file.
1 parent97c667c commit904e5be

File tree

2 files changed

+48
-21
lines changed

2 files changed

+48
-21
lines changed

‎testeaux/Stresseaux.pm

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
packageStresseaux;
2+
3+
my%running = ();
4+
5+
substart
6+
{
7+
my ($id,$workload,$cluster) =@_;
8+
print("start stress$id: workload$workload, cluster$cluster\n");
9+
10+
if (exists$running{$id})
11+
{
12+
print("cannot start stress$id: that id has already been taken\n");
13+
return 0;
14+
}
15+
16+
# FIXME: implement 'stress'/'workload' objects
17+
$running{$id} = {hello=>'world'};
18+
19+
# FIXME: implement
20+
21+
return 1;
22+
}
23+
24+
substop
25+
{
26+
my$id =shift;
27+
print("stop stress$id\n");
28+
29+
my$stress =delete$running{$id};
30+
31+
if (!defined$stress)
32+
{
33+
print("cannot stop stress$id: that id is not running\n");
34+
return 0;
35+
}
36+
37+
# FIXME: implement
38+
39+
return 1;
40+
}
41+
42+
1;

‎testeaux/Testeaux.pm

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
packageTesteaux;
22

3+
use Stresseaux;
4+
35
packageCombineaux
46
{
57
subcombine
@@ -12,13 +14,13 @@ package Combineaux
1214
{
1315
foreachmy$trouble (@$troubles)
1416
{
15-
print("run workload$workloadduring trouble$trouble\n");
16-
# FIXME: generate properidinstead of 'hello'
17-
Stresseaux::start('hello',$workload,$cluster);
17+
print("---$workloadvs.$trouble ---\n");
18+
my$id="$workload+$trouble";
19+
Stresseaux::start($id,$workload,$cluster) ||die"stress wouldn't start";
1820
sleep(1);# FIXME: will this work?
1921
Troubleaux::cause($cluster,$trouble);
2022
sleep(1);# FIXME: will this work?
21-
Stresseaux::stop('hello');
23+
Stresseaux::stop($id) ||die"stress wouldn't stop";
2224
Troubleaux::fix($cluster);
2325
}
2426
}
@@ -27,23 +29,6 @@ package Combineaux
2729
}
2830
}
2931

30-
packageStresseaux
31-
{
32-
substart
33-
{
34-
my ($id,$workload,$cluster) =@_;
35-
print("start stress$id: workload$workload, cluster$cluster\n");
36-
# fixme: implement
37-
}
38-
39-
substop
40-
{
41-
my$id =shift;
42-
print("stop stress$id\n");
43-
# FIXME: implement
44-
}
45-
}
46-
4732
packageStarteaux
4833
{
4934
subdeploy

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp