Seeing duplicate tag values in TSI

Submit a new PR, seeing duplicate tag values when querying in the new TSI

[sborza@deskies]:~/src/stuffs/python/metrics (master *)$ python query.py
--- tsi host 1 ---
159674 <type 'list'> [u'host', u'hostname']
4330 <type 'set'>
--- tsm host 1 ---
7998 <type 'list'> [u'host', u'hostname']
7998 <type 'set'>
--- tsi host 2 ---
9603 <type 'list'> [u'host', u'hostname']
873 <type 'set'>
[sborza@deskies]:~/src/stuffs/python/metrics (master *)$ cat query.py
#!/usr/bin/env python

import urllib
import requests

def runit():
    """ simple query handler to prove duplicate host keys """
    query = "show tag values from cpu with key in (host)"

    for a in xrange(1, 4):
        host = "influx0{}".format(a)
        print "--- {} ---".format(host)

        r = requests.get("http://{}:8086/query?{}".format(host, urllib.urlencode({"db": "tg_udp", "q": query})))

        data = r.json()
        results = data['results'][0]['series'][0]['values']
        print len(results), type(results), results[10]

        unis = set([v for _, v in results])
        print len(unis), type(unis)

if __name__ == "__main__":
    runit()
2 Likes

@sebito91 Thanks for the report! I think @ben is on the case here…

2 Likes

Excellent, wanted to ensure coverage in GH and community :smiley:

1 Like

Verified fixed, yay! Thanks @ben

1 Like