Class: JayAPI::Elasticsearch::Stats::Index::Totals
- Inherits:
-
Object
- Object
- JayAPI::Elasticsearch::Stats::Index::Totals
- Defined in:
- lib/jay_api/elasticsearch/stats/index/totals.rb
Overview
Contains information about an index’s totals (docs, used space, etc).
Instance Method Summary collapse
-
#deleted_docs ⇒ Integer
The total number of deleted documents in the index.
-
#deleted_ratio ⇒ Float
A number between 0 and 1 that represents the ratio of between deleted documents and total documents in the index.
-
#docs_count ⇒ Integer
The total number of documents in the index.
-
#initialize(data) ⇒ Totals
constructor
A new instance of Totals.
Constructor Details
#initialize(data) ⇒ Totals
Returns a new instance of Totals.
10 11 12 |
# File 'lib/jay_api/elasticsearch/stats/index/totals.rb', line 10 def initialize(data) @data = data end |
Instance Method Details
#deleted_docs ⇒ Integer
Returns The total number of deleted documents in the index.
20 21 22 |
# File 'lib/jay_api/elasticsearch/stats/index/totals.rb', line 20 def deleted_docs @deleted_docs ||= docs.fetch('deleted') end |
#deleted_ratio ⇒ Float
Returns A number between 0 and 1 that represents the ratio of between deleted documents and total documents in the index.
26 27 28 |
# File 'lib/jay_api/elasticsearch/stats/index/totals.rb', line 26 def deleted_ratio @deleted_ratio ||= calculate_deleted_ratio end |
#docs_count ⇒ Integer
Returns The total number of documents in the index.
15 16 17 |
# File 'lib/jay_api/elasticsearch/stats/index/totals.rb', line 15 def docs_count @docs_count ||= docs.fetch('count') end |