Skip to content

Commit

Permalink
Added support for cluster stats
Browse files Browse the repository at this point in the history
Elasticsearch v0.90.8
See elastic/elasticsearch@2b6214c
  • Loading branch information
Fabien Pennequin committed Mar 7, 2014
1 parent e9b773e commit 84521c6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/scala/scalastic/elasticsearch/ClusterAdmin.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package scalastic.elasticsearch

trait ClusterAdmin extends Health with Nodes with State with Metadata {
trait ClusterAdmin extends Health
with Nodes
with State
with Metadata
with ClusterStats {
self: Indexer =>
}

Expand Down Expand Up @@ -98,3 +102,11 @@ trait Metadata {
def metadataFor(index: String, `type`: String) = metadata.index(index).mappings.get(`type`)
def fieldsOf(index: String, `type`: String) = metadataFor(index, `type`).sourceAsMap.get("properties").asInstanceOf[Map[String, Object]]
}

trait ClusterStats {
self: Indexer =>

def clusterStats() = clusterStats_send().actionGet
def clusterStats_send() = clusterStats_prepare().execute
def clusterStats_prepare() = client.admin.cluster.prepareClusterStats
}

0 comments on commit 84521c6

Please sign in to comment.