Skip to content

Commit

Permalink
Add indexing_pressure to nodes stats (elastic#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
hub-cap authored Jul 29, 2020
1 parent 2813960 commit acaedc5
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/telemetry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Supported telemetry parameters:
* ``node-stats-include-mem`` (default: ``true``): A boolean indicating whether JVM heap stats should be included.
* ``node-stats-include-network`` (default: ``true``): A boolean indicating whether network-related stats should be included.
* ``node-stats-include-process`` (default: ``true``): A boolean indicating whether process cpu stats should be included.
* ``node-stats-include-indexing-pressure`` (default: ``true``): A boolean indicating whether indexing pressuer stats should be included.

recovery-stats
--------------
Expand Down
6 changes: 6 additions & 0 deletions esrally/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ def __init__(self, telemetry_params, cluster_name, client, metrics_store):
self.include_process = telemetry_params.get("node-stats-include-process", True)
self.include_mem_stats = telemetry_params.get("node-stats-include-mem", True)
self.include_gc_stats = telemetry_params.get("node-stats-include-gc", True)
self.include_indexing_pressure = telemetry_params.get("node-stats-include-indexing-pressure", True)
self.client = client
self.metrics_store = metrics_store
self.cluster_name = cluster_name
Expand Down Expand Up @@ -672,6 +673,8 @@ def record(self):
collected_node_stats.update(self.network_stats(node_name, node_stats))
if self.include_process:
collected_node_stats.update(self.process_stats(node_name, node_stats))
if self.include_indexing_pressure:
collected_node_stats.update(self.indexing_pressure(node_name, node_stats))

self.metrics_store.put_doc(dict(collected_node_stats),
level=MetaInfoScope.node,
Expand Down Expand Up @@ -733,6 +736,9 @@ def network_stats(self, node_name, node_stats):
def process_stats(self, node_name, node_stats):
return self.flatten_stats_fields(prefix="process_cpu", stats=node_stats["process"]["cpu"])

def indexing_pressure(self, node_name, node_stats):
return self.flatten_stats_fields(prefix="indexing_pressure", stats=node_stats["indexing_pressure"])

def sample(self):
import elasticsearch
try:
Expand Down
108 changes: 105 additions & 3 deletions tests/telemetry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,27 @@ class NodeStatsRecorderTests(TestCase):
"overhead": 1.0,
"tripped": 0
}
},
"indexing_pressure": {
"memory": {
"current": {
"combined_coordinating_and_primary_in_bytes": 0,
"coordinating_in_bytes": 0,
"primary_in_bytes": 0,
"replica_in_bytes": 0,
"all_in_bytes": 0
},
"total": {
"combined_coordinating_and_primary_in_bytes": 0,
"coordinating_in_bytes": 0,
"primary_in_bytes": 0,
"replica_in_bytes": 0,
"all_in_bytes": 0,
"coordinating_rejections": 0,
"primary_rejections": 0,
"replica_rejections": 0
}
}
}
}
}
Expand Down Expand Up @@ -1168,7 +1189,20 @@ class NodeStatsRecorderTests(TestCase):
"thread_pool_generic_active": 0,
"thread_pool_generic_rejected": 0,
"thread_pool_generic_largest": 4,
"thread_pool_generic_completed": 8
"thread_pool_generic_completed": 8,
"indexing_pressure_memory_current_combined_coordinating_and_primary_in_bytes": 0,
"indexing_pressure_memory_current_coordinating_in_bytes": 0,
"indexing_pressure_memory_current_primary_in_bytes": 0,
"indexing_pressure_memory_current_replica_in_bytes": 0,
"indexing_pressure_memory_current_all_in_bytes": 0,
"indexing_pressure_memory_total_combined_coordinating_and_primary_in_bytes": 0,
"indexing_pressure_memory_total_coordinating_in_bytes": 0,
"indexing_pressure_memory_total_primary_in_bytes": 0,
"indexing_pressure_memory_total_replica_in_bytes": 0,
"indexing_pressure_memory_total_all_in_bytes": 0,
"indexing_pressure_memory_total_coordinating_rejections": 0,
"indexing_pressure_memory_total_primary_rejections": 0,
"indexing_pressure_memory_total_replica_rejections": 0
})

