influxdata / Litmus

testing framework
0 stars 0 forks source link

Implement wrapper function for storectl command #181

Open kevinhogan111 opened 5 years ago

gshif commented 5 years ago

For storectl query:

f = {}
l = {}
for i in range(len(out)):
    if '_field' in out[i]:
        val = re.search(r'_field:f,_measurement:(.*)\x1b',out[i])
        print str(val)
        if val:
            series = val.group(1) 
            if series not in f:
                f[series] = {}
            else:
                pass            
    else:
        l = out[i:]
        print l
        for b in range(len(l)):
            print l[b]
            if '_field' not in l[b]:
                print l[b]
                if '' == l[b]:
                    pass
                elif 'points' in l[b]:
                    results = l[b].split()
                    b = 0
                    for i in range(len(results)):
                        if i < b:
                            pass
                        elif len(results) - 1 > i >=b:
                            f[results[i]] = results[i+1]
                            b = i + 2
                        else:
                            break
                else:
                    (time, value) = l[b].split()
                    f[series][time] = value
            else:
                break
gshif commented 5 years ago

Still need to complete the parsing of points correctly and time

gshif commented 5 years ago

results:

test_m,t:some_long_tag  ---->  {'time:': '920.055\xc2\xb5s', '1560371707482288780': '123.0000000000'}
sum(uint64):  ---->  0,
cpu,high:"high_cpu"  ---->  {'1560372272990327066': '99', '1560373410799506823': '95', '1560373426466262060': '93', '1560373455968909910': '91'}
sum(int64):  ---->  392,
cpu,high:"low_cpu"  ---->  {'1560373315409580324': '1', '1560375110396663730': '1', '1560373359850761680': '7', '1560373344577726384': '5'}
points(count):  ---->  9,
sum(float64):  ---->  123
gshif commented 5 years ago

We still waiting for https://github.com/influxdata/idpe/issues/3687 to be fixed