def add_index_datapoints(self, stats):
        indices = stats.get('indices', dict())

        docs = indices.get('docs', dict())
        self.add_gauge_value('Indices/Documents/Count', 'docs',
                             docs.get('count', 0))
        self.add_derive_value('Indices/Documents/Added', 'docs',
                              docs.get('count', 0))
        self.add_derive_value('Indices/Documents/Deleted', 'docs',
                              docs.get('deleted', 0))

        store = indices.get('store', dict())
        self.add_gauge_value('Indices/Storage', 'bytes',
                             store.get('size_in_bytes', 0))
        self.add_derive_value('Indices/Storage Throttled', 'ms',
                              store.get('throttle_time_in_millis', 0))

        indexing = indices.get('indexing', dict())
        self.add_derive_value('Indices/Indexing', 'ms',
                              indexing.get('index_time_in_millis', 0))
        self.add_derive_value('Indices/Indexing', 'count',
                              indexing.get('index_total', 0))
        self.add_derive_value('Indices/Index Deletes', 'ms',
                              indexing.get('delete_time_in_millis', 0))
        self.add_derive_value('Indices/Index Deletes', 'count',
                              indexing.get('delete_total', 0))

        get_stats = indices.get('get', dict())
        self.add_derive_value('Indices/Get', 'count',
                             get_stats.get('total', 0))
        self.add_derive_value('Indices/Get', 'ms',
                              get_stats.get('time_in_millis', 0))
        self.add_derive_value('Indices/Get Hits', 'count',
                              get_stats.get('exists_total', 0))
        self.add_derive_value('Indices/Get Hits', 'ms',
                              get_stats.get('exists_time_in_millis', 0))
        self.add_derive_value('Indices/Get Misses', 'count',
                              get_stats.get('missing_total', 0))
        self.add_derive_value('Indices/Get Misses', 'ms',
                              get_stats.get('missing_time_in_millis', 0))

        search = indices.get('search', dict())
        self.add_gauge_value('Indices/Open Search Contexts', 'count',
                             search.get('open_contexts', 0))
        self.add_derive_value('Indices/Search Query', 'count',
                             search.get('query_total', 0))
        self.add_derive_value('Indices/Search Query', 'ms',
                              search.get('query_time_in_millis', 0))

        self.add_derive_value('Indices/Search Fetch', 'count',
                             search.get('fetch_total', 0))
        self.add_derive_value('Indices/Search Fetch', 'ms',
                              search.get('fetch_time_in_millis', 0))

        merge_stats = indices.get('merge', dict())
        self.add_derive_value('Indices/Merge', 'count',
                              merge_stats.get('total', 0))
        self.add_derive_value('Indices/Merge', 'ms',
                              merge_stats.get('total_time_in_millis', 0))

        flush_stats = indices.get('flush', dict())
        self.add_gauge_value('Indices/Flush', 'count',
                             flush_stats.get('total', 0))
        self.add_derive_value('Indices/Flush', 'ms',
                              flush_stats.get('total_time_in_millis', 0))
Add the data points for Component/Indices
dataset/ETHPy150Open MeetMe/newrelic-plugin-agent/newrelic_plugin_agent/plugins/elasticsearch.py/ElasticSearch.add_index_datapoints