def test_negative_sample_interval_forbidden(self):
Expand Down Expand Up @@ -1396,6 +1430,27 @@ def test_stores_all_nodes_stats(self, metrics_store_put_doc):
"overhead": 1.0,
"tripped": 0
}
},
"indexing_pressure": {
"memory": {
"current": {
"combined_coordinating_and_primary_in_bytes": 0,
"coordinating_in_bytes": 0,
"primary_in_bytes": 0,
"replica_in_bytes": 0,
"all_in_bytes": 0
},
"total": {
"combined_coordinating_and_primary_in_bytes": 0,
"coordinating_in_bytes": 0,
"primary_in_bytes": 0,
"replica_in_bytes": 0,
"all_in_bytes": 0,
"coordinating_rejections": 0,
"primary_rejections": 0,
"replica_rejections": 0
}
}
}
}
}
Expand Down Expand Up @@ -1488,7 +1543,20 @@ def test_stores_all_nodes_stats(self, metrics_store_put_doc):
"transport_tx_count": 88,
"transport_tx_size_in_bytes": 23879803,
"process_cpu_percent": 10,
"process_cpu_total_in_millis": 56520},
"process_cpu_total_in_millis": 56520,
"indexing_pressure_memory_current_combined_coordinating_and_primary_in_bytes": 0,
"indexing_pressure_memory_current_coordinating_in_bytes": 0,
"indexing_pressure_memory_current_primary_in_bytes": 0,
"indexing_pressure_memory_current_replica_in_bytes": 0,
"indexing_pressure_memory_current_all_in_bytes": 0,
"indexing_pressure_memory_total_combined_coordinating_and_primary_in_bytes": 0,
"indexing_pressure_memory_total_coordinating_in_bytes": 0,
"indexing_pressure_memory_total_primary_in_bytes": 0,
"indexing_pressure_memory_total_replica_in_bytes": 0,
"indexing_pressure_memory_total_all_in_bytes": 0,
"indexing_pressure_memory_total_coordinating_rejections": 0,
"indexing_pressure_memory_total_primary_rejections": 0,
"indexing_pressure_memory_total_replica_rejections": 0},
level=MetaInfoScope.node,
node_name="rally0",
meta_data=metrics_store_meta_data)
Expand Down Expand Up @@ -1673,6 +1741,27 @@ def test_stores_selected_indices_metrics_from_nodes_stats(self, metrics_store_pu
"overhead": 1.0,
"tripped": 0
}
},
"indexing_pressure": {
"memory": {
"current": {
"combined_coordinating_and_primary_in_bytes": 0,
"coordinating_in_bytes": 0,
"primary_in_bytes": 0,
"replica_in_bytes": 0,
"all_in_bytes": 0
},
"total": {
"combined_coordinating_and_primary_in_bytes": 0,
"coordinating_in_bytes": 0,
"primary_in_bytes": 0,
"replica_in_bytes": 0,
"all_in_bytes": 0,
"coordinating_rejections": 0,
"primary_rejections": 0,
"replica_rejections": 0
}
}
}
}
}
Expand Down Expand Up @@ -1740,7 +1829,20 @@ def test_stores_selected_indices_metrics_from_nodes_stats(self, metrics_store_pu
"transport_tx_count": 88,
"transport_tx_size_in_bytes": 23879803,
"process_cpu_percent": 10,
"process_cpu_total_in_millis": 56520},
"process_cpu_total_in_millis": 56520,
"indexing_pressure_memory_current_combined_coordinating_and_primary_in_bytes": 0,
"indexing_pressure_memory_current_coordinating_in_bytes": 0,
"indexing_pressure_memory_current_primary_in_bytes": 0,
"indexing_pressure_memory_current_replica_in_bytes": 0,
"indexing_pressure_memory_current_all_in_bytes": 0,
"indexing_pressure_memory_total_combined_coordinating_and_primary_in_bytes": 0,
"indexing_pressure_memory_total_coordinating_in_bytes": 0,
"indexing_pressure_memory_total_primary_in_bytes": 0,
"indexing_pressure_memory_total_replica_in_bytes": 0,
"indexing_pressure_memory_total_all_in_bytes": 0,
"indexing_pressure_memory_total_coordinating_rejections": 0,
"indexing_pressure_memory_total_primary_rejections": 0,
"indexing_pressure_memory_total_replica_rejections": 0},
level=MetaInfoScope.node,
node_name="rally0",
meta_data=metrics_store_meta_data)
Expand Down

0 comments on commit acaedc5

Please sign in to comment.