Esempio n. 1
0
    if (row[0] != "time"):
        if (hbshift == None):
            hbshift = long(row[0][:-6])
        if (len(hbdata.x) > 0):
            hbdata.add(
                float(long(row[0][:-6]) - hbshift) / 1000.,
                hbdata.y[len(hbdata.y) - 1])
        hbdata.add(float(long(row[0][:-6]) - hbshift) / 1000., int(0))
        hbdata.add(float(long(row[0][:-6]) - hbshift) / 1000., int(row[1]))

# grab the data from influxdb
influxclient = InfluxDBClient(host=influxhost,
                              port=influxport,
                              database=influxdb)
groupings = {"other.other": []}
for iserie in influxclient.get_list_series(influxdb):
    for ilist in iserie["tags"]:
        if (not ilist["key"].startswith("cpu.trace")):
            tags = split(split(ilist["key"], sep=",")[0], sep=".")
            if (len(tags) >= 2):
                if (tags[0] + "." + tags[1]) in groupings:
                    groupings[tags[0] + "." + tags[1]].append(ilist["key"])
                else:
                    groupings[tags[0] + "." + tags[1]] = [ilist["key"]]
            else:
                groupings["other.other"].append(ilist["key"])
for igroupname in groupings:
    figs = []
    for iserie in groupings[igroupname]:
        currname = split(iserie, sep=',')[0]
        currpid = split(split(iserie, sep="pid=")[1], sep=",")[0]