#
    tmpscale = np.reshape(scale[-useableSize:], newshape)
    strScale = prepareScale( tmpscale, options )

    if options.verbose:
        print ("newshape %d = %r" % (len(newshape), newshape) )
        print ("data2Dim %d = %r" % (len(data2Dim), data2Dim) )
        print ("scale %d = %r" % (len(strScale), strScale) )

    if options.verbose:
        print "Num events: %d" % len(scale)
        print "Creating graph."


    avg_usage = prepareGraph( options )
    avg_usage.title = options.title
    avg_usage.x_labels = strScale

    for key,val in avgData.items():
        avg_usage.add(key, val )
    # print "%s - %6.2f ms - prepare graph" % (datetime.datetime.now(), (time.time() - prevTime) * 1000)
    # prevTime = time.time()

    renderGraph( avg_usage, options )
    # print "%s - %6.2f ms - render graph" % (datetime.datetime.now(), (time.time() - prevTime) * 1000)
    # print "%s - %6.2f ms - Total time" % (datetime.datetime.now(), (time.time() - startTime) * 1000)

    if options.verbose:
        print "Done."

    # print ("scale %d = %r" % (len(strScale), strScale) )


    if VERBOSE:
        print ("newshape %d = %r" % (len(newshape), newshape) )
        print ("avg %d = %r" % (len(avg_working), avg_working) )
        print ("scale %d = %r" % (len(strScale), strScale) )

    graph = prepareGraph( options )
    graph.title = options.title
    graph.x_labels = strScale

    if options.offline:
        graph.add('Offline', avg_unknown )
    if options.paused:
        graph.add('Paused', avg_paused )
    if options.working:
        graph.add('Working', avg_working )
    if options.idle:
        graph.add('Idle', avg_idle )

    # print "%s - %6.2f ms - prepare graph" % (datetime.datetime.now(), (time.time()-prevTime) * 1000)
    # prevTime = time.time()

    renderGraph( graph, options )

    # print "%s - %6.2f ms - render graph" % (datetime.datetime.now(), (time.time() - prevTime) * 1000)
    # print "%s - %6.2f ms - Total time" % (datetime.datetime.now(), (time.time() - startTime) * 1000)

    if options.verbose:
        print "Done."
Exemple #3
0
    strScale = prepareScale(tmpscale, options)
    # print ("scale %d = %r" % (len(strScale), strScale) )

    if VERBOSE:
        print("newshape %d = %r" % (len(newshape), newshape))
        print("avg %d = %r" % (len(avg_working), avg_working))
        print("scale %d = %r" % (len(strScale), strScale))

    graph = prepareGraph(options)
    graph.title = options.title
    graph.x_labels = strScale

    if options.offline:
        graph.add('Offline', avg_unknown)
    if options.paused:
        graph.add('Paused', avg_paused)
    if options.working:
        graph.add('Working', avg_working)
    if options.idle:
        graph.add('Idle', avg_idle)

    # print "%s - %6.2f ms - prepare graph" % (datetime.datetime.now(), (time.time()-prevTime) * 1000)
    # prevTime = time.time()

    renderGraph(graph, options)

    # print "%s - %6.2f ms - render graph" % (datetime.datetime.now(), (time.time() - prevTime) * 1000)
    # print "%s - %6.2f ms - Total time" % (datetime.datetime.now(), (time.time() - startTime) * 1000)

    if options.verbose:
        print "Done."