-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'desyncr-thread-diagnostics-cpu' into next
- Loading branch information
Showing
10 changed files
with
515 additions
and
13 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
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
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
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,46 @@ | ||
/* This code is part of Freenet. It is distributed under the GNU General | ||
* Public License, version 2 (or at your option any later version). See | ||
* http://www.gnu.org/ for further details of the GPL. */ | ||
package freenet.node.diagnostics; | ||
|
||
import freenet.node.diagnostics.threads.*; | ||
import freenet.support.Ticker; | ||
import freenet.node.NodeStats; | ||
|
||
/** | ||
* @author desyncr | ||
* | ||
* A class to retrieve data to build diagnostic dumps to help in determining | ||
* node bottlenecks or misconfiguration. | ||
* | ||
* This class launches various threads at intervals to retrieve information. This information | ||
* is available through the public methods. | ||
* Some data pointers are obtained from NodeStats object. | ||
*/ | ||
public class DefaultNodeDiagnostics implements NodeDiagnostics { | ||
private final DefaultThreadDiagnostics defaultThreadDiagnostics; | ||
|
||
/** | ||
* @param nodeStats Used to retrieve data points. | ||
* @param ticker Used to queue timed jobs. | ||
*/ | ||
public DefaultNodeDiagnostics(NodeStats nodeStats, Ticker ticker) { | ||
defaultThreadDiagnostics = new DefaultThreadDiagnostics(nodeStats, ticker); | ||
} | ||
|
||
public void start() { | ||
defaultThreadDiagnostics.start(); | ||
} | ||
|
||
public void stop() { | ||
defaultThreadDiagnostics.stop(); | ||
} | ||
|
||
/** | ||
* @return List of threads registered in NodeStats.getThreads() | ||
*/ | ||
@Override | ||
public ThreadDiagnostics getThreadDiagnostics() { | ||
return defaultThreadDiagnostics; | ||
} | ||
} |
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,10 @@ | ||
/* This code is part of Freenet. It is distributed under the GNU General | ||
* Public License, version 2 (or at your option any later version). See | ||
* http://www.gnu.org/ for further details of the GPL. */ | ||
package freenet.node.diagnostics; | ||
|
||
import freenet.node.diagnostics.threads.*; | ||
|
||
public interface NodeDiagnostics { | ||
ThreadDiagnostics getThreadDiagnostics(); | ||
} |
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,10 @@ | ||
/* This code is part of Freenet. It is distributed under the GNU General | ||
* Public License, version 2 (or at your option any later version). See | ||
* http://www.gnu.org/ for further details of the GPL. */ | ||
package freenet.node.diagnostics; | ||
|
||
import freenet.node.diagnostics.threads.*; | ||
|
||
public interface ThreadDiagnostics { | ||
NodeThreadSnapshot getThreadSnapshot(); | ||
} |
Oops, something went wrong.