Created
September 7, 2012 10:27
-
-
Save jprante/3664968 to your computer and use it in GitHub Desktop.
accessing node stats
This file contains hidden or 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
package myPluginPackage; | |
import org.elasticsearch.common.component.AbstractComponent; | |
import org.elasticsearch.common.inject.Inject; | |
import org.elasticsearch.node.service.NodeService; | |
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats; | |
public class MyClassInAPlugin extends AbstractComponent { | |
private final NodeService nodeService; | |
@Inject | |
public MyClassInAPlugin(Settings settings, NodeService nodeService) { | |
super(settings); | |
this.nodeService = nodeService; | |
} | |
public void myMethod() { | |
NodeStats nodeStats = nodeService.stats(); | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment