Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/perf/process_stat_array.py

    rb1a2c4a r77f1265  
    3131                with open(os.path.join(root, filename), 'r') as file:
    3232                        for line in file:
    33                                 # data = [int(x.strip()) for x in line.split(',')]
    34                                 data = [int(line.strip())]
     33                                data = [int(x.strip()) for x in line.split(',')]
    3534                                data = [me, *data]
    3635                                merged.append(data)
     
    5453
    5554# merge the data
    56 # for (me, time, value) in merged:
    57 for (me, value) in merged:
     55for (me, time, value) in merged:
    5856        # check now much this changes
    5957        old = counters[me]
     
    6361        # add change to the current
    6462        curr = curr + change
    65         single.append( value )
     63        single.append( (time, curr) )
    6664
    6765        pass
    6866
    69 print(single)
    70 
    71 # single = sorted(single)[:len(single)-100]
    72 # ms = max(single)
    73 # single = [float(x) / 2500.0 for x in single]
    74 
    7567#print
    76 # for t, v in single:
    77 #       print([t, v])
    78 # print(len(single))
    79 # print(max(single))
    80 # print(min(single))
    81 
    82 # bins = [0, 5.37751600e+04, 1.06903320e+05, 1.60031480e+05, 2.13159640e+05, 2.66287800e+05, 3.19415960e+05, 3.72544120e+05, 4.25672280e+05, 4.78800440e+05, 5.31928600e+05, 5.85056760e+05, 6.38184920e+05, 6.91313080e+05, 7.44441240e+05, 7.97569400e+05, 8.50697560e+05, 9.03825720e+05, 9.56953880e+05, 1.01008204e+06, 1.06321020e+06, 1.11633836e+06, 1.16946652e+06, 1.22259468e+06, 1.27572284e+06, 1.32885100e+06, 1.38197916e+06, 1.43510732e+06, 1.48823548e+06, 1.54136364e+06, 1.59449180e+06, 1.64761996e+06, 1.70074812e+06, 1.75387628e+06, 1.80700444e+06, 1.86013260e+06, 1.91326076e+06, 1.96638892e+06, 2.01951708e+06, 2.07264524e+06, 2.12577340e+06, 2.17890156e+06, 2.23202972e+06, 2.28515788e+06, 2.33828604e+06, 2.39141420e+06, 2.44454236e+06, 2.49767052e+06, 2.55079868e+06, 2.60392684e+06, 3.0e+06]
    83 # # bins = [float(x) / 2500.0 for x in bins]
    84 # # print([round(b, 2) for b in bins])
    85 
    86 # import numpy
    87 # # hist1, _ = numpy.histogram(single, density=True, bins=50)
    88 # hist2, _ = numpy.histogram(single, density=True, bins=bins)
    89 # # print(hist1)
    90 # print([1000.0 * h for h in hist2])
    91 # # for v in single:
    92 # #     print([v])
     68for t, v in single:
     69        print([t, v])
Note: See TracChangeset for help on using the changeset viewer.