def collect_instance_index_stats(self, host, port, metrics):
        result = self._get(host, port,
                           '_stats?clear=true&docs=true&store=true&'
                           + 'indexing=true&get=true&search=true', '_all')
        if not result:
            return

        _all = result['_all']
        self._index_metrics(metrics, 'indices._all', _all['primaries'])

        if 'indices' in _all:
            indices = _all['indices']
        elif 'indices' in result:          # elasticsearch >= 0.90RC2
            indices = result['indices']
        else:
            return

        for name, index in indices.iteritems():
            self._index_metrics(metrics, 'indices.%s' % name,
                                index['primaries'])
dataset/ETHPy150Open BrightcoveOS/Diamond/src/collectors/elasticsearch/elasticsearch.py/ElasticSearchCollector.collect_instance_index_stats/original