This repository has been archived by the owner on Jan 15, 2020. It is now read-only.
forked from aionnetwork/aion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master-pre-merge' into mongo
- Loading branch information
Showing
23 changed files
with
1,055 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
modAionImpl/src/org/aion/zero/impl/sync/RequestCounter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright (c) 2017-2018 Aion foundation. | ||
* | ||
* This file is part of the aion network project. | ||
* | ||
* The aion network project is free software: you can redistribute it | ||
* and/or modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation, either version 3 of | ||
* the License, or any later version. | ||
* | ||
* The aion network project is distributed in the hope that it will | ||
* be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with the aion network project source files. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* Contributors: | ||
* Aion foundation. | ||
*/ | ||
|
||
package org.aion.zero.impl.sync; | ||
|
||
/** | ||
* Used for tracking different types of requests made to peers. | ||
* | ||
* @author Alexandra Roatis | ||
*/ | ||
public class RequestCounter { | ||
|
||
private long status = 0; | ||
private long headers = 0; | ||
private long bodies = 0; | ||
private long total = 0; | ||
|
||
public RequestCounter() {} | ||
|
||
public long getStatus() { | ||
return status; | ||
} | ||
|
||
public long getHeaders() { | ||
return headers; | ||
} | ||
|
||
public long getBodies() { | ||
return bodies; | ||
} | ||
|
||
public long getTotal() { | ||
return total; | ||
} | ||
|
||
public void incStatus() { | ||
this.status++; | ||
this.total++; | ||
} | ||
|
||
public void incHeaders() { | ||
this.headers++; | ||
this.total++; | ||
} | ||
|
||
public void incBodies() { | ||
this.bodies++; | ||
this.total++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2017-2018 Aion foundation. | ||
* | ||
* This file is part of the aion network project. | ||
* | ||
* The aion network project is free software: you can redistribute it | ||
* and/or modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation, either version 3 of | ||
* the License, or any later version. | ||
* | ||
* The aion network project is distributed in the hope that it will | ||
* be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with the aion network project source files. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* Contributors: | ||
* Aion foundation. | ||
*/ | ||
|
||
package org.aion.zero.impl.sync; | ||
|
||
/** | ||
* Used for tracking different types of requests made to peers. | ||
* | ||
* @author Alexandra Roatis | ||
*/ | ||
public enum RequestType { | ||
STATUS, | ||
HEADERS, | ||
BODIES | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.