Skip to content

Commit

Permalink
move task example
Browse files Browse the repository at this point in the history
  • Loading branch information
myzhan committed Dec 10, 2018
1 parent c200ca8 commit cb592fa
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Add this to your Maven project's pom.xml.

## More Examples

See [Main.java](examples/Main.java).
See [Main.java](examples/task/Main.java).

This file represents all the exposed APIs of Locust4j.

Expand Down
9 changes: 9 additions & 0 deletions examples/Main.java → examples/task/Main.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
package task;

import com.github.myzhan.locust4j.Locust;

/**
* It's a example about using locust4j's API.
* It's also very handy when you are writing codes for locust4j, and want to test.
*
* @author myzhan
* @date 2017/11/28
*/
public class Main {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
package task;

import com.github.myzhan.locust4j.Locust;
import com.github.myzhan.locust4j.AbstractTask;

/**
* This task does nothing but sleep for 1 second, then report failure.
*
* @author myzhan
* @date 2017/11/28
*/
public class TaskAlwaysFail extends AbstractTask {

public int weight = 10;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
package task;

import com.github.myzhan.locust4j.Locust;
import com.github.myzhan.locust4j.AbstractTask;

/**
* This task does nothing but sleep for 100 milliseconds, then report success.
*
* @author myzhan
* @date 2017/11/28
*/
public class TaskAlwaysSuccess extends AbstractTask {

public int weight = 20;
Expand Down

0 comments on commit cb592fa

Please sign in to comment.