Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cerebro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nimrod
cerebro
Commits
50b8ae24
Commit
50b8ae24
authored
9 years ago
by
Leonardo Menezes
Browse files
Options
Downloads
Patches
Plain Diff
added test to GetShardStatsController
parent
e4a0b165
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/GetShardStatsController.scala
+19
-0
19 additions, 0 deletions
app/controllers/GetShardStatsController.scala
conf/routes
+1
-1
1 addition, 1 deletion
conf/routes
test/controllers/GetShardStatsControllerSpec.scala
+1190
-0
1190 additions, 0 deletions
test/controllers/GetShardStatsControllerSpec.scala
with
1210 additions
and
1 deletion
app/controllers/GetShardStats.scala
→
app/controllers/GetShardStats
Controller
.scala
+
19
−
0
View file @
50b8ae24
...
...
@@ -4,13 +4,15 @@ import models.ShardStats
import
scala.concurrent.ExecutionContext.Implicits.global
class
GetShardStats
extends
BaseController
{
class
GetShardStats
Controller
extends
BaseController
{
def
processRequest
=
(
request
,
client
)
=>
{
client
.
getShardStats
(
request
.
get
(
"index"
),
request
.
host
).
zip
(
client
.
getIndexRecovery
(
request
.
get
(
"index"
),
request
.
host
)).
map
{
val
index
=
request
.
get
(
"index"
)
val
shard
=
request
.
getInt
(
"shard"
)
val
node
=
request
.
get
(
"node"
)
client
.
getShardStats
(
index
,
request
.
host
).
zip
(
client
.
getIndexRecovery
(
index
,
request
.
host
)).
map
{
case
(
stats
,
recovery
)
=>
val
shardStats
=
ShardStats
(
request
.
get
(
"index"
),
request
.
get
(
"node"
),
request
.
getInt
(
"shard"
),
stats
.
body
,
recovery
.
body
)
Status
(
200
)(
shardStats
)
Status
(
200
)(
ShardStats
(
index
,
node
,
shard
,
stats
.
body
,
recovery
.
body
))
}
}
...
...
This diff is collapsed.
Click to expand it.
conf/routes
+
1
−
1
View file @
50b8ae24
...
...
@@ -21,7 +21,7 @@ POST /apis/update_cluster_settings @controllers.PutClusterSettings.exe
POST /apis/get_node_stats @controllers.NodeStatsController.execute
POST /apis/disable_shard_allocation @controllers.DisableShardAllocationController.execute
POST /apis/enable_shard_allocation @controllers.EnableShardAllocationController.execute
POST /apis/get_shard_stats @controllers.GetShardStats.execute
POST /apis/get_shard_stats @controllers.GetShardStats
Controller
.execute
GET /apis/hosts @controllers.HostsController.index
...
...
This diff is collapsed.
Click to expand it.
test/controllers/GetShardStatsControllerSpec.scala
0 → 100644
+
1190
−
0
View file @
50b8ae24
package
controllers
import
elastic.
{
ElasticClient
,
ElasticResponse
}
import
exceptions.MissingRequiredParamException
import
models.CerebroRequest
import
org.specs2.Specification
import
org.specs2.mock.Mockito
import
play.api.libs.json.Json
import
play.api.test.FakeApplication
import
play.api.test.Helpers._
import
scala.concurrent.Future
object
GetShardStatsControllerSpec
extends
Specification
with
Mockito
{
def
is
=
s2
"""
GetShardStatsControllerSpec should ${step(play.api.Play.start(FakeApplication()))}
invoke getShardStats and getIndexRecovery $getShardStats
throw exception if index param is missing $missingIndex
throw exception if shard param is missing $missingShard
throw exception if node param is missing $missingNode
"""
val
controller
=
new
GetShardStatsController
def
getShardStats
=
{
val
body
=
Json
.
obj
(
"host"
->
"somehost"
,
"index"
->
"someIndex"
,
"node"
->
"MCGlWc6ERF2N9pO0uh7-tA"
,
"shard"
->
1
)
val
client
=
mock
[
ElasticClient
]
client
.
getShardStats
(
"someIndex"
,
"somehost"
)
returns
Future
.
successful
(
ElasticResponse
(
200
,
expectedStats
))
client
.
getIndexRecovery
(
"someIndex"
,
"somehost"
)
returns
Future
.
successful
(
ElasticResponse
(
200
,
expectedRecovery
))
val
result
=
controller
.
processRequest
(
CerebroRequest
(
body
),
client
)
there
was
one
(
client
).
getShardStats
(
"someIndex"
,
"somehost"
)
there
was
one
(
client
).
getIndexRecovery
(
"someIndex"
,
"somehost"
)
contentAsJson
(
result
)
mustEqual
expectedShardStats
status
(
result
)
mustEqual
200
}
def
missingIndex
=
{
val
body
=
Json
.
obj
(
"host"
->
"somehost"
,
"node"
->
"someNode"
,
"shard"
->
1
)
val
client
=
mock
[
ElasticClient
]
controller
.
processRequest
(
CerebroRequest
(
body
),
client
)
must
throwA
[
MissingRequiredParamException
]
}
def
missingNode
=
{
val
body
=
Json
.
obj
(
"host"
->
"somehost"
,
"index"
->
"someIndex"
,
"shard"
->
1
)
val
client
=
mock
[
ElasticClient
]
controller
.
processRequest
(
CerebroRequest
(
body
),
client
)
must
throwA
[
MissingRequiredParamException
]
}
def
missingShard
=
{
val
body
=
Json
.
obj
(
"host"
->
"somehost"
,
"node"
->
"someNode"
,
"index"
->
"someIndex"
)
val
client
=
mock
[
ElasticClient
]
controller
.
processRequest
(
CerebroRequest
(
body
),
client
)
must
throwA
[
MissingRequiredParamException
]
}
val
expectedShardStats
=
Json
.
parse
(
"""
|{
| "routing": {
| "state": "STARTED",
| "primary": true,
| "node": "MCGlWc6ERF2N9pO0uh7-tA",
| "relocating_node": null
| },
| "docs": {
| "count": 0,
| "deleted": 0
| },
| "store": {
| "size": "130b",
| "size_in_bytes": 130,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "indexing": {
| "index_total": 0,
| "index_time": "0s",
| "index_time_in_millis": 0,
| "index_current": 0,
| "index_failed": 0,
| "delete_total": 0,
| "delete_time": "0s",
| "delete_time_in_millis": 0,
| "delete_current": 0,
| "noop_update_total": 0,
| "is_throttled": false,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "get": {
| "total": 0,
| "get_time": "0s",
| "time_in_millis": 0,
| "exists_total": 0,
| "exists_time": "0s",
| "exists_time_in_millis": 0,
| "missing_total": 0,
| "missing_time": "0s",
| "missing_time_in_millis": 0,
| "current": 0
| },
| "search": {
| "open_contexts": 0,
| "query_total": 0,
| "query_time": "0s",
| "query_time_in_millis": 0,
| "query_current": 0,
| "fetch_total": 0,
| "fetch_time": "0s",
| "fetch_time_in_millis": 0,
| "fetch_current": 0,
| "scroll_total": 0,
| "scroll_time": "0s",
| "scroll_time_in_millis": 0,
| "scroll_current": 0
| },
| "merges": {
| "current": 0,
| "current_docs": 0,
| "current_size": "0b",
| "current_size_in_bytes": 0,
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0,
| "total_docs": 0,
| "total_size": "0b",
| "total_size_in_bytes": 0,
| "total_stopped_time": "0s",
| "total_stopped_time_in_millis": 0,
| "total_throttled_time": "0s",
| "total_throttled_time_in_millis": 0,
| "total_auto_throttle": "20mb",
| "total_auto_throttle_in_bytes": 20971520
| },
| "refresh": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "flush": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "warmer": {
| "current": 0,
| "total": 2,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "query_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "total_count": 0,
| "hit_count": 0,
| "miss_count": 0,
| "cache_size": 0,
| "cache_count": 0,
| "evictions": 0
| },
| "fielddata": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0
| },
| "percolate": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0,
| "memory_size_in_bytes": -1,
| "memory_size": "-1b",
| "queries": 0
| },
| "completion": {
| "size": "0b",
| "size_in_bytes": 0
| },
| "segments": {
| "count": 0,
| "memory": "0b",
| "memory_in_bytes": 0,
| "terms_memory": "0b",
| "terms_memory_in_bytes": 0,
| "stored_fields_memory": "0b",
| "stored_fields_memory_in_bytes": 0,
| "term_vectors_memory": "0b",
| "term_vectors_memory_in_bytes": 0,
| "norms_memory": "0b",
| "norms_memory_in_bytes": 0,
| "doc_values_memory": "0b",
| "doc_values_memory_in_bytes": 0,
| "index_writer_memory": "0b",
| "index_writer_memory_in_bytes": 0,
| "index_writer_max_memory": "19.7mb",
| "index_writer_max_memory_in_bytes": 20759183,
| "version_map_memory": "0b",
| "version_map_memory_in_bytes": 0,
| "fixed_bit_set": "0b",
| "fixed_bit_set_memory_in_bytes": 0
| },
| "translog": {
| "operations": 0,
| "size": "43b",
| "size_in_bytes": 43
| },
| "suggest": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0
| },
| "request_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0,
| "hit_count": 0,
| "miss_count": 0
| },
| "recovery": {
| "current_as_source": 0,
| "current_as_target": 0,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "commit": {
| "id": "0KEgzr3H8IYfFwjGYMMyuA==",
| "generation": 1,
| "user_data": {
| "translog_generation": "1",
| "translog_uuid": "82KA20bLQNOpsghTmrdnyA"
| },
| "num_docs": 0
| },
| "shard_path": {
| "state_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "data_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "is_custom_data_path": false
| }
|}
"""
.
stripMargin
)
val
expectedStats
=
Json
.
parse
(
"""
|{
| "_shards": {
| "total": 10,
| "successful": 5,
| "failed": 0
| },
| "indices": {
| "someIndex": {
| "shards": {
| "0": [
| {
| "routing": {
| "state": "STARTED",
| "primary": true,
| "node": "MCGlWc6ERF2N9pO0uh7-tA",
| "relocating_node": null
| },
| "docs": {
| "count": 0,
| "deleted": 0
| },
| "store": {
| "size": "130b",
| "size_in_bytes": 130,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "indexing": {
| "index_total": 0,
| "index_time": "0s",
| "index_time_in_millis": 0,
| "index_current": 0,
| "index_failed": 0,
| "delete_total": 0,
| "delete_time": "0s",
| "delete_time_in_millis": 0,
| "delete_current": 0,
| "noop_update_total": 0,
| "is_throttled": false,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "get": {
| "total": 0,
| "get_time": "0s",
| "time_in_millis": 0,
| "exists_total": 0,
| "exists_time": "0s",
| "exists_time_in_millis": 0,
| "missing_total": 0,
| "missing_time": "0s",
| "missing_time_in_millis": 0,
| "current": 0
| },
| "search": {
| "open_contexts": 0,
| "query_total": 0,
| "query_time": "0s",
| "query_time_in_millis": 0,
| "query_current": 0,
| "fetch_total": 0,
| "fetch_time": "0s",
| "fetch_time_in_millis": 0,
| "fetch_current": 0,
| "scroll_total": 0,
| "scroll_time": "0s",
| "scroll_time_in_millis": 0,
| "scroll_current": 0
| },
| "merges": {
| "current": 0,
| "current_docs": 0,
| "current_size": "0b",
| "current_size_in_bytes": 0,
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0,
| "total_docs": 0,
| "total_size": "0b",
| "total_size_in_bytes": 0,
| "total_stopped_time": "0s",
| "total_stopped_time_in_millis": 0,
| "total_throttled_time": "0s",
| "total_throttled_time_in_millis": 0,
| "total_auto_throttle": "20mb",
| "total_auto_throttle_in_bytes": 20971520
| },
| "refresh": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "flush": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "warmer": {
| "current": 0,
| "total": 2,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "query_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "total_count": 0,
| "hit_count": 0,
| "miss_count": 0,
| "cache_size": 0,
| "cache_count": 0,
| "evictions": 0
| },
| "fielddata": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0
| },
| "percolate": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0,
| "memory_size_in_bytes": -1,
| "memory_size": "-1b",
| "queries": 0
| },
| "completion": {
| "size": "0b",
| "size_in_bytes": 0
| },
| "segments": {
| "count": 0,
| "memory": "0b",
| "memory_in_bytes": 0,
| "terms_memory": "0b",
| "terms_memory_in_bytes": 0,
| "stored_fields_memory": "0b",
| "stored_fields_memory_in_bytes": 0,
| "term_vectors_memory": "0b",
| "term_vectors_memory_in_bytes": 0,
| "norms_memory": "0b",
| "norms_memory_in_bytes": 0,
| "doc_values_memory": "0b",
| "doc_values_memory_in_bytes": 0,
| "index_writer_memory": "0b",
| "index_writer_memory_in_bytes": 0,
| "index_writer_max_memory": "19.7mb",
| "index_writer_max_memory_in_bytes": 20759183,
| "version_map_memory": "0b",
| "version_map_memory_in_bytes": 0,
| "fixed_bit_set": "0b",
| "fixed_bit_set_memory_in_bytes": 0
| },
| "translog": {
| "operations": 0,
| "size": "43b",
| "size_in_bytes": 43
| },
| "suggest": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0
| },
| "request_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0,
| "hit_count": 0,
| "miss_count": 0
| },
| "recovery": {
| "current_as_source": 0,
| "current_as_target": 0,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "commit": {
| "id": "0KEgzr3H8IYfFwjGYMMyug==",
| "generation": 1,
| "user_data": {
| "translog_generation": "1",
| "translog_uuid": "TErnWxXURCG5bgwnpY7Msw"
| },
| "num_docs": 0
| },
| "shard_path": {
| "state_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "data_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "is_custom_data_path": false
| }
| }
| ],
| "1": [
| {
| "routing": {
| "state": "STARTED",
| "primary": true,
| "node": "MCGlWc6ERF2N9pO0uh7-tA",
| "relocating_node": null
| },
| "docs": {
| "count": 0,
| "deleted": 0
| },
| "store": {
| "size": "130b",
| "size_in_bytes": 130,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "indexing": {
| "index_total": 0,
| "index_time": "0s",
| "index_time_in_millis": 0,
| "index_current": 0,
| "index_failed": 0,
| "delete_total": 0,
| "delete_time": "0s",
| "delete_time_in_millis": 0,
| "delete_current": 0,
| "noop_update_total": 0,
| "is_throttled": false,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "get": {
| "total": 0,
| "get_time": "0s",
| "time_in_millis": 0,
| "exists_total": 0,
| "exists_time": "0s",
| "exists_time_in_millis": 0,
| "missing_total": 0,
| "missing_time": "0s",
| "missing_time_in_millis": 0,
| "current": 0
| },
| "search": {
| "open_contexts": 0,
| "query_total": 0,
| "query_time": "0s",
| "query_time_in_millis": 0,
| "query_current": 0,
| "fetch_total": 0,
| "fetch_time": "0s",
| "fetch_time_in_millis": 0,
| "fetch_current": 0,
| "scroll_total": 0,
| "scroll_time": "0s",
| "scroll_time_in_millis": 0,
| "scroll_current": 0
| },
| "merges": {
| "current": 0,
| "current_docs": 0,
| "current_size": "0b",
| "current_size_in_bytes": 0,
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0,
| "total_docs": 0,
| "total_size": "0b",
| "total_size_in_bytes": 0,
| "total_stopped_time": "0s",
| "total_stopped_time_in_millis": 0,
| "total_throttled_time": "0s",
| "total_throttled_time_in_millis": 0,
| "total_auto_throttle": "20mb",
| "total_auto_throttle_in_bytes": 20971520
| },
| "refresh": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "flush": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "warmer": {
| "current": 0,
| "total": 2,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "query_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "total_count": 0,
| "hit_count": 0,
| "miss_count": 0,
| "cache_size": 0,
| "cache_count": 0,
| "evictions": 0
| },
| "fielddata": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0
| },
| "percolate": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0,
| "memory_size_in_bytes": -1,
| "memory_size": "-1b",
| "queries": 0
| },
| "completion": {
| "size": "0b",
| "size_in_bytes": 0
| },
| "segments": {
| "count": 0,
| "memory": "0b",
| "memory_in_bytes": 0,
| "terms_memory": "0b",
| "terms_memory_in_bytes": 0,
| "stored_fields_memory": "0b",
| "stored_fields_memory_in_bytes": 0,
| "term_vectors_memory": "0b",
| "term_vectors_memory_in_bytes": 0,
| "norms_memory": "0b",
| "norms_memory_in_bytes": 0,
| "doc_values_memory": "0b",
| "doc_values_memory_in_bytes": 0,
| "index_writer_memory": "0b",
| "index_writer_memory_in_bytes": 0,
| "index_writer_max_memory": "19.7mb",
| "index_writer_max_memory_in_bytes": 20759183,
| "version_map_memory": "0b",
| "version_map_memory_in_bytes": 0,
| "fixed_bit_set": "0b",
| "fixed_bit_set_memory_in_bytes": 0
| },
| "translog": {
| "operations": 0,
| "size": "43b",
| "size_in_bytes": 43
| },
| "suggest": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0
| },
| "request_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0,
| "hit_count": 0,
| "miss_count": 0
| },
| "recovery": {
| "current_as_source": 0,
| "current_as_target": 0,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "commit": {
| "id": "0KEgzr3H8IYfFwjGYMMyuA==",
| "generation": 1,
| "user_data": {
| "translog_generation": "1",
| "translog_uuid": "82KA20bLQNOpsghTmrdnyA"
| },
| "num_docs": 0
| },
| "shard_path": {
| "state_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "data_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "is_custom_data_path": false
| }
| }
| ],
| "2": [
| {
| "routing": {
| "state": "STARTED",
| "primary": true,
| "node": "MCGlWc6ERF2N9pO0uh7-tA",
| "relocating_node": null
| },
| "docs": {
| "count": 1,
| "deleted": 0
| },
| "store": {
| "size": "3kb",
| "size_in_bytes": 3076,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "indexing": {
| "index_total": 1,
| "index_time": "4ms",
| "index_time_in_millis": 4,
| "index_current": 0,
| "index_failed": 0,
| "delete_total": 0,
| "delete_time": "0s",
| "delete_time_in_millis": 0,
| "delete_current": 0,
| "noop_update_total": 0,
| "is_throttled": false,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "get": {
| "total": 0,
| "get_time": "0s",
| "time_in_millis": 0,
| "exists_total": 0,
| "exists_time": "0s",
| "exists_time_in_millis": 0,
| "missing_total": 0,
| "missing_time": "0s",
| "missing_time_in_millis": 0,
| "current": 0
| },
| "search": {
| "open_contexts": 0,
| "query_total": 0,
| "query_time": "0s",
| "query_time_in_millis": 0,
| "query_current": 0,
| "fetch_total": 0,
| "fetch_time": "0s",
| "fetch_time_in_millis": 0,
| "fetch_current": 0,
| "scroll_total": 0,
| "scroll_time": "0s",
| "scroll_time_in_millis": 0,
| "scroll_current": 0
| },
| "merges": {
| "current": 0,
| "current_docs": 0,
| "current_size": "0b",
| "current_size_in_bytes": 0,
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0,
| "total_docs": 0,
| "total_size": "0b",
| "total_size_in_bytes": 0,
| "total_stopped_time": "0s",
| "total_stopped_time_in_millis": 0,
| "total_throttled_time": "0s",
| "total_throttled_time_in_millis": 0,
| "total_auto_throttle": "20mb",
| "total_auto_throttle_in_bytes": 20971520
| },
| "refresh": {
| "total": 1,
| "total_time": "19ms",
| "total_time_in_millis": 19
| },
| "flush": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "warmer": {
| "current": 0,
| "total": 4,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "query_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "total_count": 0,
| "hit_count": 0,
| "miss_count": 0,
| "cache_size": 0,
| "cache_count": 0,
| "evictions": 0
| },
| "fielddata": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0
| },
| "percolate": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0,
| "memory_size_in_bytes": -1,
| "memory_size": "-1b",
| "queries": 0
| },
| "completion": {
| "size": "0b",
| "size_in_bytes": 0
| },
| "segments": {
| "count": 1,
| "memory": "1.6kb",
| "memory_in_bytes": 1737,
| "terms_memory": "1.2kb",
| "terms_memory_in_bytes": 1269,
| "stored_fields_memory": "312b",
| "stored_fields_memory_in_bytes": 312,
| "term_vectors_memory": "0b",
| "term_vectors_memory_in_bytes": 0,
| "norms_memory": "64b",
| "norms_memory_in_bytes": 64,
| "doc_values_memory": "92b",
| "doc_values_memory_in_bytes": 92,
| "index_writer_memory": "0b",
| "index_writer_memory_in_bytes": 0,
| "index_writer_max_memory": "19.7mb",
| "index_writer_max_memory_in_bytes": 20759183,
| "version_map_memory": "0b",
| "version_map_memory_in_bytes": 0,
| "fixed_bit_set": "0b",
| "fixed_bit_set_memory_in_bytes": 0
| },
| "translog": {
| "operations": 1,
| "size": "100b",
| "size_in_bytes": 100
| },
| "suggest": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0
| },
| "request_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0,
| "hit_count": 0,
| "miss_count": 0
| },
| "recovery": {
| "current_as_source": 0,
| "current_as_target": 0,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "commit": {
| "id": "0KEgzr3H8IYfFwjGYMMytw==",
| "generation": 1,
| "user_data": {
| "translog_generation": "1",
| "translog_uuid": "ANcmWOkGQ165AT0H7mz3JQ"
| },
| "num_docs": 0
| },
| "shard_path": {
| "state_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "data_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "is_custom_data_path": false
| }
| }
| ],
| "3": [
| {
| "routing": {
| "state": "STARTED",
| "primary": true,
| "node": "MCGlWc6ERF2N9pO0uh7-tA",
| "relocating_node": null
| },
| "docs": {
| "count": 1,
| "deleted": 0
| },
| "store": {
| "size": "3kb",
| "size_in_bytes": 3076,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "indexing": {
| "index_total": 1,
| "index_time": "70ms",
| "index_time_in_millis": 70,
| "index_current": 0,
| "index_failed": 0,
| "delete_total": 0,
| "delete_time": "0s",
| "delete_time_in_millis": 0,
| "delete_current": 0,
| "noop_update_total": 0,
| "is_throttled": false,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "get": {
| "total": 0,
| "get_time": "0s",
| "time_in_millis": 0,
| "exists_total": 0,
| "exists_time": "0s",
| "exists_time_in_millis": 0,
| "missing_total": 0,
| "missing_time": "0s",
| "missing_time_in_millis": 0,
| "current": 0
| },
| "search": {
| "open_contexts": 0,
| "query_total": 0,
| "query_time": "0s",
| "query_time_in_millis": 0,
| "query_current": 0,
| "fetch_total": 0,
| "fetch_time": "0s",
| "fetch_time_in_millis": 0,
| "fetch_current": 0,
| "scroll_total": 0,
| "scroll_time": "0s",
| "scroll_time_in_millis": 0,
| "scroll_current": 0
| },
| "merges": {
| "current": 0,
| "current_docs": 0,
| "current_size": "0b",
| "current_size_in_bytes": 0,
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0,
| "total_docs": 0,
| "total_size": "0b",
| "total_size_in_bytes": 0,
| "total_stopped_time": "0s",
| "total_stopped_time_in_millis": 0,
| "total_throttled_time": "0s",
| "total_throttled_time_in_millis": 0,
| "total_auto_throttle": "20mb",
| "total_auto_throttle_in_bytes": 20971520
| },
| "refresh": {
| "total": 1,
| "total_time": "80ms",
| "total_time_in_millis": 80
| },
| "flush": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "warmer": {
| "current": 0,
| "total": 4,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "query_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "total_count": 0,
| "hit_count": 0,
| "miss_count": 0,
| "cache_size": 0,
| "cache_count": 0,
| "evictions": 0
| },
| "fielddata": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0
| },
| "percolate": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0,
| "memory_size_in_bytes": -1,
| "memory_size": "-1b",
| "queries": 0
| },
| "completion": {
| "size": "0b",
| "size_in_bytes": 0
| },
| "segments": {
| "count": 1,
| "memory": "1.6kb",
| "memory_in_bytes": 1737,
| "terms_memory": "1.2kb",
| "terms_memory_in_bytes": 1269,
| "stored_fields_memory": "312b",
| "stored_fields_memory_in_bytes": 312,
| "term_vectors_memory": "0b",
| "term_vectors_memory_in_bytes": 0,
| "norms_memory": "64b",
| "norms_memory_in_bytes": 64,
| "doc_values_memory": "92b",
| "doc_values_memory_in_bytes": 92,
| "index_writer_memory": "0b",
| "index_writer_memory_in_bytes": 0,
| "index_writer_max_memory": "19.7mb",
| "index_writer_max_memory_in_bytes": 20759183,
| "version_map_memory": "0b",
| "version_map_memory_in_bytes": 0,
| "fixed_bit_set": "0b",
| "fixed_bit_set_memory_in_bytes": 0
| },
| "translog": {
| "operations": 1,
| "size": "100b",
| "size_in_bytes": 100
| },
| "suggest": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0
| },
| "request_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0,
| "hit_count": 0,
| "miss_count": 0
| },
| "recovery": {
| "current_as_source": 0,
| "current_as_target": 0,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "commit": {
| "id": "0KEgzr3H8IYfFwjGYMMyuQ==",
| "generation": 1,
| "user_data": {
| "translog_generation": "1",
| "translog_uuid": "gydasAvsTN2RrsxbtrGV9w"
| },
| "num_docs": 0
| },
| "shard_path": {
| "state_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "data_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "is_custom_data_path": false
| }
| }
| ],
| "4": [
| {
| "routing": {
| "state": "STARTED",
| "primary": true,
| "node": "MCGlWc6ERF2N9pO0uh7-tA",
| "relocating_node": null
| },
| "docs": {
| "count": 0,
| "deleted": 0
| },
| "store": {
| "size": "130b",
| "size_in_bytes": 130,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "indexing": {
| "index_total": 0,
| "index_time": "0s",
| "index_time_in_millis": 0,
| "index_current": 0,
| "index_failed": 0,
| "delete_total": 0,
| "delete_time": "0s",
| "delete_time_in_millis": 0,
| "delete_current": 0,
| "noop_update_total": 0,
| "is_throttled": false,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "get": {
| "total": 0,
| "get_time": "0s",
| "time_in_millis": 0,
| "exists_total": 0,
| "exists_time": "0s",
| "exists_time_in_millis": 0,
| "missing_total": 0,
| "missing_time": "0s",
| "missing_time_in_millis": 0,
| "current": 0
| },
| "search": {
| "open_contexts": 0,
| "query_total": 0,
| "query_time": "0s",
| "query_time_in_millis": 0,
| "query_current": 0,
| "fetch_total": 0,
| "fetch_time": "0s",
| "fetch_time_in_millis": 0,
| "fetch_current": 0,
| "scroll_total": 0,
| "scroll_time": "0s",
| "scroll_time_in_millis": 0,
| "scroll_current": 0
| },
| "merges": {
| "current": 0,
| "current_docs": 0,
| "current_size": "0b",
| "current_size_in_bytes": 0,
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0,
| "total_docs": 0,
| "total_size": "0b",
| "total_size_in_bytes": 0,
| "total_stopped_time": "0s",
| "total_stopped_time_in_millis": 0,
| "total_throttled_time": "0s",
| "total_throttled_time_in_millis": 0,
| "total_auto_throttle": "20mb",
| "total_auto_throttle_in_bytes": 20971520
| },
| "refresh": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "flush": {
| "total": 0,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "warmer": {
| "current": 0,
| "total": 2,
| "total_time": "0s",
| "total_time_in_millis": 0
| },
| "query_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "total_count": 0,
| "hit_count": 0,
| "miss_count": 0,
| "cache_size": 0,
| "cache_count": 0,
| "evictions": 0
| },
| "fielddata": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0
| },
| "percolate": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0,
| "memory_size_in_bytes": -1,
| "memory_size": "-1b",
| "queries": 0
| },
| "completion": {
| "size": "0b",
| "size_in_bytes": 0
| },
| "segments": {
| "count": 0,
| "memory": "0b",
| "memory_in_bytes": 0,
| "terms_memory": "0b",
| "terms_memory_in_bytes": 0,
| "stored_fields_memory": "0b",
| "stored_fields_memory_in_bytes": 0,
| "term_vectors_memory": "0b",
| "term_vectors_memory_in_bytes": 0,
| "norms_memory": "0b",
| "norms_memory_in_bytes": 0,
| "doc_values_memory": "0b",
| "doc_values_memory_in_bytes": 0,
| "index_writer_memory": "0b",
| "index_writer_memory_in_bytes": 0,
| "index_writer_max_memory": "19.7mb",
| "index_writer_max_memory_in_bytes": 20759183,
| "version_map_memory": "0b",
| "version_map_memory_in_bytes": 0,
| "fixed_bit_set": "0b",
| "fixed_bit_set_memory_in_bytes": 0
| },
| "translog": {
| "operations": 0,
| "size": "43b",
| "size_in_bytes": 43
| },
| "suggest": {
| "total": 0,
| "time": "0s",
| "time_in_millis": 0,
| "current": 0
| },
| "request_cache": {
| "memory_size": "0b",
| "memory_size_in_bytes": 0,
| "evictions": 0,
| "hit_count": 0,
| "miss_count": 0
| },
| "recovery": {
| "current_as_source": 0,
| "current_as_target": 0,
| "throttle_time": "0s",
| "throttle_time_in_millis": 0
| },
| "commit": {
| "id": "0KEgzr3H8IYfFwjGYMMyuw==",
| "generation": 1,
| "user_data": {
| "translog_generation": "1",
| "translog_uuid": "RBwchy8ITGe4TIpAmvCzkw"
| },
| "num_docs": 0
| },
| "shard_path": {
| "state_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "data_path": "/Users/leonardo.menezes/Downloads/elasticsearch-2.3.0/data/elasticsearch/nodes/0",
| "is_custom_data_path": false
| }
| }
| ]
| }
| }
| }
|}
"""
.
stripMargin
)
val
expectedRecovery
=
Json
.
obj
()
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment